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..0be7057993e451 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,6 +1,9 @@ +lib/internal/v8_prof_polyfill.js +lib/internal/v8_prof_processor.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 0bf34c83908c72..35907ef96db347 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,86 +1,81 @@ env: node: true - -# enable ECMAScript features -ecmaFeatures: - blockBindings: true - templateStrings: true - octalLiterals: true - binaryLiterals: true - generators: true - forOf: true - objectLiteralShorthandProperties: true - objectLiteralShorthandMethods: true - classes: true + es6: true rules: # Possible Errors - # list: https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors - ## check debugger sentence + # https://github.com/eslint/eslint/tree/master/docs/rules#possible-errors + 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-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 + # https://github.com/eslint/eslint/tree/master/docs/rules#best-practices no-fallthrough: 2 + no-octal: 2 + no-redeclare: 2 # 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 + # https://github.com/eslint/eslint/tree/master/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 + 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 + + # 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-this-before-super: 2 + prefer-const: 2 # Strict Mode - # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode - ## 'use strict' on top + # https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode strict: [2, "global"] # Variables - # list: https://github.com/eslint/eslint/tree/master/docs/rules#variables - ## disallow use of undefined variables (globals) + # https://github.com/eslint/eslint/tree/master/docs/rules#variables + no-delete-var: 2 no-undef: 2 + no-unused-vars: [2, {"args": "none"}] # Custom rules in tools/eslint-rules require-buffer: 2 + new-with-error: [2, "Error", "RangeError", "TypeError", "SyntaxError", "ReferenceError"] + # Global scoped method and vars globals: @@ -102,5 +97,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 4d21d95a75c9b5..8f75e34da6fd5a 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/ Release/ !doc/blog/** *.sln @@ -43,13 +43,14 @@ ipch/ /config.mk /config.gypi +/config_fips.gypi *-nodegyp* /gyp-mac-tool /dist-osx /npm.wxs /tools/msvs/npm.wixobj /tools/osx-pkg.pmdoc/index.xml -/test/addons/doc-*/ +/test/addons/??_*/ email.md deps/v8-* deps/icu @@ -71,6 +72,9 @@ deps/openssl/openssl.xml deps/openssl/openssl.target.mk deps/zlib/zlib.target.mk +# not needed and causes issues for distro packagers +deps/npm/node_modules/.bin/ + # build/release artifacts /*.tar.* /SHASUMS*.txt* diff --git a/.mailmap b/.mailmap index 0906e65c39f29f..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,14 +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 @@ -36,6 +43,8 @@ Einar Otto Stangvik Elliott Cable EungJun Yi Evan Larkin +Evan Lucas +Evan Lucas Farid Neshat Fedor Indutny Felix Böhm @@ -47,25 +56,33 @@ 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 +Karl Skomski Kazuyuki Yamada Keith M Wesolowski Kelsey Breseman @@ -76,6 +93,10 @@ Luke Bayes Maciej Małecki Malte-Thorben Bruns Malte-Thorben Bruns +Marcin Cieślak +Marcin Cieślak +Marti Martz +Martial James Jefferson Mathias Pettersson Matthew Lye Michael Bernstein @@ -90,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 @@ -121,6 +146,7 @@ Tadashi SAWADA Takahiro ANDO Ted Young Thomas Lee +Thomas Reggi Tim Caswell Tim Price Tim Smart diff --git a/AUTHORS b/AUTHORS index cfcf86132de0ea..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 @@ -786,5 +785,88 @@ Matt Loring P.S.V.R Jacob Edelman Mike Atkins +hackerjs <4141095@qq.com> +Minwoo Jung +Marcin Cieślak +Anne-Gaelle Colom +Oleksandr Chekhovskyi +Tristian Flanagan +Mike Tunnicliffe +Ionică Bizău +Danny Nemer +Sven Slootweg +Dmitry Vasilyev +Malcolm Ahoy +Imran Iqbal +Stewart Addison +Matt Harrison +Christopher J. Brody +Salman Aljammaz +Thomas Reggi +Laurent Fortin +Fabio Oliveira +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/CHANGELOG.md b/CHANGELOG.md index 14edf85c89194e..03c0be8813c2e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,1423 @@ # Node.js ChangeLog +## 2016-03-08, Version 4.4.0 'Argon' (LTS), @thealphanerd + +In December we announced that we would be doing a minor release in order to +get a number of voted on SEMVER-MINOR changes into LTS. Our ability to release this +was delayed due to the unforeseen security release v4.3. We are quickly bumping to +v4.4 in order to bring you the features that we had committed to releasing. + +This release also includes over 70 fixes to our docs and over 50 fixes to tests. + +### Notable changes + +The SEMVER-MINOR changes include: + * **deps**: + - An update to v8 that introduces a new flag --perf_basic_prof_only_functions (Ali Ijaz Sheikh) [#3609](https://github.com/nodejs/node/pull/3609) + * **http**: + - A new feature in http(s) agent that catches errors on *keep alived* connections (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) + * **src**: + - Better support for Big-Endian systems (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) + * **tls**: + - A new feature that allows you to pass common SSL options to `tls.createSecurePair` (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) + * **tools**: + - a new flag `--prof-process` which will execute the tick processor on the provided isolate files (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) + +Notable semver patch changes include: + + * **buld**: + - Support python path that includes spaces. This should be of particular interest to our Windows users who may have python living in `c:/Program Files` (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) + * **https**: + - A potential fix for [#3692](https://github.com/nodejs/node/issues/3692) HTTP/HTTPS client requests throwing EPROTO (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) + * **installer**: + - More readable profiling information from isolate tick logs (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) + * **npm**: + - upgrade to npm 2.14.20 (Kat Marchán) [#5510](https://github.com/nodejs/node/pull/5510) + * **process**: + - Add support for symbols in event emitters. Symbols didn't exist when it was written ¯\_(ツ)_/¯ (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) + * **querystring**: + - querystring.parse() is now 13-22% faster! (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) + * **streams**: + - performance improvements for moving small buffers that shows a 5% throughput gain. IoT projects have been seen to be as much as 10% faster with this change! (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) + * **tools**: + - eslint has been updated to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) + +### Commits + +* [[`360e04fd5a`](https://github.com/nodejs/node/commit/360e04fd5a)] - internal/child_process: call postSend on error (Fedor Indutny) [#4752](https://github.com/nodejs/node/pull/4752) +* [[`a29f501aa2`](https://github.com/nodejs/node/commit/a29f501aa2)] - **benchmark**: add a constant declaration for `net` (Minwoo Jung) [#3950](https://github.com/nodejs/node/pull/3950) +* [[`85e06a2e34`](https://github.com/nodejs/node/commit/85e06a2e34)] - **(SEMVER-MINOR)** **buffer**: allow encoding param to collapse (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) +* [[`fe893a8ebc`](https://github.com/nodejs/node/commit/fe893a8ebc)] - **(SEMVER-MINOR)** **buffer**: properly retrieve binary length of needle (Trevor Norris) [#4803](https://github.com/nodejs/node/pull/4803) +* [[`fae7c9db3f`](https://github.com/nodejs/node/commit/fae7c9db3f)] - **buffer**: refactor redeclared variables (Rich Trott) [#4886](https://github.com/nodejs/node/pull/4886) +* [[`4a6e2b26f7`](https://github.com/nodejs/node/commit/4a6e2b26f7)] - **build**: treat aarch64 as arm64 (Johan Bergström) [#5191](https://github.com/nodejs/node/pull/5191) +* [[`bc2536dfc6`](https://github.com/nodejs/node/commit/bc2536dfc6)] - **build**: add a help message and removed a TODO. (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`f6416be5d2`](https://github.com/nodejs/node/commit/f6416be5d2)] - **build**: remove redundant TODO in configure (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`6deb7a6eb8`](https://github.com/nodejs/node/commit/6deb7a6eb8)] - **build**: remove Makefile.build (Ojas Shirekar) [#5080](https://github.com/nodejs/node/pull/5080) +* [[`66d1115555`](https://github.com/nodejs/node/commit/66d1115555)] - **build**: fix build when python path contains spaces (Felix Becker) [#4841](https://github.com/nodejs/node/pull/4841) +* [[`29951cf36a`](https://github.com/nodejs/node/commit/29951cf36a)] - **child_process**: fix data loss with readable event (Brian White) [#5036](https://github.com/nodejs/node/pull/5036) +* [[`81d4127279`](https://github.com/nodejs/node/commit/81d4127279)] - **cluster**: dont rely on `this` in `fork` (Igor Klopov) [#5216](https://github.com/nodejs/node/pull/5216) +* [[`de4c07b29e`](https://github.com/nodejs/node/commit/de4c07b29e)] - **console**: apply null as `this` for util.format (Jackson Tian) [#5222](https://github.com/nodejs/node/pull/5222) +* [[`4e0755cab3`](https://github.com/nodejs/node/commit/4e0755cab3)] - **crypto**: have fixed NodeBIOs return EOF (Adam Langley) [#5105](https://github.com/nodejs/node/pull/5105) +* [[`a7955d5071`](https://github.com/nodejs/node/commit/a7955d5071)] - **crypto**: fix memory leak in LoadPKCS12 (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) +* [[`5d9c1cf001`](https://github.com/nodejs/node/commit/5d9c1cf001)] - **crypto**: add `pfx` certs as CA certs too (Fedor Indutny) [#5109](https://github.com/nodejs/node/pull/5109) +* [[`ab5cb0539b`](https://github.com/nodejs/node/commit/ab5cb0539b)] - **crypto**: use SSL_CTX_clear_extra_chain_certs. (Adam Langley) [#4919](https://github.com/nodejs/node/pull/4919) +* [[`198928eb9f`](https://github.com/nodejs/node/commit/198928eb9f)] - **crypto**: fix build when OCSP-stapling not provided (Adam Langley) [#4914](https://github.com/nodejs/node/pull/4914) +* [[`b8e1089df0`](https://github.com/nodejs/node/commit/b8e1089df0)] - **crypto**: use a const SSL_CIPHER (Adam Langley) [#4913](https://github.com/nodejs/node/pull/4913) +* [[`139d6d9284`](https://github.com/nodejs/node/commit/139d6d9284)] - **debugger**: assert test before accessing this.binding (Prince J Wesley) [#5145](https://github.com/nodejs/node/pull/5145) +* [[`9c8f2ab546`](https://github.com/nodejs/node/commit/9c8f2ab546)] - **deps**: upgrade to npm 2.14.20 (Kat Marchán) [#5510](https://github.com/nodejs/node/pull/5510) +* [[`e591a0927f`](https://github.com/nodejs/node/commit/e591a0927f)] - **deps**: upgrade to npm 2.14.19 (Kat Marchán) [#5335](https://github.com/nodejs/node/pull/5335) +* [[`a5ce67a0aa`](https://github.com/nodejs/node/commit/a5ce67a0aa)] - **deps**: upgrade to npm 2.14.18 (Kat Marchán) [#5245](https://github.com/nodejs/node/pull/5245) +* [[`469db021f7`](https://github.com/nodejs/node/commit/469db021f7)] - **(SEMVER-MINOR)** **deps**: backport 9da3ab6 from V8 upstream (Ali Ijaz Sheikh) [#3609](https://github.com/nodejs/node/pull/3609) +* [[`3ca04a5de9`](https://github.com/nodejs/node/commit/3ca04a5de9)] - **deps**: backport 8d00c2c from v8 upstream (Gibson Fahnestock) [#5024](https://github.com/nodejs/node/pull/5024) +* [[`60e0bd4be9`](https://github.com/nodejs/node/commit/60e0bd4be9)] - **deps**: upgrade to npm 2.14.17 (Kat Marchán) [#5110](https://github.com/nodejs/node/pull/5110) +* [[`976b9a9ab3`](https://github.com/nodejs/node/commit/976b9a9ab3)] - **deps**: upgrade to npm 2.14.16 (Kat Marchán) [#4960](https://github.com/nodejs/node/pull/4960) +* [[`38b370abea`](https://github.com/nodejs/node/commit/38b370abea)] - **deps**: upgrade to npm 2.14.15 (Kat Marchán) [#4872](https://github.com/nodejs/node/pull/4872) +* [[`82f549ef81`](https://github.com/nodejs/node/commit/82f549ef81)] - **dgram**: scope redeclared variables (Rich Trott) [#4940](https://github.com/nodejs/node/pull/4940) +* [[`063e14b568`](https://github.com/nodejs/node/commit/063e14b568)] - **dns**: throw a TypeError in lookupService with invalid port (Evan Lucas) [#4839](https://github.com/nodejs/node/pull/4839) +* [[`a2613aefae`](https://github.com/nodejs/node/commit/a2613aefae)] - **doc**: remove out-of-date matter from internal docs (Rich Trott) [#5421](https://github.com/nodejs/node/pull/5421) +* [[`394743f4b3`](https://github.com/nodejs/node/commit/394743f4b3)] - **doc**: explicit about VS 2015 support in readme (Phillip Johnsen) [#5406](https://github.com/nodejs/node/pull/5406) +* [[`da6b26fbfb`](https://github.com/nodejs/node/commit/da6b26fbfb)] - **doc**: copyedit util doc (Rich Trott) [#5399](https://github.com/nodejs/node/pull/5399) +* [[`7070ad0cc0`](https://github.com/nodejs/node/commit/7070ad0cc0)] - **doc**: mention prototype check in deepStrictEqual() (cjihrig) [#5367](https://github.com/nodejs/node/pull/5367) +* [[`d4789fc5fd`](https://github.com/nodejs/node/commit/d4789fc5fd)] - **doc**: s/http/https in Myles Borins' GitHub link (Rod Vagg) [#5356](https://github.com/nodejs/node/pull/5356) +* [[`b86540d1eb`](https://github.com/nodejs/node/commit/b86540d1eb)] - **doc**: clarify error handling in net.createServer (Dirceu Pereira Tiegs) [#5353](https://github.com/nodejs/node/pull/5353) +* [[`3106297037`](https://github.com/nodejs/node/commit/3106297037)] - **doc**: `require` behavior on case-insensitive systems (Hugo Wood) +* [[`e0b45e4315`](https://github.com/nodejs/node/commit/e0b45e4315)] - **doc**: update repo docs to use 'CTC' (Alexis Campailla) [#5304](https://github.com/nodejs/node/pull/5304) +* [[`e355f13989`](https://github.com/nodejs/node/commit/e355f13989)] - **doc**: improvements to crypto.markdown copy (Alexander Makarenko) [#5230](https://github.com/nodejs/node/pull/5230) +* [[`a9035b5e1d`](https://github.com/nodejs/node/commit/a9035b5e1d)] - **doc**: link to man pages (dcposch@dcpos.ch) [#5073](https://github.com/nodejs/node/pull/5073) +* [[`2043e6a63c`](https://github.com/nodejs/node/commit/2043e6a63c)] - **doc**: clarify child_process.execFile{,Sync} file arg (Kevin Locke) [#5310](https://github.com/nodejs/node/pull/5310) +* [[`8c732ad1e1`](https://github.com/nodejs/node/commit/8c732ad1e1)] - **doc**: fix buf.length slice example (Chinedu Francis Nwafili) [#5259](https://github.com/nodejs/node/pull/5259) +* [[`6c27c78b8b`](https://github.com/nodejs/node/commit/6c27c78b8b)] - **doc**: fix buffer\[index\] example (Chinedu Francis Nwafili) [#5253](https://github.com/nodejs/node/pull/5253) +* [[`7765f99683`](https://github.com/nodejs/node/commit/7765f99683)] - **doc**: fix template string (Rafael Cepeda) [#5240](https://github.com/nodejs/node/pull/5240) +* [[`d15ef20162`](https://github.com/nodejs/node/commit/d15ef20162)] - **doc**: improvements to console.markdown copy (Alexander Makarenko) [#5225](https://github.com/nodejs/node/pull/5225) +* [[`593206a752`](https://github.com/nodejs/node/commit/593206a752)] - **doc**: fix net.createConnection() example (Brian White) [#5219](https://github.com/nodejs/node/pull/5219) +* [[`464636b5c5`](https://github.com/nodejs/node/commit/464636b5c5)] - **doc**: improve scrolling, various CSS tweaks (Roman Reiss) [#5198](https://github.com/nodejs/node/pull/5198) +* [[`f615cd5b0b`](https://github.com/nodejs/node/commit/f615cd5b0b)] - **doc**: console is asynchronous unless it's a file (Ben Noordhuis) [#5133](https://github.com/nodejs/node/pull/5133) +* [[`fbed0d11f1`](https://github.com/nodejs/node/commit/fbed0d11f1)] - **doc**: merging behavior of writeHead vs setHeader (Alejandro Oviedo) [#5081](https://github.com/nodejs/node/pull/5081) +* [[`b0bb42bd7d`](https://github.com/nodejs/node/commit/b0bb42bd7d)] - **doc**: fix reference to API `hash.final` (Minwoo Jung) [#5050](https://github.com/nodejs/node/pull/5050) +* [[`dee5045221`](https://github.com/nodejs/node/commit/dee5045221)] - **doc**: uppercase 'RSA-SHA256' in crypto.markdown (Rainer Oviir) [#5044](https://github.com/nodejs/node/pull/5044) +* [[`498052a017`](https://github.com/nodejs/node/commit/498052a017)] - **doc**: consistent styling for functions in TLS docs (Alexander Makarenko) [#5000](https://github.com/nodejs/node/pull/5000) +* [[`031277e6f8`](https://github.com/nodejs/node/commit/031277e6f8)] - **doc**: apply consistent styling for functions (Rich Trott) [#4974](https://github.com/nodejs/node/pull/4974) +* [[`808fe0ea48`](https://github.com/nodejs/node/commit/808fe0ea48)] - **doc**: fix `notDeepEqual` API (Minwoo Jung) [#4971](https://github.com/nodejs/node/pull/4971) +* [[`5b9025689f`](https://github.com/nodejs/node/commit/5b9025689f)] - **doc**: show links consistently in deprecations (Sakthipriyan Vairamani) [#4907](https://github.com/nodejs/node/pull/4907) +* [[`3a1865db5e`](https://github.com/nodejs/node/commit/3a1865db5e)] - **doc**: don't use "interface" as a variable name (ChALkeR) [#4900](https://github.com/nodejs/node/pull/4900) +* [[`90715c3d68`](https://github.com/nodejs/node/commit/90715c3d68)] - **doc**: keep the names in sorted order (Sakthipriyan Vairamani) [#4876](https://github.com/nodejs/node/pull/4876) +* [[`d8b3b25c9c`](https://github.com/nodejs/node/commit/d8b3b25c9c)] - **doc**: fix JSON generation for aliased methods (Timothy Gu) [#4871](https://github.com/nodejs/node/pull/4871) +* [[`7b763c8d25`](https://github.com/nodejs/node/commit/7b763c8d25)] - **doc**: fix code type of markdowns (Jackson Tian) [#4858](https://github.com/nodejs/node/pull/4858) +* [[`37d4e7afc2`](https://github.com/nodejs/node/commit/37d4e7afc2)] - **doc**: check for errors in 'listen' event (Benjamin Gruenbaum) [#4834](https://github.com/nodejs/node/pull/4834) +* [[`3f876b104c`](https://github.com/nodejs/node/commit/3f876b104c)] - **doc**: Examples work when data exceeds buffer size (Glen Arrowsmith) [#4811](https://github.com/nodejs/node/pull/4811) +* [[`e3e20422a7`](https://github.com/nodejs/node/commit/e3e20422a7)] - **doc**: harmonize $ node command line notation (Robert Jefe Lindstaedt) [#4806](https://github.com/nodejs/node/pull/4806) +* [[`73e0195cef`](https://github.com/nodejs/node/commit/73e0195cef)] - **doc**: fix type references for link gen, link css (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) +* [[`0bdac429e1`](https://github.com/nodejs/node/commit/0bdac429e1)] - **doc**: multiple improvements in Stream docs (Alexander Makarenko) [#5009](https://github.com/nodejs/node/pull/5009) +* [[`693c16fb6b`](https://github.com/nodejs/node/commit/693c16fb6b)] - **doc**: fix anchor links from stream to http and events (piepmatz) [#5007](https://github.com/nodejs/node/pull/5007) +* [[`5fb533522c`](https://github.com/nodejs/node/commit/5fb533522c)] - **doc**: replace function expressions with arrows (Benjamin Gruenbaum) [#4832](https://github.com/nodejs/node/pull/4832) +* [[`e3572fb809`](https://github.com/nodejs/node/commit/e3572fb809)] - **doc**: fix links order in Buffer doc (Alexander Makarenko) [#5076](https://github.com/nodejs/node/pull/5076) +* [[`5c936ab765`](https://github.com/nodejs/node/commit/5c936ab765)] - **doc**: clarify optional arguments of Buffer methods (Michaël Zasso) [#5008](https://github.com/nodejs/node/pull/5008) +* [[`6df350c2b3`](https://github.com/nodejs/node/commit/6df350c2b3)] - **doc**: improve styling consistency in Buffer docs (Alexander Makarenko) [#5001](https://github.com/nodejs/node/pull/5001) +* [[`047f4a157f`](https://github.com/nodejs/node/commit/047f4a157f)] - **doc**: make buffer methods styles consistent (Timothy Gu) [#4873](https://github.com/nodejs/node/pull/4873) +* [[`4cfc017b90`](https://github.com/nodejs/node/commit/4cfc017b90)] - **doc**: fix nonsensical grammar in Buffer::write (Jimb Esser) [#4863](https://github.com/nodejs/node/pull/4863) +* [[`9087f6daca`](https://github.com/nodejs/node/commit/9087f6daca)] - **doc**: fix named anchors in addons.markdown and http.markdown (Michael Theriot) [#4708](https://github.com/nodejs/node/pull/4708) +* [[`4c8713ce58`](https://github.com/nodejs/node/commit/4c8713ce58)] - **doc**: add buf.indexOf encoding param with example (Karl Skomski) [#3373](https://github.com/nodejs/node/pull/3373) +* [[`1819d74491`](https://github.com/nodejs/node/commit/1819d74491)] - **doc**: fenced all code blocks, typo fixes (Robert Jefe Lindstaedt) [#4733](https://github.com/nodejs/node/pull/4733) +* [[`961735e645`](https://github.com/nodejs/node/commit/961735e645)] - **doc**: make references clickable (Roman Klauke) [#4654](https://github.com/nodejs/node/pull/4654) +* [[`7e80442483`](https://github.com/nodejs/node/commit/7e80442483)] - **doc**: improve child_process.execFile() code example (Ryan Sobol) [#4504](https://github.com/nodejs/node/pull/4504) +* [[`de9ad5b39d`](https://github.com/nodejs/node/commit/de9ad5b39d)] - **doc**: remove "above" and "below" references (Richard Sun) [#4499](https://github.com/nodejs/node/pull/4499) +* [[`c549ca3b69`](https://github.com/nodejs/node/commit/c549ca3b69)] - **doc**: fix heading level error in Buffer doc (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) +* [[`a613bae14c`](https://github.com/nodejs/node/commit/a613bae14c)] - **doc**: improvements to crypto.markdown copy (James M Snell) [#4435](https://github.com/nodejs/node/pull/4435) +* [[`18f580d0c1`](https://github.com/nodejs/node/commit/18f580d0c1)] - **doc**: improve child_process.markdown copy (James M Snell) [#4383](https://github.com/nodejs/node/pull/4383) +* [[`a929837311`](https://github.com/nodejs/node/commit/a929837311)] - **doc**: improvements to buffer.markdown copy (James M Snell) [#4370](https://github.com/nodejs/node/pull/4370) +* [[`a22f688407`](https://github.com/nodejs/node/commit/a22f688407)] - **doc**: improve addons.markdown copy (James M Snell) [#4320](https://github.com/nodejs/node/pull/4320) +* [[`94c2de47b1`](https://github.com/nodejs/node/commit/94c2de47b1)] - **doc**: update process.send() signature (cjihrig) [#5284](https://github.com/nodejs/node/pull/5284) +* [[`4e1926cb08`](https://github.com/nodejs/node/commit/4e1926cb08)] - **doc**: replace node-forward link in CONTRIBUTING.md (Ben Noordhuis) [#5227](https://github.com/nodejs/node/pull/5227) +* [[`e1713e81e5`](https://github.com/nodejs/node/commit/e1713e81e5)] - **doc**: fix minor inconsistencies in repl doc (Rich Trott) [#5193](https://github.com/nodejs/node/pull/5193) +* [[`b2e72c0d92`](https://github.com/nodejs/node/commit/b2e72c0d92)] - **doc**: clarify exceptions during uncaughtException (Noah Rose) [#5180](https://github.com/nodejs/node/pull/5180) +* [[`c3c549836a`](https://github.com/nodejs/node/commit/c3c549836a)] - **doc**: update DCO to v1.1 (Mikeal Rogers) [#5170](https://github.com/nodejs/node/pull/5170) +* [[`9dd35ad594`](https://github.com/nodejs/node/commit/9dd35ad594)] - **doc**: fix dgram doc indentation (Rich Trott) [#5118](https://github.com/nodejs/node/pull/5118) +* [[`eed830702c`](https://github.com/nodejs/node/commit/eed830702c)] - **doc**: fix typo in dgram doc (Rich Trott) [#5114](https://github.com/nodejs/node/pull/5114) +* [[`abfb2f5864`](https://github.com/nodejs/node/commit/abfb2f5864)] - **doc**: fix link in cluster documentation (Timothy Gu) [#5068](https://github.com/nodejs/node/pull/5068) +* [[`8b040b5bb2`](https://github.com/nodejs/node/commit/8b040b5bb2)] - **doc**: fix minor typo in process doc (Prayag Verma) [#5018](https://github.com/nodejs/node/pull/5018) +* [[`47eebe1d80`](https://github.com/nodejs/node/commit/47eebe1d80)] - **doc**: fix typo in Readme.md (Prayag Verma) [#5017](https://github.com/nodejs/node/pull/5017) +* [[`2b97ff89a6`](https://github.com/nodejs/node/commit/2b97ff89a6)] - **doc**: minor improvement in OS docs (Alexander Makarenko) [#5006](https://github.com/nodejs/node/pull/5006) +* [[`9a5d58b89e`](https://github.com/nodejs/node/commit/9a5d58b89e)] - **doc**: improve styling consistency in VM docs (Alexander Makarenko) [#5005](https://github.com/nodejs/node/pull/5005) +* [[`960e1bab98`](https://github.com/nodejs/node/commit/960e1bab98)] - **doc**: minor improvement to HTTPS doc (Alexander Makarenko) [#5002](https://github.com/nodejs/node/pull/5002) +* [[`6048b011e8`](https://github.com/nodejs/node/commit/6048b011e8)] - **doc**: spell writable consistently (Peter Lyons) [#4954](https://github.com/nodejs/node/pull/4954) +* [[`7b8f904167`](https://github.com/nodejs/node/commit/7b8f904167)] - **doc**: update eol handling in readline (Kári Tristan Helgason) [#4927](https://github.com/nodejs/node/pull/4927) +* [[`83efd0d4d1`](https://github.com/nodejs/node/commit/83efd0d4d1)] - **doc**: add more details to process.env (Evan Lucas) [#4924](https://github.com/nodejs/node/pull/4924) +* [[`b2d2c0b588`](https://github.com/nodejs/node/commit/b2d2c0b588)] - **doc**: undo move http.IncomingMessage.statusMessage (Jeff Harris) [#4822](https://github.com/nodejs/node/pull/4822) +* [[`b091c41b53`](https://github.com/nodejs/node/commit/b091c41b53)] - **doc**: proper markdown escaping -> \_\_, \*, \_ (Robert Jefe Lindstaedt) [#4805](https://github.com/nodejs/node/pull/4805) +* [[`0887208290`](https://github.com/nodejs/node/commit/0887208290)] - **doc**: remove unnecessary bind(this) (Dmitriy Lazarev) [#4797](https://github.com/nodejs/node/pull/4797) +* [[`f3e3c70bca`](https://github.com/nodejs/node/commit/f3e3c70bca)] - **doc**: Update small error in LICENSE for npm (Kat Marchán) [#4872](https://github.com/nodejs/node/pull/4872) +* [[`e703b180b3`](https://github.com/nodejs/node/commit/e703b180b3)] - **doc,tools,test**: lint doc-based addon tests (Rich Trott) [#5427](https://github.com/nodejs/node/pull/5427) +* [[`0f3b8ca192`](https://github.com/nodejs/node/commit/0f3b8ca192)] - **fs**: refactor redeclared variables (Rich Trott) [#4959](https://github.com/nodejs/node/pull/4959) +* [[`152c6b6b8d`](https://github.com/nodejs/node/commit/152c6b6b8d)] - **http**: remove reference to onParserExecute (Tom Atkinson) [#4773](https://github.com/nodejs/node/pull/4773) +* [[`6a0571cd72`](https://github.com/nodejs/node/commit/6a0571cd72)] - **http**: do not emit `upgrade` on advertisement (Fedor Indutny) [#4337](https://github.com/nodejs/node/pull/4337) +* [[`567ced9ef0`](https://github.com/nodejs/node/commit/567ced9ef0)] - **(SEMVER-MINOR)** **http**: handle errors on idle sockets (José F. Romaniello) [#4482](https://github.com/nodejs/node/pull/4482) +* [[`de5177ccb8`](https://github.com/nodejs/node/commit/de5177ccb8)] - **https**: evict cached sessions on error (Fedor Indutny) [#4982](https://github.com/nodejs/node/pull/4982) +* [[`77a6036264`](https://github.com/nodejs/node/commit/77a6036264)] - **installer**: install the tick processor (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) +* [[`ea16d8d7c5`](https://github.com/nodejs/node/commit/ea16d8d7c5)] - **lib**: remove string_decoder.js var redeclarations (Rich Trott) [#4978](https://github.com/nodejs/node/pull/4978) +* [[`1389660ab3`](https://github.com/nodejs/node/commit/1389660ab3)] - **lib**: scope loop variables (Rich Trott) [#4965](https://github.com/nodejs/node/pull/4965) +* [[`59255d7218`](https://github.com/nodejs/node/commit/59255d7218)] - **lib**: use arrow functions instead of bind (Minwoo Jung) [#3622](https://github.com/nodejs/node/pull/3622) +* [[`fd26960aab`](https://github.com/nodejs/node/commit/fd26960aab)] - **lib,test**: remove extra semicolons (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) +* [[`9646d26ffd`](https://github.com/nodejs/node/commit/9646d26ffd)] - **module**: refactor redeclared variable (Rich Trott) [#4962](https://github.com/nodejs/node/pull/4962) +* [[`09311128e8`](https://github.com/nodejs/node/commit/09311128e8)] - **net**: use `_server` for internal book-keeping (Fedor Indutny) [#5262](https://github.com/nodejs/node/pull/5262) +* [[`824c402174`](https://github.com/nodejs/node/commit/824c402174)] - **net**: refactor redeclared variables (Rich Trott) [#4963](https://github.com/nodejs/node/pull/4963) +* [[`96f306f3cf`](https://github.com/nodejs/node/commit/96f306f3cf)] - **net**: move isLegalPort to internal/net (Evan Lucas) [#4882](https://github.com/nodejs/node/pull/4882) +* [[`78d64889bd`](https://github.com/nodejs/node/commit/78d64889bd)] - **node**: set process._eventsCount to 0 on startup (Evan Lucas) [#5208](https://github.com/nodejs/node/pull/5208) +* [[`7a2e8f4356`](https://github.com/nodejs/node/commit/7a2e8f4356)] - **process**: support symbol events (cjihrig) [#4798](https://github.com/nodejs/node/pull/4798) +* [[`c9e2dce247`](https://github.com/nodejs/node/commit/c9e2dce247)] - **querystring**: improve parse() performance (Brian White) [#4675](https://github.com/nodejs/node/pull/4675) +* [[`18542c41fe`](https://github.com/nodejs/node/commit/18542c41fe)] - **repl**: remove variable redeclaration (Rich Trott) [#4977](https://github.com/nodejs/node/pull/4977) +* [[`10be8dc360`](https://github.com/nodejs/node/commit/10be8dc360)] - **src**: force line buffering for stderr (Rich Trott) [#3701](https://github.com/nodejs/node/pull/3701) +* [[`7958664e85`](https://github.com/nodejs/node/commit/7958664e85)] - **src**: clean up usage of __proto__ (Jackson Tian) [#5069](https://github.com/nodejs/node/pull/5069) +* [[`4e0a0d51b3`](https://github.com/nodejs/node/commit/4e0a0d51b3)] - **src**: remove no longer relevant comments (Chris911) [#4843](https://github.com/nodejs/node/pull/4843) +* [[`51c8bc8abc`](https://github.com/nodejs/node/commit/51c8bc8abc)] - **src**: remove __builtin_bswap16 call (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) +* [[`5e1976e37c`](https://github.com/nodejs/node/commit/5e1976e37c)] - **src**: remove unused BITS_PER_LONG macro (Ben Noordhuis) [#4290](https://github.com/nodejs/node/pull/4290) +* [[`c18ef54d88`](https://github.com/nodejs/node/commit/c18ef54d88)] - **(SEMVER-MINOR)** **src**: add BE support to StringBytes::Encode() (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) +* [[`be9e7610b5`](https://github.com/nodejs/node/commit/be9e7610b5)] - **src,test,tools**: modify for more stringent linting (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`538c4756a7`](https://github.com/nodejs/node/commit/538c4756a7)] - **stream**: refactor redeclared variables (Rich Trott) [#4816](https://github.com/nodejs/node/pull/4816) +* [[`4fa22e4126`](https://github.com/nodejs/node/commit/4fa22e4126)] - **streams**: 5% throughput gain when sending small chunks (Matteo Collina) [#4354](https://github.com/nodejs/node/pull/4354) +* [[`b6bd87495f`](https://github.com/nodejs/node/commit/b6bd87495f)] - **test**: remove flaky mark for test-debug-no-context (Rich Trott) [#5317](https://github.com/nodejs/node/pull/5317) +* [[`7705360e35`](https://github.com/nodejs/node/commit/7705360e35)] - **test**: add test for https server close event (Braydon Fuller) [#5106](https://github.com/nodejs/node/pull/5106) +* [[`9d6623e1d1`](https://github.com/nodejs/node/commit/9d6623e1d1)] - **test**: use String.prototype.repeat() for clarity (Rich Trott) [#5311](https://github.com/nodejs/node/pull/5311) +* [[`18e3987e2e`](https://github.com/nodejs/node/commit/18e3987e2e)] - **test**: mitigate flaky test-debug-no-context (Rich Trott) [#5269](https://github.com/nodejs/node/pull/5269) +* [[`058db07ce8`](https://github.com/nodejs/node/commit/058db07ce8)] - **test**: refactor test-dgram-send-callback-recursive (Santiago Gimeno) [#5079](https://github.com/nodejs/node/pull/5079) +* [[`1647113d7a`](https://github.com/nodejs/node/commit/1647113d7a)] - **test**: refactor test-http-destroyed-socket-write2 (Santiago Gimeno) [#4970](https://github.com/nodejs/node/pull/4970) +* [[`07dc2b50e2`](https://github.com/nodejs/node/commit/07dc2b50e2)] - **test**: shorten path for bogus socket (Rich Trott) [#4478](https://github.com/nodejs/node/pull/4478) +* [[`47e7c8c359`](https://github.com/nodejs/node/commit/47e7c8c359)] - **test**: mark test-http-regr-gh-2928 flaky (Rich Trott) [#5280](https://github.com/nodejs/node/pull/5280) +* [[`9dbd66f7ef`](https://github.com/nodejs/node/commit/9dbd66f7ef)] - **test**: mark test-http-agent flaky (Rich Trott) [#5209](https://github.com/nodejs/node/pull/5209) +* [[`98049876b5`](https://github.com/nodejs/node/commit/98049876b5)] - **test**: minimal repl eval option test (Rich Trott) [#5192](https://github.com/nodejs/node/pull/5192) +* [[`ae3185b8ac`](https://github.com/nodejs/node/commit/ae3185b8ac)] - **test**: disable fs watch tests for AIX (Michael Dawson) [#5187](https://github.com/nodejs/node/pull/5187) +* [[`b639c3345b`](https://github.com/nodejs/node/commit/b639c3345b)] - **test**: fix child-process-fork-regr-gh-2847 again (Santiago Gimeno) [#5179](https://github.com/nodejs/node/pull/5179) +* [[`8be3afc474`](https://github.com/nodejs/node/commit/8be3afc474)] - **test**: fix flaky test-http-regr-gh-2928 (Rich Trott) [#5154](https://github.com/nodejs/node/pull/5154) +* [[`46dc12bdcc`](https://github.com/nodejs/node/commit/46dc12bdcc)] - **test**: enable to work pkcs12 test in FIPS mode (Shigeki Ohtsu) [#5150](https://github.com/nodejs/node/pull/5150) +* [[`e19b8ea692`](https://github.com/nodejs/node/commit/e19b8ea692)] - **test**: remove unneeded common.indirectInstanceOf() (Rich Trott) [#5149](https://github.com/nodejs/node/pull/5149) +* [[`6072d2e15e`](https://github.com/nodejs/node/commit/6072d2e15e)] - **test**: disable gh-5100 test when in FIPS mode (Fedor Indutny) [#5144](https://github.com/nodejs/node/pull/5144) +* [[`a8417a2787`](https://github.com/nodejs/node/commit/a8417a2787)] - **test**: fix flaky test-dgram-pingpong (Rich Trott) [#5125](https://github.com/nodejs/node/pull/5125) +* [[`9db67a6a44`](https://github.com/nodejs/node/commit/9db67a6a44)] - **test**: fix child-process-fork-regr-gh-2847 (Santiago Gimeno) [#5121](https://github.com/nodejs/node/pull/5121) +* [[`69150caedc`](https://github.com/nodejs/node/commit/69150caedc)] - **test**: don't run test-tick-processor.js on Aix (Michael Dawson) [#5093](https://github.com/nodejs/node/pull/5093) +* [[`4a492b96b1`](https://github.com/nodejs/node/commit/4a492b96b1)] - **test**: mark flaky tests on Raspberry Pi (Rich Trott) [#5082](https://github.com/nodejs/node/pull/5082) +* [[`4301f2cdc2`](https://github.com/nodejs/node/commit/4301f2cdc2)] - **test**: fix inconsistent styling in test-url (Brian White) [#5014](https://github.com/nodejs/node/pull/5014) +* [[`865baaed60`](https://github.com/nodejs/node/commit/865baaed60)] - **test**: fix redeclared vars in sequential tests (Rich Trott) [#4999](https://github.com/nodejs/node/pull/4999) +* [[`663e852c1b`](https://github.com/nodejs/node/commit/663e852c1b)] - **test**: pummel test fixes (Rich Trott) [#4998](https://github.com/nodejs/node/pull/4998) +* [[`72d38a4a38`](https://github.com/nodejs/node/commit/72d38a4a38)] - **test**: fix redeclared vars in test-vm-* (Rich Trott) [#4997](https://github.com/nodejs/node/pull/4997) +* [[`97ddfa2b6e`](https://github.com/nodejs/node/commit/97ddfa2b6e)] - **test**: fix redeclared vars in test-url (Rich Trott) [#4993](https://github.com/nodejs/node/pull/4993) +* [[`43d4db4314`](https://github.com/nodejs/node/commit/43d4db4314)] - **test**: fix redeclared test-util-* vars (Rich Trott) [#4994](https://github.com/nodejs/node/pull/4994) +* [[`88fae38d0c`](https://github.com/nodejs/node/commit/88fae38d0c)] - **test**: fix variable redeclarations (Rich Trott) [#4992](https://github.com/nodejs/node/pull/4992) +* [[`58595f146a`](https://github.com/nodejs/node/commit/58595f146a)] - **test**: fix redeclared test-path vars (Rich Trott) [#4991](https://github.com/nodejs/node/pull/4991) +* [[`2b711d51fa`](https://github.com/nodejs/node/commit/2b711d51fa)] - **test**: fix var redeclarations in test-os (Rich Trott) [#4990](https://github.com/nodejs/node/pull/4990) +* [[`bd9e2c31d6`](https://github.com/nodejs/node/commit/bd9e2c31d6)] - **test**: fix test-net-* variable redeclarations (Rich Trott) [#4989](https://github.com/nodejs/node/pull/4989) +* [[`d67ab81882`](https://github.com/nodejs/node/commit/d67ab81882)] - **test**: fix redeclared test-intl var (Rich Trott) [#4988](https://github.com/nodejs/node/pull/4988) +* [[`d6dbb2fae7`](https://github.com/nodejs/node/commit/d6dbb2fae7)] - **test**: fix redeclared test-http-* vars (Rich Trott) [#4987](https://github.com/nodejs/node/pull/4987) +* [[`ecaa89a8cb`](https://github.com/nodejs/node/commit/ecaa89a8cb)] - **test**: fix redeclared test-event-emitter-* vars (Rich Trott) [#4985](https://github.com/nodejs/node/pull/4985) +* [[`299c729371`](https://github.com/nodejs/node/commit/299c729371)] - **test**: remove redeclared var in test-domain (Rich Trott) [#4984](https://github.com/nodejs/node/pull/4984) +* [[`35a4a203bf`](https://github.com/nodejs/node/commit/35a4a203bf)] - **test**: remove var redeclarations in test-crypto-* (Rich Trott) [#4981](https://github.com/nodejs/node/pull/4981) +* [[`1d56b74af0`](https://github.com/nodejs/node/commit/1d56b74af0)] - **test**: remove test-cluster-* var redeclarations (Rich Trott) [#4980](https://github.com/nodejs/node/pull/4980) +* [[`0ce12cc1ec`](https://github.com/nodejs/node/commit/0ce12cc1ec)] - **test**: fix test-http-extra-response flakiness (Santiago Gimeno) [#4979](https://github.com/nodejs/node/pull/4979) +* [[`c6b4bf138c`](https://github.com/nodejs/node/commit/c6b4bf138c)] - **test**: scope redeclared vars in test-child-process* (Rich Trott) [#4944](https://github.com/nodejs/node/pull/4944) +* [[`7654c171c7`](https://github.com/nodejs/node/commit/7654c171c7)] - **test**: refactor switch (Rich Trott) [#4870](https://github.com/nodejs/node/pull/4870) +* [[`226dfef690`](https://github.com/nodejs/node/commit/226dfef690)] - **test**: add common.platformTimeout() to dgram test (Rich Trott) [#4938](https://github.com/nodejs/node/pull/4938) +* [[`fb14bac662`](https://github.com/nodejs/node/commit/fb14bac662)] - **test**: fix flaky cluster test on Windows 10 (Rich Trott) [#4934](https://github.com/nodejs/node/pull/4934) +* [[`f5d29d7ac4`](https://github.com/nodejs/node/commit/f5d29d7ac4)] - **test**: Add assertion for TLS peer certificate fingerprint (Alan Cohen) [#4923](https://github.com/nodejs/node/pull/4923) +* [[`618427cea6`](https://github.com/nodejs/node/commit/618427cea6)] - **test**: fix test-tls-zero-clear-in flakiness (Santiago Gimeno) [#4888](https://github.com/nodejs/node/pull/4888) +* [[`8700c39c70`](https://github.com/nodejs/node/commit/8700c39c70)] - **test**: fix irregular whitespace issue (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`2b026c9d5a`](https://github.com/nodejs/node/commit/2b026c9d5a)] - **test**: fs.link() test runs on same device (Drew Folta) [#4861](https://github.com/nodejs/node/pull/4861) +* [[`80a637ac4d`](https://github.com/nodejs/node/commit/80a637ac4d)] - **test**: scope redeclared variable (Rich Trott) [#4854](https://github.com/nodejs/node/pull/4854) +* [[`8c4903d4ef`](https://github.com/nodejs/node/commit/8c4903d4ef)] - **test**: update arrow function style (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) +* [[`0a44e6a447`](https://github.com/nodejs/node/commit/0a44e6a447)] - **test**: mark test-tick-processor flaky (Rich Trott) [#4809](https://github.com/nodejs/node/pull/4809) +* [[`363460616c`](https://github.com/nodejs/node/commit/363460616c)] - **test**: refactor test-net-settimeout (Rich Trott) [#4799](https://github.com/nodejs/node/pull/4799) +* [[`6841d82c22`](https://github.com/nodejs/node/commit/6841d82c22)] - **test**: remove race condition in http flood test (Rich Trott) [#4793](https://github.com/nodejs/node/pull/4793) +* [[`b5bae32847`](https://github.com/nodejs/node/commit/b5bae32847)] - **test**: remove test-http-exit-delay (Rich Trott) [#4786](https://github.com/nodejs/node/pull/4786) +* [[`60514f9521`](https://github.com/nodejs/node/commit/60514f9521)] - **test**: refactor test-fs-watch (Rich Trott) [#4776](https://github.com/nodejs/node/pull/4776) +* [[`2a3a431119`](https://github.com/nodejs/node/commit/2a3a431119)] - **test**: fix `net-socket-timeout-unref` flakiness (Santiago Gimeno) [#4772](https://github.com/nodejs/node/pull/4772) +* [[`9e6f3632a1`](https://github.com/nodejs/node/commit/9e6f3632a1)] - **test**: remove Object.observe from tests (Vladimir Kurchatkin) [#4769](https://github.com/nodejs/node/pull/4769) +* [[`f78daa67b8`](https://github.com/nodejs/node/commit/f78daa67b8)] - **test**: make npm tests work on prerelease node versions (Kat Marchán) [#4960](https://github.com/nodejs/node/pull/4960) +* [[`1c03191b6a`](https://github.com/nodejs/node/commit/1c03191b6a)] - **test**: make npm tests work on prerelease node versions (Kat Marchán) [#4872](https://github.com/nodejs/node/pull/4872) +* [[`d9c22cc896`](https://github.com/nodejs/node/commit/d9c22cc896)] - **test,buffer**: refactor redeclarations (Rich Trott) [#4893](https://github.com/nodejs/node/pull/4893) +* [[`5c4960468a`](https://github.com/nodejs/node/commit/5c4960468a)] - **tls**: nullify `.ssl` on handle close (Fedor Indutny) [#5168](https://github.com/nodejs/node/pull/5168) +* [[`c0f5f01c9c`](https://github.com/nodejs/node/commit/c0f5f01c9c)] - **tls**: scope loop vars with let (Rich Trott) [#4853](https://github.com/nodejs/node/pull/4853) +* [[`c86627e0d1`](https://github.com/nodejs/node/commit/c86627e0d1)] - **(SEMVER-MINOR)** **tls**: add `options` argument to createSecurePair (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) +* [[`c908ff36f4`](https://github.com/nodejs/node/commit/c908ff36f4)] - **tls_wrap**: reach error reporting for UV_EPROTO (Fedor Indutny) [#4885](https://github.com/nodejs/node/pull/4885) +* [[`cebe3b95e3`](https://github.com/nodejs/node/commit/cebe3b95e3)] - **tools**: run tick processor without forking (Matt Loring) [#4224](https://github.com/nodejs/node/pull/4224) +* [[`70d8827714`](https://github.com/nodejs/node/commit/70d8827714)] - **(SEMVER-MINOR)** **tools**: add --prof-process flag to node binary (Matt Loring) [#4021](https://github.com/nodejs/node/pull/4021) +* [[`a43b9291c7`](https://github.com/nodejs/node/commit/a43b9291c7)] - **tools**: replace obsolete ESLint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`a89c6f58f1`](https://github.com/nodejs/node/commit/a89c6f58f1)] - **tools**: update ESLint to version 2.1.0 (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`789f62196a`](https://github.com/nodejs/node/commit/789f62196a)] - **tools**: remove obsolete lint rules (Rich Trott) [#5214](https://github.com/nodejs/node/pull/5214) +* [[`154772cfa8`](https://github.com/nodejs/node/commit/154772cfa8)] - **tools**: parse types into links in doc html gen (Claudio Rodriguez) [#4741](https://github.com/nodejs/node/pull/4741) +* [[`9237b6e38a`](https://github.com/nodejs/node/commit/9237b6e38a)] - **tools**: fix warning in doc parsing (Shigeki Ohtsu) [#4537](https://github.com/nodejs/node/pull/4537) +* [[`c653cc0c03`](https://github.com/nodejs/node/commit/c653cc0c03)] - **tools**: add recommended ES6 lint rules (Rich Trott) [#5210](https://github.com/nodejs/node/pull/5210) +* [[`993d9b7df0`](https://github.com/nodejs/node/commit/993d9b7df0)] - **tools**: add recommended linting rules (Rich Trott) [#5188](https://github.com/nodejs/node/pull/5188) +* [[`8423125223`](https://github.com/nodejs/node/commit/8423125223)] - **tools**: remove excessive comments from .eslintrc (Rich Trott) [#5151](https://github.com/nodejs/node/pull/5151) +* [[`4c687c98e4`](https://github.com/nodejs/node/commit/4c687c98e4)] - **tools**: enable no-proto rule for linter (Jackson Tian) [#5140](https://github.com/nodejs/node/pull/5140) +* [[`28e4e6f312`](https://github.com/nodejs/node/commit/28e4e6f312)] - **tools**: disallow mixed spaces and tabs for indents (Rich Trott) [#5135](https://github.com/nodejs/node/pull/5135) +* [[`50c6fe8604`](https://github.com/nodejs/node/commit/50c6fe8604)] - **tools**: alphabetize eslint stylistic issues section (Rich Trott) +* [[`ee594f1ed7`](https://github.com/nodejs/node/commit/ee594f1ed7)] - **tools**: lint for empty character classes in regex (Rich Trott) [#5115](https://github.com/nodejs/node/pull/5115) +* [[`bf0e239e99`](https://github.com/nodejs/node/commit/bf0e239e99)] - **tools**: lint for spacing around unary operators (Rich Trott) [#5063](https://github.com/nodejs/node/pull/5063) +* [[`6345acb792`](https://github.com/nodejs/node/commit/6345acb792)] - **tools**: enable no-redeclare rule for linter (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) +* [[`1dae175b62`](https://github.com/nodejs/node/commit/1dae175b62)] - **tools**: fix redeclared vars in doc/json.js (Rich Trott) [#5047](https://github.com/nodejs/node/pull/5047) +* [[`d1d220a1cf`](https://github.com/nodejs/node/commit/d1d220a1cf)] - **tools**: apply linting to doc tools (Rich Trott) [#4973](https://github.com/nodejs/node/pull/4973) +* [[`eddde1f60c`](https://github.com/nodejs/node/commit/eddde1f60c)] - **tools**: fix detecting constructor for JSON doc (Timothy Gu) [#4966](https://github.com/nodejs/node/pull/4966) +* [[`bcb327c8dd`](https://github.com/nodejs/node/commit/bcb327c8dd)] - **tools**: add property types in JSON documentation (Timothy Gu) [#4884](https://github.com/nodejs/node/pull/4884) +* [[`9a06a4c116`](https://github.com/nodejs/node/commit/9a06a4c116)] - **tools**: enable assorted ESLint error rules (Roman Reiss) [#4864](https://github.com/nodejs/node/pull/4864) +* [[`38474cfd49`](https://github.com/nodejs/node/commit/38474cfd49)] - **tools**: add arrow function rules to eslint (cjihrig) [#4813](https://github.com/nodejs/node/pull/4813) +* [[`f898abaa4f`](https://github.com/nodejs/node/commit/f898abaa4f)] - **tools**: fix setting path containing an ampersand (Brian White) [#4804](https://github.com/nodejs/node/pull/4804) +* [[`d10bee8e79`](https://github.com/nodejs/node/commit/d10bee8e79)] - **tools**: enable no-extra-semi rule in eslint (Michaël Zasso) [#2205](https://github.com/nodejs/node/pull/2205) +* [[`01006392cf`](https://github.com/nodejs/node/commit/01006392cf)] - **tools,doc**: fix linting errors (Rich Trott) [#5161](https://github.com/nodejs/node/pull/5161) +* [[`57a5f8731a`](https://github.com/nodejs/node/commit/57a5f8731a)] - **url**: change scoping of variables with let (Kári Tristan Helgason) [#4867](https://github.com/nodejs/node/pull/4867) + +## 2016-03-02, Version 4.3.2 'Argon' (LTS), @thealphanerd + +This is a security release with only a single commit, an update to openssl due to a recent security advisory. You can read more about the security advisory on [the Node.js website](https://nodejs.org/en/blog/vulnerability/openssl-march-2016/) + +### Notable changes + +* **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). + +## Commits + +* [[`c133797d09`](https://github.com/nodejs/node/commit/c133797d09)] - **deps**: upgrade openssl to 1.0.2g (Ben Noordhuis) [#5507](https://github.com/nodejs/node/pull/5507) + +## 2016-02-16, Version 4.3.1 'Argon' (LTS), @thealphanerd + +### Notable changes + +* **buffer** + * make byteLength work with Buffer correctly (Jackson Tian) + - [#4738](https://github.com/nodejs/node/pull/4738) +* **debugger** + * guard against call from non-node context (Ben Noordhuis) + - [#4328](https://github.com/nodejs/node/pull/4328) + - fixes segfaults in debugger + * do not incept debug context (Myles Borins) + - [#4819](https://github.com/nodejs/node/pull/4819) + - fixes crash in debugger when using util methods +* **deps** + * update to http-parser 2.5.2 (James Snell) + - [#5238](https://github.com/nodejs/node/pull/5238) + +### Commits + +* [[`748d2b4de1`](https://github.com/nodejs/node/commit/748d2b4de1)] - **buffer**: make byteLength work with Buffer correctly (Jackson Tian) [#4738](https://github.com/nodejs/node/pull/4738) +* [[`fb615bdaf4`](https://github.com/nodejs/node/commit/fb615bdaf4)] - **buffer**: remove unnecessary TODO comments (Peter Geiss) [#4719](https://github.com/nodejs/node/pull/4719) +* [[`b8213ba7e1`](https://github.com/nodejs/node/commit/b8213ba7e1)] - **cluster**: ignore queryServer msgs on disconnection (Santiago Gimeno) [#4465](https://github.com/nodejs/node/pull/4465) +* [[`f8a676ed59`](https://github.com/nodejs/node/commit/f8a676ed59)] - **cluster**: fix race condition setting suicide prop (Santiago Gimeno) [#4349](https://github.com/nodejs/node/pull/4349) +* [[`9d4a226dad`](https://github.com/nodejs/node/commit/9d4a226dad)] - **crypto**: clear error stack in ECDH::Initialize (Fedor Indutny) [#4689](https://github.com/nodejs/node/pull/4689) +* [[`583f3347d8`](https://github.com/nodejs/node/commit/583f3347d8)] - **debugger**: remove variable redeclarations (Rich Trott) [#4633](https://github.com/nodejs/node/pull/4633) +* [[`667f7a7ab3`](https://github.com/nodejs/node/commit/667f7a7ab3)] - **debugger**: guard against call from non-node context (Ben Noordhuis) [#4328](https://github.com/nodejs/node/pull/4328) +* [[`188cff3c31`](https://github.com/nodejs/node/commit/188cff3c31)] - **deps**: update to http-parser 2.5.2 (James Snell) [#5238](https://github.com/nodejs/node/pull/5238) +* [[`6e829b44e3`](https://github.com/nodejs/node/commit/6e829b44e3)] - **dgram**: prevent disabled optimization of bind() (Brian White) [#4613](https://github.com/nodejs/node/pull/4613) +* [[`c3956d05b1`](https://github.com/nodejs/node/commit/c3956d05b1)] - **doc**: update list of personal traits in CoC (Kat Marchán) [#4801](https://github.com/nodejs/node/pull/4801) +* [[`39cb69ca21`](https://github.com/nodejs/node/commit/39cb69ca21)] - **doc**: style fixes for the TOC (Roman Reiss) [#4748](https://github.com/nodejs/node/pull/4748) +* [[`cb5986da81`](https://github.com/nodejs/node/commit/cb5986da81)] - **doc**: add `servername` parameter docs (Alexander Makarenko) [#4729](https://github.com/nodejs/node/pull/4729) +* [[`91066b5f34`](https://github.com/nodejs/node/commit/91066b5f34)] - **doc**: update branch-diff arguments in release doc (Rod Vagg) [#4691](https://github.com/nodejs/node/pull/4691) +* [[`9ca24de41d`](https://github.com/nodejs/node/commit/9ca24de41d)] - **doc**: add docs for more stream options (zoubin) [#4639](https://github.com/nodejs/node/pull/4639) +* [[`437d0e336d`](https://github.com/nodejs/node/commit/437d0e336d)] - **doc**: mention that http.Server inherits from net.Server (Ryan Sobol) [#4455](https://github.com/nodejs/node/pull/4455) +* [[`393e569160`](https://github.com/nodejs/node/commit/393e569160)] - **doc**: copyedit setTimeout() documentation (Rich Trott) [#4434](https://github.com/nodejs/node/pull/4434) +* [[`e2a682ecc3`](https://github.com/nodejs/node/commit/e2a682ecc3)] - **doc**: fix formatting in process.markdown (Rich Trott) [#4433](https://github.com/nodejs/node/pull/4433) +* [[`75b0ea85bd`](https://github.com/nodejs/node/commit/75b0ea85bd)] - **doc**: add path property to Write/ReadStream in fs.markdown (Claudio Rodriguez) [#4368](https://github.com/nodejs/node/pull/4368) +* [[`48c2783421`](https://github.com/nodejs/node/commit/48c2783421)] - **doc**: add docs working group (Bryan English) [#4244](https://github.com/nodejs/node/pull/4244) +* [[`c0432e9f56`](https://github.com/nodejs/node/commit/c0432e9f56)] - **doc**: restore ICU third-party software licenses (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) +* [[`36a4159dab`](https://github.com/nodejs/node/commit/36a4159dab)] - **doc**: rebuild LICENSE using tools/license-builder.sh (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) +* [[`a2998a1bce`](https://github.com/nodejs/node/commit/a2998a1bce)] - **gitignore**: never ignore debug module (Michaël Zasso) [#2286](https://github.com/nodejs/node/pull/2286) +* [[`661b2557d9`](https://github.com/nodejs/node/commit/661b2557d9)] - **http**: remove variable redeclaration (Rich Trott) [#4612](https://github.com/nodejs/node/pull/4612) +* [[`1bb2967d48`](https://github.com/nodejs/node/commit/1bb2967d48)] - **http**: fix non-string header value concatenation (Brian White) [#4460](https://github.com/nodejs/node/pull/4460) +* [[`15ed64e34c`](https://github.com/nodejs/node/commit/15ed64e34c)] - **lib**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`2e92a1a6b4`](https://github.com/nodejs/node/commit/2e92a1a6b4)] - **module**: move unnecessary work for early return (Andres Suarez) [#3579](https://github.com/nodejs/node/pull/3579) +* [[`40c8e6d75d`](https://github.com/nodejs/node/commit/40c8e6d75d)] - **net**: remove hot path comment from connect (Evan Lucas) [#4648](https://github.com/nodejs/node/pull/4648) +* [[`8ed0c1c22c`](https://github.com/nodejs/node/commit/8ed0c1c22c)] - **net**: fix dns lookup for android (Josh Dague) [#4580](https://github.com/nodejs/node/pull/4580) +* [[`15fa555204`](https://github.com/nodejs/node/commit/15fa555204)] - **net, doc**: fix line wrapping lint in net.js (James M Snell) [#4588](https://github.com/nodejs/node/pull/4588) +* [[`1b070e48e0`](https://github.com/nodejs/node/commit/1b070e48e0)] - **node_contextify**: do not incept debug context (Myles Borins) [#4815](https://github.com/nodejs/node/issues/4815) +* [[`4fbcb47fe9`](https://github.com/nodejs/node/commit/4fbcb47fe9)] - **readline**: Remove XXX and output debuglog (Kohei TAKATA) [#4690](https://github.com/nodejs/node/pull/4690) +* [[`26f02405d0`](https://github.com/nodejs/node/commit/26f02405d0)] - **repl**: make sure historyPath is trimmed (Evan Lucas) [#4539](https://github.com/nodejs/node/pull/4539) +* [[`5990ba2a0a`](https://github.com/nodejs/node/commit/5990ba2a0a)] - **src**: remove redeclarations of variables (Rich Trott) [#4605](https://github.com/nodejs/node/pull/4605) +* [[`c41ed59dbc`](https://github.com/nodejs/node/commit/c41ed59dbc)] - **src**: don't check failure with ERR_peek_error() (Ben Noordhuis) [#4731](https://github.com/nodejs/node/pull/4731) +* [[`d71f9992f9`](https://github.com/nodejs/node/commit/d71f9992f9)] - **stream**: remove useless if test in transform (zoubin) [#4617](https://github.com/nodejs/node/pull/4617) +* [[`f205e9920e`](https://github.com/nodejs/node/commit/f205e9920e)] - **test**: fix tls-no-rsa-key flakiness (Santiago Gimeno) [#4043](https://github.com/nodejs/node/pull/4043) +* [[`447347cd62`](https://github.com/nodejs/node/commit/447347cd62)] - **test**: fix issues for space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) +* [[`be8274508c`](https://github.com/nodejs/node/commit/be8274508c)] - **test**: improve test-cluster-disconnect-suicide-race (Rich Trott) [#4739](https://github.com/nodejs/node/pull/4739) +* [[`0178001163`](https://github.com/nodejs/node/commit/0178001163)] - **test**: make test-cluster-disconnect-leak reliable (Rich Trott) [#4736](https://github.com/nodejs/node/pull/4736) +* [[`d615757da2`](https://github.com/nodejs/node/commit/d615757da2)] - **test**: fix flaky test-net-socket-local-address (cjihrig) [#4650](https://github.com/nodejs/node/pull/4650) +* [[`baa0a3dff5`](https://github.com/nodejs/node/commit/baa0a3dff5)] - **test**: fix race in test-net-server-pause-on-connect (Rich Trott) [#4637](https://github.com/nodejs/node/pull/4637) +* [[`909b5167cb`](https://github.com/nodejs/node/commit/909b5167cb)] - **test**: remove 1 second delay from test (Rich Trott) [#4616](https://github.com/nodejs/node/pull/4616) +* [[`8ea76608ed`](https://github.com/nodejs/node/commit/8ea76608ed)] - **test**: move resource intensive tests to sequential (Rich Trott) [#4615](https://github.com/nodejs/node/pull/4615) +* [[`7afcdd358e`](https://github.com/nodejs/node/commit/7afcdd358e)] - **test**: require common module only once (Rich Trott) [#4611](https://github.com/nodejs/node/pull/4611) +* [[`0e02eb0bbe`](https://github.com/nodejs/node/commit/0e02eb0bbe)] - **test**: only include http module once (Rich Trott) [#4606](https://github.com/nodejs/node/pull/4606) +* [[`34d9e48bb6`](https://github.com/nodejs/node/commit/34d9e48bb6)] - **test**: fix `http-upgrade-client` flakiness (Santiago Gimeno) [#4602](https://github.com/nodejs/node/pull/4602) +* [[`556703d531`](https://github.com/nodejs/node/commit/556703d531)] - **test**: fix flaky unrefed timers test (Rich Trott) [#4599](https://github.com/nodejs/node/pull/4599) +* [[`3d5bc69796`](https://github.com/nodejs/node/commit/3d5bc69796)] - **test**: fix `http-upgrade-agent` flakiness (Santiago Gimeno) [#4520](https://github.com/nodejs/node/pull/4520) +* [[`ec24d3767b`](https://github.com/nodejs/node/commit/ec24d3767b)] - **test**: fix flaky test-cluster-shared-leak (Rich Trott) [#4510](https://github.com/nodejs/node/pull/4510) +* [[`a256790327`](https://github.com/nodejs/node/commit/a256790327)] - **test**: fix flaky cluster-net-send (Brian White) [#4444](https://github.com/nodejs/node/pull/4444) +* [[`6809c2be1a`](https://github.com/nodejs/node/commit/6809c2be1a)] - **test**: fix flaky child-process-fork-regr-gh-2847 (Brian White) [#4442](https://github.com/nodejs/node/pull/4442) +* [[`e6448aa36b`](https://github.com/nodejs/node/commit/e6448aa36b)] - **test**: use addon.md block headings as test dir names (Rod Vagg) [#4412](https://github.com/nodejs/node/pull/4412) +* [[`305d340fca`](https://github.com/nodejs/node/commit/305d340fca)] - **test**: test each block in addon.md contains js & cc (Rod Vagg) [#4411](https://github.com/nodejs/node/pull/4411) +* [[`f213406575`](https://github.com/nodejs/node/commit/f213406575)] - **test**: fix tls-multi-key race condition (Santiago Gimeno) [#3966](https://github.com/nodejs/node/pull/3966) +* [[`607f545568`](https://github.com/nodejs/node/commit/607f545568)] - **test**: fix style issues after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`aefb20a94f`](https://github.com/nodejs/node/commit/aefb20a94f)] - **tls**: copy client CAs and cert store on CertCb (Fedor Indutny) [#3537](https://github.com/nodejs/node/pull/3537) +* [[`7821b3e305`](https://github.com/nodejs/node/commit/7821b3e305)] - **tls_legacy**: do not read on OpenSSL's stack (Fedor Indutny) [#4624](https://github.com/nodejs/node/pull/4624) +* [[`b66db49f94`](https://github.com/nodejs/node/commit/b66db49f94)] - **tools**: add support for subkeys in release tools (Myles Borins) [#4807](https://github.com/nodejs/node/pull/4807) +* [[`837ebd1985`](https://github.com/nodejs/node/commit/837ebd1985)] - **tools**: enable space-in-parens ESLint rule (Roman Reiss) [#4753](https://github.com/nodejs/node/pull/4753) +* [[`066d5e7da2`](https://github.com/nodejs/node/commit/066d5e7da2)] - **tools**: fix style issue after eslint update (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`b20ea69f46`](https://github.com/nodejs/node/commit/b20ea69f46)] - **tools**: update eslint config (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`2e0352d50c`](https://github.com/nodejs/node/commit/2e0352d50c)] - **tools**: update eslint to v1.10.3 (Michaël Zasso) [nodejs/io.js#2286](https://github.com/nodejs/io.js/pull/2286) +* [[`c96800a432`](https://github.com/nodejs/node/commit/c96800a432)] - **tools**: fix license-builder.sh for ICU (Richard Lau) [#4762](https://github.com/nodejs/node/pull/4762) +* [[`720b03dca7`](https://github.com/nodejs/node/commit/720b03dca7)] - **tools**: add license-builder.sh to construct LICENSE (Rod Vagg) [#4194](https://github.com/nodejs/node/pull/4194) + +## 2016-02-09, Version 4.3.0 'Argon' (LTS), @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. + +Note that this release includes a non-backward compatible change to address a security issue. This change increases the version of the LTS v4.x line to v4.3.0. There will be *no further updates* to v4.2.x. + +### 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.5.0 to 2.5.1 +* **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. +* **src**: + - introduce new `--security-revert={cvenum}` command line flag for selective reversion of specific CVE fixes + - allow the fix for CVE-2016-2216 to be selectively reverted using `--security-revert=CVE-2016-2216` + +### Commits + +* [[`d94f864abd`](https://github.com/nodejs/node/commit/d94f864abd0933c125afeb84b6f72ec709c63b43)] - **deps**: add -no_rand_screen to openssl s_client (Shigeki Ohtsu) [#1836](https://github.com/nodejs/node/pull/1836) +* [[`136295e202`](https://github.com/nodejs/node/commit/136295e202)] - **deps**: upgrade openssl sources to 1.0.2f (Myles Borins) [#4961](https://github.com/nodejs/node/pull/4961) +* [[`0eae95eae3`](https://github.com/nodejs/node/commit/0eae95eae3)] - **(SEMVER-MINOR)** **deps**: update http-parser to version 2.5.1 (James M Snell) +* [[`cf2b714b02`](https://github.com/nodejs/node/commit/cf2b714b02)] - **(SEMVER-MINOR)** **http**: strictly forbid invalid characters from headers (James M Snell) +* [[`49ae2e0334`](https://github.com/nodejs/node/commit/49ae2e0334)] - **src**: avoid compiler warning in node_revert.cc (James M Snell) +* [[`da3750f981`](https://github.com/nodejs/node/commit/da3750f981)] - **(SEMVER-MAJOR)** **src**: add --security-revert command line flag (James M Snell) + +## 2016-01-21, Version 4.2.6 'Argon' (LTS), @TheAlphaNerd + +### Notable changes + +* Fix regression in debugger and profiler functionality + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`1408f7abb1`](https://github.com/nodejs/node/commit/1408f7abb1)] - **module,src**: do not wrap modules with -1 lineOffset (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) +* [[`1f8e1472cc`](https://github.com/nodejs/node/commit/1f8e1472cc)] - **test**: add test for debugging one line files (cjihrig) [#4298](https://github.com/nodejs/node/pull/4298) + + +## 2016-01-20, Version 4.2.5 'Argon' (LTS), @TheAlphaNerd + +Maintenance update. + +### Notable changes + +* **assert** + * accommodate ES6 classes that extend Error (Rich Trott) [#4166](https://github.com/nodejs/node/pull/4166) +* **build** + * add "--partly-static" build options (Super Zheng) [#4152](https://github.com/nodejs/node/pull/4152) +* **deps** + * backport 066747e from upstream V8 (Ali Ijaz Sheikh) [#4655](https://github.com/nodejs/node/pull/4655) + * backport 200315c from V8 upstream (Vladimir Kurchatkin) [#4128](https://github.com/nodejs/node/pull/4128) + * upgrade libuv to 1.8.0 (Saúl Ibarra Corretgé) +* **docs** + * various updates landed in 70 different commits! +* **repl** + * attach location info to syntax errors (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) + * display error message when loading directory (Prince J Wesley) [#4170](https://github.com/nodejs/node/pull/4170) +* **tests** + * various updates landed in over 50 commits +* **tools** + * add tap output to cpplint (Johan Bergström) [#3448](https://github.com/nodejs/node/pull/3448) +* **util** + * allow lookup of hidden values (cjihrig) [#3988](https://github.com/nodejs/node/pull/3988) + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + + +* [[`87181cd74c`](https://github.com/nodejs/node/commit/87181cd74c)] - **assert**: accommodate ES6 classes that extend Error (Rich Trott) [#4166](https://github.com/nodejs/node/pull/4166) +* [[`901172a783`](https://github.com/nodejs/node/commit/901172a783)] - **assert**: typed array deepequal performance fix (Claudio Rodriguez) [#4330](https://github.com/nodejs/node/pull/4330) +* [[`55336810ee`](https://github.com/nodejs/node/commit/55336810ee)] - **async_wrap**: call callback in destructor (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`a8b45e9e96`](https://github.com/nodejs/node/commit/a8b45e9e96)] - **async_wrap**: new instances get uid (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`49f16d77c4`](https://github.com/nodejs/node/commit/49f16d77c4)] - **async_wrap**: allow some hooks to be optional (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`44ee33f945`](https://github.com/nodejs/node/commit/44ee33f945)] - **buffer**: refactor create buffer (Jackson Tian) [#4340](https://github.com/nodejs/node/pull/4340) +* [[`138d004ac0`](https://github.com/nodejs/node/commit/138d004ac0)] - **buffer**: faster case for create Buffer from new Buffer(0) (Jackson Tian) [#4326](https://github.com/nodejs/node/pull/4326) +* [[`c6dc2a1609`](https://github.com/nodejs/node/commit/c6dc2a1609)] - **buffer**: Prevent Buffer constructor deopt (Bryce Baril) [#4158](https://github.com/nodejs/node/pull/4158) +* [[`a320045e68`](https://github.com/nodejs/node/commit/a320045e68)] - **buffer**: default to UTF8 in byteLength() (Tom Gallacher) [#4010](https://github.com/nodejs/node/pull/4010) +* [[`c5f71ac771`](https://github.com/nodejs/node/commit/c5f71ac771)] - **build**: add "--partly-static" build options (Super Zheng) [#4152](https://github.com/nodejs/node/pull/4152) +* [[`e6c25335ea`](https://github.com/nodejs/node/commit/e6c25335ea)] - **build**: omit -gline-tables-only for --enable-asan (Ben Noordhuis) [#3680](https://github.com/nodejs/node/pull/3680) +* [[`80b4ba286c`](https://github.com/nodejs/node/commit/80b4ba286c)] - **build**: Updates for AIX npm support - part 1 (Michael Dawson) [#3114](https://github.com/nodejs/node/pull/3114) +* [[`35e32985ca`](https://github.com/nodejs/node/commit/35e32985ca)] - **child_process**: guard against race condition (Rich Trott) [#4418](https://github.com/nodejs/node/pull/4418) +* [[`48564204f0`](https://github.com/nodejs/node/commit/48564204f0)] - **child_process**: flush consuming streams (Dave) [#4071](https://github.com/nodejs/node/pull/4071) +* [[`481d59a74c`](https://github.com/nodejs/node/commit/481d59a74c)] - **configure**: fix arm vfpv2 (Jörg Krause) [#4203](https://github.com/nodejs/node/pull/4203) +* [[`d19da6638d`](https://github.com/nodejs/node/commit/d19da6638d)] - **crypto**: load PFX chain the same way as regular one (Fedor Indutny) [#4165](https://github.com/nodejs/node/pull/4165) +* [[`b8e75de1f3`](https://github.com/nodejs/node/commit/b8e75de1f3)] - **crypto**: fix native module compilation with FIPS (Stefan Budeanu) [#4023](https://github.com/nodejs/node/pull/4023) +* [[`b7c3fb7f75`](https://github.com/nodejs/node/commit/b7c3fb7f75)] - **crypto**: disable crypto.createCipher in FIPS mode (Stefan Budeanu) [#3754](https://github.com/nodejs/node/pull/3754) +* [[`31b4091a1e`](https://github.com/nodejs/node/commit/31b4091a1e)] - **debugger**: also exit when the repl emits 'exit' (Felix Böhm) [#2369](https://github.com/nodejs/node/pull/2369) +* [[`9baa5618f5`](https://github.com/nodejs/node/commit/9baa5618f5)] - **deps**: backport 066747e from upstream V8 (Ali Ijaz Sheikh) [#4655](https://github.com/nodejs/node/pull/4655) +* [[`c3a9d8a62e`](https://github.com/nodejs/node/commit/c3a9d8a62e)] - **deps**: backport 200315c from V8 upstream (Vladimir Kurchatkin) [#4128](https://github.com/nodejs/node/pull/4128) +* [[`1ebb0c0fdf`](https://github.com/nodejs/node/commit/1ebb0c0fdf)] - **deps**: upgrade libuv to 1.8.0 (Saúl Ibarra Corretgé) [#4276](https://github.com/nodejs/node/pull/4276) +* [[`253fe3e7c8`](https://github.com/nodejs/node/commit/253fe3e7c8)] - **dns**: remove nonexistant exports.ADNAME (Roman Reiss) [#3051](https://github.com/nodejs/node/pull/3051) +* [[`8c2b65ad82`](https://github.com/nodejs/node/commit/8c2b65ad82)] - **doc**: clarify protocol default in http.request() (cjihrig) [#4714](https://github.com/nodejs/node/pull/4714) +* [[`33e72e135f`](https://github.com/nodejs/node/commit/33e72e135f)] - **doc**: update links to use https where possible (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`5f4aa79410`](https://github.com/nodejs/node/commit/5f4aa79410)] - **doc**: clarify explanation of first stream section (Vitor Cortez) [#4234](https://github.com/nodejs/node/pull/4234) +* [[`295ca5bfb2`](https://github.com/nodejs/node/commit/295ca5bfb2)] - **doc**: add branch-diff example to releases.md (Myles Borins) [#4636](https://github.com/nodejs/node/pull/4636) +* [[`18f5cd8710`](https://github.com/nodejs/node/commit/18f5cd8710)] - **doc**: update stylesheet to match frontpage (Roman Reiss) [#4621](https://github.com/nodejs/node/pull/4621) +* [[`2f40715f08`](https://github.com/nodejs/node/commit/2f40715f08)] - **doc**: adds usage of readline line-by-line parsing (Robert Jefe Lindstaedt) [#4609](https://github.com/nodejs/node/pull/4609) +* [[`5b45a464ee`](https://github.com/nodejs/node/commit/5b45a464ee)] - **doc**: document http's server.listen return value (Sequoia McDowell) [#4590](https://github.com/nodejs/node/pull/4590) +* [[`bd31740339`](https://github.com/nodejs/node/commit/bd31740339)] - **doc**: label http.IncomingMessage as a Class (Sequoia McDowell) [#4589](https://github.com/nodejs/node/pull/4589) +* [[`bcd2cbbb93`](https://github.com/nodejs/node/commit/bcd2cbbb93)] - **doc**: fix description about the latest-codename (Minwoo Jung) [#4583](https://github.com/nodejs/node/pull/4583) +* [[`0b12bcb35d`](https://github.com/nodejs/node/commit/0b12bcb35d)] - **doc**: add Evan Lucas to Release Team (Evan Lucas) [#4579](https://github.com/nodejs/node/pull/4579) +* [[`e20b1f6f10`](https://github.com/nodejs/node/commit/e20b1f6f10)] - **doc**: add Myles Borins to Release Team (Myles Borins) [#4578](https://github.com/nodejs/node/pull/4578) +* [[`54977e63eb`](https://github.com/nodejs/node/commit/54977e63eb)] - **doc**: add missing backtick for readline (Brian White) [#4549](https://github.com/nodejs/node/pull/4549) +* [[`5d6bed895c`](https://github.com/nodejs/node/commit/5d6bed895c)] - **doc**: bring releases.md up to date (cjihrig) [#4540](https://github.com/nodejs/node/pull/4540) +* [[`0cd2252e85`](https://github.com/nodejs/node/commit/0cd2252e85)] - **doc**: fix numbering in stream.markdown (Richard Sun) [#4538](https://github.com/nodejs/node/pull/4538) +* [[`8574d91f27`](https://github.com/nodejs/node/commit/8574d91f27)] - **doc**: stronger suggestion for userland assert (Wyatt Preul) [#4535](https://github.com/nodejs/node/pull/4535) +* [[`a7bcf8b84d`](https://github.com/nodejs/node/commit/a7bcf8b84d)] - **doc**: close backtick in process.title description (Dave) [#4534](https://github.com/nodejs/node/pull/4534) +* [[`0ceb3148b0`](https://github.com/nodejs/node/commit/0ceb3148b0)] - **doc**: improvements to events.markdown copy (James M Snell) [#4468](https://github.com/nodejs/node/pull/4468) +* [[`bf56d509b9`](https://github.com/nodejs/node/commit/bf56d509b9)] - **doc**: explain ClientRequest#setTimeout time unit (Ben Ripkens) [#4458](https://github.com/nodejs/node/pull/4458) +* [[`d927c51be3`](https://github.com/nodejs/node/commit/d927c51be3)] - **doc**: improvements to errors.markdown copy (James M Snell) [#4454](https://github.com/nodejs/node/pull/4454) +* [[`ceea6df581`](https://github.com/nodejs/node/commit/ceea6df581)] - **doc**: improvements to dns.markdown copy (James M Snell) [#4449](https://github.com/nodejs/node/pull/4449) +* [[`506f2f8ed1`](https://github.com/nodejs/node/commit/506f2f8ed1)] - **doc**: add anchors for _transform _flush _writev in stream.markdown (iamchenxin) [#4448](https://github.com/nodejs/node/pull/4448) +* [[`74bcad0b78`](https://github.com/nodejs/node/commit/74bcad0b78)] - **doc**: improvements to dgram.markdown copy (James M Snell) [#4437](https://github.com/nodejs/node/pull/4437) +* [[`e244d560c9`](https://github.com/nodejs/node/commit/e244d560c9)] - **doc**: improvements to debugger.markdown copy (James M Snell) [#4436](https://github.com/nodejs/node/pull/4436) +* [[`df7e1281a5`](https://github.com/nodejs/node/commit/df7e1281a5)] - **doc**: improvements to console.markdown copy (James M Snell) [#4428](https://github.com/nodejs/node/pull/4428) +* [[`abb17cc6c1`](https://github.com/nodejs/node/commit/abb17cc6c1)] - **doc**: fix spelling error in lib/url.js comment (Nik Nyby) [#4390](https://github.com/nodejs/node/pull/4390) +* [[`823269db2d`](https://github.com/nodejs/node/commit/823269db2d)] - **doc**: improve assert.markdown copy (James M Snell) [#4360](https://github.com/nodejs/node/pull/4360) +* [[`2b1804f6cb`](https://github.com/nodejs/node/commit/2b1804f6cb)] - **doc**: copyedit releases.md (Rich Trott) [#4384](https://github.com/nodejs/node/pull/4384) +* [[`2b142fd876`](https://github.com/nodejs/node/commit/2b142fd876)] - **doc**: catch the WORKING_GROUPS.md bootstrap docs up to date (James M Snell) [#4367](https://github.com/nodejs/node/pull/4367) +* [[`ed87873de3`](https://github.com/nodejs/node/commit/ed87873de3)] - **doc**: fix link in addons.markdown (Nicholas Young) [#4331](https://github.com/nodejs/node/pull/4331) +* [[`fe693b7a4f`](https://github.com/nodejs/node/commit/fe693b7a4f)] - **doc**: Typo in buffer.markdown referencing buf.write() (chrisjohn404) [#4324](https://github.com/nodejs/node/pull/4324) +* [[`764df2166e`](https://github.com/nodejs/node/commit/764df2166e)] - **doc**: document the cache parameter for fs.realpathSync (Jackson Tian) [#4285](https://github.com/nodejs/node/pull/4285) +* [[`61f91b2f29`](https://github.com/nodejs/node/commit/61f91b2f29)] - **doc**: fix, modernize examples in docs (James M Snell) [#4282](https://github.com/nodejs/node/pull/4282) +* [[`d87ad302ce`](https://github.com/nodejs/node/commit/d87ad302ce)] - **doc**: clarify error events in HTTP module documentation (Lenny Markus) [#4275](https://github.com/nodejs/node/pull/4275) +* [[`7983577e41`](https://github.com/nodejs/node/commit/7983577e41)] - **doc**: fix improper http.get sample code (Hideki Yamamura) [#4263](https://github.com/nodejs/node/pull/4263) +* [[`6c30d087e5`](https://github.com/nodejs/node/commit/6c30d087e5)] - **doc**: Fixing broken links to the v8 wiki (Tom Gallacher) [#4241](https://github.com/nodejs/node/pull/4241) +* [[`cf214e56e4`](https://github.com/nodejs/node/commit/cf214e56e4)] - **doc**: move description of 'equals' method to right place (janriemer) [#4227](https://github.com/nodejs/node/pull/4227) +* [[`fb8e8dbb92`](https://github.com/nodejs/node/commit/fb8e8dbb92)] - **doc**: copyedit console doc (Rich Trott) [#4225](https://github.com/nodejs/node/pull/4225) +* [[`4ccf04c229`](https://github.com/nodejs/node/commit/4ccf04c229)] - **doc**: add mcollina to collaborators (Matteo Collina) [#4220](https://github.com/nodejs/node/pull/4220) +* [[`59654c21d4`](https://github.com/nodejs/node/commit/59654c21d4)] - **doc**: add rmg to collaborators (Ryan Graham) [#4219](https://github.com/nodejs/node/pull/4219) +* [[`bfe1a6bd2b`](https://github.com/nodejs/node/commit/bfe1a6bd2b)] - **doc**: add calvinmetcalf to collaborators (Calvin Metcalf) [#4218](https://github.com/nodejs/node/pull/4218) +* [[`5140c404ae`](https://github.com/nodejs/node/commit/5140c404ae)] - **doc**: harmonize description of `ca` argument (Ben Noordhuis) [#4213](https://github.com/nodejs/node/pull/4213) +* [[`2e642051cf`](https://github.com/nodejs/node/commit/2e642051cf)] - **doc**: copyedit child_process doc (Rich Trott) [#4188](https://github.com/nodejs/node/pull/4188) +* [[`7920f8dbde`](https://github.com/nodejs/node/commit/7920f8dbde)] - **doc**: copyedit buffer doc (Rich Trott) [#4187](https://github.com/nodejs/node/pull/4187) +* [[`c35a409cbe`](https://github.com/nodejs/node/commit/c35a409cbe)] - **doc**: clarify assert.fail doc (Rich Trott) [#4186](https://github.com/nodejs/node/pull/4186) +* [[`6235fdf72e`](https://github.com/nodejs/node/commit/6235fdf72e)] - **doc**: copyedit addons doc (Rich Trott) [#4185](https://github.com/nodejs/node/pull/4185) +* [[`990e7ff93e`](https://github.com/nodejs/node/commit/990e7ff93e)] - **doc**: update AUTHORS list (Rod Vagg) [#4183](https://github.com/nodejs/node/pull/4183) +* [[`8d676ef55e`](https://github.com/nodejs/node/commit/8d676ef55e)] - **doc**: change references from node to Node.js (Roman Klauke) [#4177](https://github.com/nodejs/node/pull/4177) +* [[`1c34b139a2`](https://github.com/nodejs/node/commit/1c34b139a2)] - **doc**: add brief Node.js overview to README (wurde) [#4174](https://github.com/nodejs/node/pull/4174) +* [[`27b9b72ab0`](https://github.com/nodejs/node/commit/27b9b72ab0)] - **doc**: add iarna to collaborators (Rebecca Turner) [#4144](https://github.com/nodejs/node/pull/4144) +* [[`683d8dd564`](https://github.com/nodejs/node/commit/683d8dd564)] - **doc**: add JungMinu to collaborators (Minwoo Jung) [#4143](https://github.com/nodejs/node/pull/4143) +* [[`17b06dfa94`](https://github.com/nodejs/node/commit/17b06dfa94)] - **doc**: add zkat to collaborators (Kat Marchán) [#4142](https://github.com/nodejs/node/pull/4142) +* [[`39364c4c72`](https://github.com/nodejs/node/commit/39364c4c72)] - **doc**: improve child_process.markdown wording (yorkie) [#4138](https://github.com/nodejs/node/pull/4138) +* [[`abe452835f`](https://github.com/nodejs/node/commit/abe452835f)] - **doc**: url.format - true slash postfix behaviour (fansworld-claudio) [#4119](https://github.com/nodejs/node/pull/4119) +* [[`6dd375cfe2`](https://github.com/nodejs/node/commit/6dd375cfe2)] - **doc**: document backlog for server.listen() variants (Jan Schär) [#4025](https://github.com/nodejs/node/pull/4025) +* [[`b71a3b363a`](https://github.com/nodejs/node/commit/b71a3b363a)] - **doc**: fixup socket.remoteAddress (Arthur Gautier) [#4198](https://github.com/nodejs/node/pull/4198) +* [[`e2fe214857`](https://github.com/nodejs/node/commit/e2fe214857)] - **doc**: add links and backticks around names (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`bb158f8aed`](https://github.com/nodejs/node/commit/bb158f8aed)] - **doc**: s/node.js/Node.js in readme (Rod Vagg) [#3998](https://github.com/nodejs/node/pull/3998) +* [[`f55491ad47`](https://github.com/nodejs/node/commit/f55491ad47)] - **doc**: move fs.existsSync() deprecation message (Martin Forsberg) [#3942](https://github.com/nodejs/node/pull/3942) +* [[`8c5b847f5b`](https://github.com/nodejs/node/commit/8c5b847f5b)] - **doc**: Describe FIPSDIR environment variable (Stefan Budeanu) [#3752](https://github.com/nodejs/node/pull/3752) +* [[`70c95ea0e5`](https://github.com/nodejs/node/commit/70c95ea0e5)] - **doc**: add warning about Windows process groups (Roman Klauke) [#3681](https://github.com/nodejs/node/pull/3681) +* [[`46c59b7256`](https://github.com/nodejs/node/commit/46c59b7256)] - **doc**: add CTC meeting minutes 2015-10-28 (Rod Vagg) [#3661](https://github.com/nodejs/node/pull/3661) +* [[`7ffd299a1d`](https://github.com/nodejs/node/commit/7ffd299a1d)] - **doc**: add final full stop in CONTRIBUTING.md (Emily Aviva Kapor-Mater) [#3576](https://github.com/nodejs/node/pull/3576) +* [[`1f78bff7ce`](https://github.com/nodejs/node/commit/1f78bff7ce)] - **doc**: add TSC meeting minutes 2015-10-21 (Rod Vagg) [#3480](https://github.com/nodejs/node/pull/3480) +* [[`2e623ff024`](https://github.com/nodejs/node/commit/2e623ff024)] - **doc**: add TSC meeting minutes 2015-10-14 (Rod Vagg) [#3463](https://github.com/nodejs/node/pull/3463) +* [[`b9c69964bb`](https://github.com/nodejs/node/commit/b9c69964bb)] - **doc**: add TSC meeting minutes 2015-10-07 (Rod Vagg) [#3364](https://github.com/nodejs/node/pull/3364) +* [[`f31d23c724`](https://github.com/nodejs/node/commit/f31d23c724)] - **doc**: add TSC meeting minutes 2015-09-30 (Rod Vagg) [#3235](https://github.com/nodejs/node/pull/3235) +* [[`ae8e3af178`](https://github.com/nodejs/node/commit/ae8e3af178)] - **doc**: update irc channels: #node.js and #node-dev (Nelson Pecora) [#2743](https://github.com/nodejs/node/pull/2743) +* [[`830caeb1bd`](https://github.com/nodejs/node/commit/830caeb1bd)] - **doc, test**: symbols as event names (Bryan English) [#4151](https://github.com/nodejs/node/pull/4151) +* [[`82cbfcdcbe`](https://github.com/nodejs/node/commit/82cbfcdcbe)] - **docs**: update gpg key for Myles Borins (Myles Borins) [#4657](https://github.com/nodejs/node/pull/4657) +* [[`50b72aa5a3`](https://github.com/nodejs/node/commit/50b72aa5a3)] - **docs**: fix npm command in releases.md (Myles Borins) [#4656](https://github.com/nodejs/node/pull/4656) +* [[`5bf56882e1`](https://github.com/nodejs/node/commit/5bf56882e1)] - **fs,doc**: use `target` instead of `destination` (yorkie) [#3912](https://github.com/nodejs/node/pull/3912) +* [[`41fcda840c`](https://github.com/nodejs/node/commit/41fcda840c)] - **http**: use `self.keepAlive` instead of `self.options.keepAlive` (Damian Schenkelman) [#4407](https://github.com/nodejs/node/pull/4407) +* [[`3ff237333d`](https://github.com/nodejs/node/commit/3ff237333d)] - **http**: Remove an unnecessary assignment (Bo Borgerson) [#4323](https://github.com/nodejs/node/pull/4323) +* [[`39dc054572`](https://github.com/nodejs/node/commit/39dc054572)] - **http**: remove excess calls to removeSocket (Dave) [#4172](https://github.com/nodejs/node/pull/4172) +* [[`751fbd84dd`](https://github.com/nodejs/node/commit/751fbd84dd)] - **https**: use `servername` in agent key (Fedor Indutny) [#4389](https://github.com/nodejs/node/pull/4389) +* [[`7a1a0a0055`](https://github.com/nodejs/node/commit/7a1a0a0055)] - **lib**: remove unused modules (Rich Trott) [#4683](https://github.com/nodejs/node/pull/4683) +* [[`3d81ea99bb`](https://github.com/nodejs/node/commit/3d81ea99bb)] - **lib,test**: update let to const where applicable (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`8a9869eeab`](https://github.com/nodejs/node/commit/8a9869eeab)] - **module**: fix column offsets in errors (Tristian Flanagan) [#2867](https://github.com/nodejs/node/pull/2867) +* [[`0ae90ecd3d`](https://github.com/nodejs/node/commit/0ae90ecd3d)] - **module,repl**: remove repl require() hack (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`a7367fdc1e`](https://github.com/nodejs/node/commit/a7367fdc1e)] - **net**: small code cleanup (Jan Schär) [#3943](https://github.com/nodejs/node/pull/3943) +* [[`03e9495cc2`](https://github.com/nodejs/node/commit/03e9495cc2)] - **node**: remove unused variables in AppendExceptionLine (Yazhong Liu) [#4264](https://github.com/nodejs/node/pull/4264) +* [[`06113b8711`](https://github.com/nodejs/node/commit/06113b8711)] - **node**: s/doNTCallbackX/nextTickCallbackWithXArgs/ (Rod Vagg) [#4167](https://github.com/nodejs/node/pull/4167) +* [[`8ce6843fe4`](https://github.com/nodejs/node/commit/8ce6843fe4)] - **os**: fix crash in GetInterfaceAddresses (Martin Bark) [#4272](https://github.com/nodejs/node/pull/4272) +* [[`53dcbb6aa4`](https://github.com/nodejs/node/commit/53dcbb6aa4)] - **repl**: remove unused function (Rich Trott) +* [[`db0e906fc1`](https://github.com/nodejs/node/commit/db0e906fc1)] - **repl**: Fixed node repl history edge case. (Mudit Ameta) [#4108](https://github.com/nodejs/node/pull/4108) +* [[`9855fab05f`](https://github.com/nodejs/node/commit/9855fab05f)] - **repl**: use String#repeat instead of Array#join (Evan Lucas) [#3900](https://github.com/nodejs/node/pull/3900) +* [[`41882e4077`](https://github.com/nodejs/node/commit/41882e4077)] - **repl**: fix require('3rdparty') regression (Ben Noordhuis) [#4215](https://github.com/nodejs/node/pull/4215) +* [[`93afc39d4a`](https://github.com/nodejs/node/commit/93afc39d4a)] - **repl**: attach location info to syntax errors (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`d4806675a6`](https://github.com/nodejs/node/commit/d4806675a6)] - **repl**: display error message when loading directory (Prince J Wesley) [#4170](https://github.com/nodejs/node/pull/4170) +* [[`3080bdc7d7`](https://github.com/nodejs/node/commit/3080bdc7d7)] - **src**: define Is* util functions with macros (cjihrig) [#4118](https://github.com/nodejs/node/pull/4118) +* [[`2b8a32a13b`](https://github.com/nodejs/node/commit/2b8a32a13b)] - **src**: refactor vcbuild configure args creation (Rod Vagg) [#3399](https://github.com/nodejs/node/pull/3399) +* [[`d47f6ba768`](https://github.com/nodejs/node/commit/d47f6ba768)] - **src**: fix deprecation message for ErrnoException (Martin von Gagern) [#4269](https://github.com/nodejs/node/pull/4269) +* [[`5ba08fbf76`](https://github.com/nodejs/node/commit/5ba08fbf76)] - **src**: fix line numbers on core errors (cjihrig) [#4254](https://github.com/nodejs/node/pull/4254) +* [[`70974e9362`](https://github.com/nodejs/node/commit/70974e9362)] - **src**: use GetCurrentProcessId() for process.pid (Ben Noordhuis) [#4163](https://github.com/nodejs/node/pull/4163) +* [[`c96eca164f`](https://github.com/nodejs/node/commit/c96eca164f)] - **src**: don't print garbage errors (cjihrig) [#4112](https://github.com/nodejs/node/pull/4112) +* [[`f61412c753`](https://github.com/nodejs/node/commit/f61412c753)] - **test**: mark test-debug-no-context is flaky (Rich Trott) [#4421](https://github.com/nodejs/node/pull/4421) +* [[`46d8c93ed2`](https://github.com/nodejs/node/commit/46d8c93ed2)] - **test**: don't use cwd for relative path (Johan Bergström) [#4477](https://github.com/nodejs/node/pull/4477) +* [[`b6124ea39c`](https://github.com/nodejs/node/commit/b6124ea39c)] - **test**: write to tmp dir rather than fixture dir (Rich Trott) [#4489](https://github.com/nodejs/node/pull/4489) +* [[`350fa664bb`](https://github.com/nodejs/node/commit/350fa664bb)] - **test**: don't assume a certain folder structure (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) +* [[`6b2ef0efac`](https://github.com/nodejs/node/commit/6b2ef0efac)] - **test**: make temp path customizable (Johan Bergström) [#3325](https://github.com/nodejs/node/pull/3325) +* [[`f1837703a9`](https://github.com/nodejs/node/commit/f1837703a9)] - **test**: remove unused vars from parallel tests (Rich Trott) [#4511](https://github.com/nodejs/node/pull/4511) +* [[`b4964b099a`](https://github.com/nodejs/node/commit/b4964b099a)] - **test**: remove unused variables form http tests (Rich Trott) [#4422](https://github.com/nodejs/node/pull/4422) +* [[`0d5a508dfb`](https://github.com/nodejs/node/commit/0d5a508dfb)] - **test**: extend timeout in Debug mode (Rich Trott) [#4431](https://github.com/nodejs/node/pull/4431) +* [[`6e4598d5da`](https://github.com/nodejs/node/commit/6e4598d5da)] - **test**: remove unused variables from TLS tests (Rich Trott) [#4424](https://github.com/nodejs/node/pull/4424) +* [[`7b1aa045a0`](https://github.com/nodejs/node/commit/7b1aa045a0)] - **test**: remove unused variables from HTTPS tests (Rich Trott) [#4426](https://github.com/nodejs/node/pull/4426) +* [[`da9e5c1b01`](https://github.com/nodejs/node/commit/da9e5c1b01)] - **test**: remove unused variables from net tests (Rich Trott) [#4430](https://github.com/nodejs/node/pull/4430) +* [[`13241bd24b`](https://github.com/nodejs/node/commit/13241bd24b)] - **test**: remove unused vars in ChildProcess tests (Rich Trott) [#4425](https://github.com/nodejs/node/pull/4425) +* [[`2f4538ddda`](https://github.com/nodejs/node/commit/2f4538ddda)] - **test**: remove unused vars (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) +* [[`dffe83ccd6`](https://github.com/nodejs/node/commit/dffe83ccd6)] - **test**: remove unused modules (Rich Trott) [#4684](https://github.com/nodejs/node/pull/4684) +* [[`c4eeb88ba1`](https://github.com/nodejs/node/commit/c4eeb88ba1)] - **test**: fix flaky cluster-disconnect-race (Brian White) [#4457](https://github.com/nodejs/node/pull/4457) +* [[`7caf87bf6c`](https://github.com/nodejs/node/commit/7caf87bf6c)] - **test**: fix flaky test-http-agent-keepalive (Rich Trott) [#4524](https://github.com/nodejs/node/pull/4524) +* [[`25c41d084d`](https://github.com/nodejs/node/commit/25c41d084d)] - **test**: remove flaky designations for tests (Rich Trott) [#4519](https://github.com/nodejs/node/pull/4519) +* [[`b8f097ece2`](https://github.com/nodejs/node/commit/b8f097ece2)] - **test**: fix flaky streams test (Rich Trott) [#4516](https://github.com/nodejs/node/pull/4516) +* [[`c24fa1437c`](https://github.com/nodejs/node/commit/c24fa1437c)] - **test**: inherit JOBS from environment (Johan Bergström) [#4495](https://github.com/nodejs/node/pull/4495) +* [[`7dc90e9e7f`](https://github.com/nodejs/node/commit/7dc90e9e7f)] - **test**: remove time check (Rich Trott) [#4494](https://github.com/nodejs/node/pull/4494) +* [[`7ca3c6c388`](https://github.com/nodejs/node/commit/7ca3c6c388)] - **test**: refactor test-fs-empty-readStream (Rich Trott) [#4490](https://github.com/nodejs/node/pull/4490) +* [[`610727dea7`](https://github.com/nodejs/node/commit/610727dea7)] - **test**: clarify role of domains in test (Rich Trott) [#4474](https://github.com/nodejs/node/pull/4474) +* [[`1ae0e355b9`](https://github.com/nodejs/node/commit/1ae0e355b9)] - **test**: improve assert message (Rich Trott) [#4461](https://github.com/nodejs/node/pull/4461) +* [[`e70c88df56`](https://github.com/nodejs/node/commit/e70c88df56)] - **test**: remove unused assert module imports (Rich Trott) [#4438](https://github.com/nodejs/node/pull/4438) +* [[`c77fc71f9b`](https://github.com/nodejs/node/commit/c77fc71f9b)] - **test**: remove unused var from test-assert.js (Rich Trott) [#4405](https://github.com/nodejs/node/pull/4405) +* [[`f613b3033f`](https://github.com/nodejs/node/commit/f613b3033f)] - **test**: add test-domain-exit-dispose-again back (Julien Gilli) [#4256](https://github.com/nodejs/node/pull/4256) +* [[`f5bfacd858`](https://github.com/nodejs/node/commit/f5bfacd858)] - **test**: remove unused `util` imports (Rich Trott) [#4562](https://github.com/nodejs/node/pull/4562) +* [[`d795301025`](https://github.com/nodejs/node/commit/d795301025)] - **test**: remove unnecessary assignments (Rich Trott) [#4563](https://github.com/nodejs/node/pull/4563) +* [[`acc3d66934`](https://github.com/nodejs/node/commit/acc3d66934)] - **test**: move ArrayStream to common (cjihrig) [#4027](https://github.com/nodejs/node/pull/4027) +* [[`6c0021361c`](https://github.com/nodejs/node/commit/6c0021361c)] - **test**: refactor test-net-connect-options-ipv6 (Rich Trott) [#4395](https://github.com/nodejs/node/pull/4395) +* [[`29804e00ad`](https://github.com/nodejs/node/commit/29804e00ad)] - **test**: use platformTimeout() in more places (Brian White) [#4387](https://github.com/nodejs/node/pull/4387) +* [[`761af37d0e`](https://github.com/nodejs/node/commit/761af37d0e)] - **test**: fix race condition in test-http-client-onerror (Devin Nakamura) [#4346](https://github.com/nodejs/node/pull/4346) +* [[`980852165f`](https://github.com/nodejs/node/commit/980852165f)] - **test**: fix flaky test-net-error-twice (Brian White) [#4342](https://github.com/nodejs/node/pull/4342) +* [[`1bc44e79d3`](https://github.com/nodejs/node/commit/1bc44e79d3)] - **test**: try other ipv6 localhost alternatives (Brian White) [#4325](https://github.com/nodejs/node/pull/4325) +* [[`44dbe15640`](https://github.com/nodejs/node/commit/44dbe15640)] - **test**: fix debug-port-cluster flakiness (Ben Noordhuis) [#4310](https://github.com/nodejs/node/pull/4310) +* [[`73e781172b`](https://github.com/nodejs/node/commit/73e781172b)] - **test**: add test for tls.parseCertString (Evan Lucas) [#4283](https://github.com/nodejs/node/pull/4283) +* [[`15c295a21b`](https://github.com/nodejs/node/commit/15c295a21b)] - **test**: use regular timeout times for ARMv8 (Jeremiah Senkpiel) [#4248](https://github.com/nodejs/node/pull/4248) +* [[`fd250b8fab`](https://github.com/nodejs/node/commit/fd250b8fab)] - **test**: parallelize test-repl-persistent-history (Jeremiah Senkpiel) [#4247](https://github.com/nodejs/node/pull/4247) +* [[`9a0f156e5a`](https://github.com/nodejs/node/commit/9a0f156e5a)] - **test**: fix domain-top-level-error-handler-throw (Santiago Gimeno) [#4364](https://github.com/nodejs/node/pull/4364) +* [[`6bc1b1c259`](https://github.com/nodejs/node/commit/6bc1b1c259)] - **test**: don't assume openssl s_client supports -ssl3 (Ben Noordhuis) [#4204](https://github.com/nodejs/node/pull/4204) +* [[`d00b9fc66f`](https://github.com/nodejs/node/commit/d00b9fc66f)] - **test**: fix tls-inception flakiness (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) +* [[`c41b280a2b`](https://github.com/nodejs/node/commit/c41b280a2b)] - **test**: fix tls-inception (Santiago Gimeno) [#4195](https://github.com/nodejs/node/pull/4195) +* [[`6f4ab1d1ab`](https://github.com/nodejs/node/commit/6f4ab1d1ab)] - **test**: mark test-cluster-shared-leak flaky (Rich Trott) [#4162](https://github.com/nodejs/node/pull/4162) +* [[`90498e2a68`](https://github.com/nodejs/node/commit/90498e2a68)] - **test**: skip long path tests on non-Windows (Rafał Pocztarski) [#4116](https://github.com/nodejs/node/pull/4116) +* [[`c9100d78f3`](https://github.com/nodejs/node/commit/c9100d78f3)] - **test**: fix flaky test-net-socket-local-address (Rich Trott) [#4109](https://github.com/nodejs/node/pull/4109) +* [[`ac939d51d9`](https://github.com/nodejs/node/commit/ac939d51d9)] - **test**: improve cluster-disconnect-handles test (Brian White) [#4084](https://github.com/nodejs/node/pull/4084) +* [[`22ba1b4115`](https://github.com/nodejs/node/commit/22ba1b4115)] - **test**: eliminate multicast test FreeBSD flakiness (Rich Trott) [#4042](https://github.com/nodejs/node/pull/4042) +* [[`2ee7853bb7`](https://github.com/nodejs/node/commit/2ee7853bb7)] - **test**: fix http-many-ended-pipelines flakiness (Santiago Gimeno) [#4041](https://github.com/nodejs/node/pull/4041) +* [[`a77dcfec06`](https://github.com/nodejs/node/commit/a77dcfec06)] - **test**: use platform-based timeout for reliability (Rich Trott) [#4015](https://github.com/nodejs/node/pull/4015) +* [[`3f0ff879cf`](https://github.com/nodejs/node/commit/3f0ff879cf)] - **test**: fix time resolution constraint (Gireesh Punathil) [#3981](https://github.com/nodejs/node/pull/3981) +* [[`22b88e1c48`](https://github.com/nodejs/node/commit/22b88e1c48)] - **test**: add TAP diagnostic message for retried tests (Rich Trott) [#3960](https://github.com/nodejs/node/pull/3960) +* [[`22d2887b1c`](https://github.com/nodejs/node/commit/22d2887b1c)] - **test**: add OS X to module loading error test (Evan Lucas) [#3901](https://github.com/nodejs/node/pull/3901) +* [[`e2141cb75e`](https://github.com/nodejs/node/commit/e2141cb75e)] - **test**: skip instead of fail when mem constrained (Michael Cornacchia) [#3697](https://github.com/nodejs/node/pull/3697) +* [[`166523d0ed`](https://github.com/nodejs/node/commit/166523d0ed)] - **test**: fix race condition in unrefd interval test (Michael Cornacchia) [#3550](https://github.com/nodejs/node/pull/3550) +* [[`86b47e8dc0`](https://github.com/nodejs/node/commit/86b47e8dc0)] - **timers**: optimize callback call: bind -> arrow (Andrei Sedoi) [#4038](https://github.com/nodejs/node/pull/4038) +* [[`4d37472ea7`](https://github.com/nodejs/node/commit/4d37472ea7)] - **tls_wrap**: clear errors on return (Fedor Indutny) [#4709](https://github.com/nodejs/node/pull/4709) +* [[`5b695d0343`](https://github.com/nodejs/node/commit/5b695d0343)] - **tls_wrap**: inherit from the `AsyncWrap` first (Fedor Indutny) [#4268](https://github.com/nodejs/node/pull/4268) +* [[`0efc35e6d8`](https://github.com/nodejs/node/commit/0efc35e6d8)] - **tls_wrap**: slice buffer properly in `ClearOut` (Fedor Indutny) [#4184](https://github.com/nodejs/node/pull/4184) +* [[`628cb8657c`](https://github.com/nodejs/node/commit/628cb8657c)] - **tools**: add .editorconfig (ronkorving) [#2993](https://github.com/nodejs/node/pull/2993) +* [[`69fef19624`](https://github.com/nodejs/node/commit/69fef19624)] - **tools**: implement no-unused-vars for eslint (Rich Trott) [#4536](https://github.com/nodejs/node/pull/4536) +* [[`3ee16706f2`](https://github.com/nodejs/node/commit/3ee16706f2)] - **tools**: enforce `throw new Error()` with lint rule (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`32801de4ef`](https://github.com/nodejs/node/commit/32801de4ef)] - **tools**: Use `throw new Error()` consistently (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`f413fae0cd`](https://github.com/nodejs/node/commit/f413fae0cd)] - **tools**: add tap output to cpplint (Johan Bergström) [#3448](https://github.com/nodejs/node/pull/3448) +* [[`efa30dd2f0`](https://github.com/nodejs/node/commit/efa30dd2f0)] - **tools**: enable prefer-const eslint rule (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`dd0c925896`](https://github.com/nodejs/node/commit/dd0c925896)] - **udp**: remove a needless instanceof Buffer check (ronkorving) [#4301](https://github.com/nodejs/node/pull/4301) +* [[`f4414102ed`](https://github.com/nodejs/node/commit/f4414102ed)] - **util**: faster arrayToHash (Jackson Tian) +* [[`b421119984`](https://github.com/nodejs/node/commit/b421119984)] - **util**: determine object types in C++ (cjihrig) [#4100](https://github.com/nodejs/node/pull/4100) +* [[`6a7c9d9293`](https://github.com/nodejs/node/commit/6a7c9d9293)] - **util**: move .decorateErrorStack to internal/util (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`422a865d46`](https://github.com/nodejs/node/commit/422a865d46)] - **util**: add decorateErrorStack() (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`2d5380ea25`](https://github.com/nodejs/node/commit/2d5380ea25)] - **util**: fix constructor/instanceof checks (Brian White) [#3385](https://github.com/nodejs/node/pull/3385) +* [[`1bf84b9d41`](https://github.com/nodejs/node/commit/1bf84b9d41)] - **util,src**: allow lookup of hidden values (cjihrig) [#3988](https://github.com/nodejs/node/pull/3988) + +## 2015-12-23, Version 4.2.4 'Argon' (LTS), @jasnell + +Maintenance update. + +### Notable changes + +* Roughly 78% of the commits are documentation and test improvements +* **domains**: +** Fix handling of uncaught exceptions (Julien Gilli) [#3884](https://github.com/nodejs/node/pull/3884) +* **deps**: +** Upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) +** Backport 819b40a from V8 upstream (Michaël Zasso) [#3938](https://github.com/nodejs/node/pull/3938) +** Updated node LICENSE file with new npm license (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) + +### Known issues + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`907a13a07f`](https://github.com/nodejs/node/commit/907a13a07f)] - Add missing va_end before return (Ömer Fadıl Usta) [#3565](https://github.com/nodejs/node/pull/3565) +* [[`7ffc01756f`](https://github.com/nodejs/node/commit/7ffc01756f)] - **buffer**: fix writeInt{B,L}E for some neg values (Peter A. Bigot) [#3994](https://github.com/nodejs/node/pull/3994) +* [[`db0186e435`](https://github.com/nodejs/node/commit/db0186e435)] - **buffer**: let WriteFloatGeneric silently drop values (P.S.V.R) +* [[`5c6740865a`](https://github.com/nodejs/node/commit/5c6740865a)] - **build**: update signtool description, add url (Rod Vagg) [#4011](https://github.com/nodejs/node/pull/4011) +* [[`60dda70f89`](https://github.com/nodejs/node/commit/60dda70f89)] - **build**: fix --with-intl=system-icu for x-compile (Steven R. Loomis) [#3808](https://github.com/nodejs/node/pull/3808) +* [[`22208b067c`](https://github.com/nodejs/node/commit/22208b067c)] - **build**: fix configuring with prebuilt libraries (Markus Tzoe) [#3135](https://github.com/nodejs/node/pull/3135) +* [[`914caf9c69`](https://github.com/nodejs/node/commit/914caf9c69)] - **child_process**: add safety checks on stdio access (cjihrig) [#3799](https://github.com/nodejs/node/pull/3799) +* [[`236ad90a84`](https://github.com/nodejs/node/commit/236ad90a84)] - **child_process**: don't fork bomb ourselves from -e (Ben Noordhuis) [#3575](https://github.com/nodejs/node/pull/3575) +* [[`f28f69dac4`](https://github.com/nodejs/node/commit/f28f69dac4)] - **cluster**: remove handles when disconnecting worker (Ben Noordhuis) [#3677](https://github.com/nodejs/node/pull/3677) +* [[`f5c5e8bf91`](https://github.com/nodejs/node/commit/f5c5e8bf91)] - **cluster**: send suicide message on disconnect (cjihrig) [#3720](https://github.com/nodejs/node/pull/3720) +* [[`629d5d18d7`](https://github.com/nodejs/node/commit/629d5d18d7)] - **configure**: `v8_use_snapshot` should be `true` (Fedor Indutny) [#3962](https://github.com/nodejs/node/pull/3962) +* [[`3094464871`](https://github.com/nodejs/node/commit/3094464871)] - **configure**: use __ARM_ARCH to determine arm version (João Reis) [#4123](https://github.com/nodejs/node/pull/4123) +* [[`1e1173fc5c`](https://github.com/nodejs/node/commit/1e1173fc5c)] - **configure**: respect CC_host in host arch detection (João Reis) [#4117](https://github.com/nodejs/node/pull/4117) +* [[`2e9b886fbf`](https://github.com/nodejs/node/commit/2e9b886fbf)] - **crypto**: DSA parameter validation in FIPS mode (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`00b77d9e84`](https://github.com/nodejs/node/commit/00b77d9e84)] - **crypto**: Improve error checking and reporting (Stefan Budeanu) [#3753](https://github.com/nodejs/node/pull/3753) +* [[`3dd90ddc73`](https://github.com/nodejs/node/commit/3dd90ddc73)] - **deps**: upgrade to npm 2.14.12 (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) +* [[`51ae8d10b3`](https://github.com/nodejs/node/commit/51ae8d10b3)] - **deps**: Updated node LICENSE file with new npm license (Kat Marchán) [#4110](https://github.com/nodejs/node/pull/4110) +* [[`9e1edead22`](https://github.com/nodejs/node/commit/9e1edead22)] - **deps**: backport 819b40a from V8 upstream (Michaël Zasso) [#3938](https://github.com/nodejs/node/pull/3938) +* [[`a2ce3843cc`](https://github.com/nodejs/node/commit/a2ce3843cc)] - **deps**: upgrade npm to 2.14.9 (Forrest L Norvell) [#3686](https://github.com/nodejs/node/pull/3686) +* [[`b140cb29f4`](https://github.com/nodejs/node/commit/b140cb29f4)] - **dns**: prevent undefined values in results (Junliang Yan) [#3696](https://github.com/nodejs/node/pull/3696) +* [[`8aafa2ecc0`](https://github.com/nodejs/node/commit/8aafa2ecc0)] - **doc**: standardize references to node.js in docs (Scott Buchanan) [#4136](https://github.com/nodejs/node/pull/4136) +* [[`72f43a263a`](https://github.com/nodejs/node/commit/72f43a263a)] - **doc**: fix internal link to child.send() (Luigi Pinca) [#4089](https://github.com/nodejs/node/pull/4089) +* [[`dcfdbac457`](https://github.com/nodejs/node/commit/dcfdbac457)] - **doc**: reword https.Agent example text (Jan Krems) [#4075](https://github.com/nodejs/node/pull/4075) +* [[`f93d268dec`](https://github.com/nodejs/node/commit/f93d268dec)] - **doc**: add HTTP working group (James M Snell) [#3919](https://github.com/nodejs/node/pull/3919) +* [[`beee0553ca`](https://github.com/nodejs/node/commit/beee0553ca)] - **doc**: update WORKING_GROUPS.md - add missing groups (Michael Dawson) [#3450](https://github.com/nodejs/node/pull/3450) +* [[`3327415fc4`](https://github.com/nodejs/node/commit/3327415fc4)] - **doc**: fix the exception description (yorkie) [#3658](https://github.com/nodejs/node/pull/3658) +* [[`da8d012c88`](https://github.com/nodejs/node/commit/da8d012c88)] - **doc**: clarify v4.2.3 notable items (Rod Vagg) [#4155](https://github.com/nodejs/node/pull/4155) +* [[`44a2d8ca24`](https://github.com/nodejs/node/commit/44a2d8ca24)] - **doc**: fix color of linked code blocks (jpersson) [#4068](https://github.com/nodejs/node/pull/4068) +* [[`bebde48ebc`](https://github.com/nodejs/node/commit/bebde48ebc)] - **doc**: fix typo in README (Rich Trott) [#4000](https://github.com/nodejs/node/pull/4000) +* [[`b48d5ec301`](https://github.com/nodejs/node/commit/b48d5ec301)] - **doc**: message.header duplication correction (Bryan English) [#3997](https://github.com/nodejs/node/pull/3997) +* [[`6ef3625456`](https://github.com/nodejs/node/commit/6ef3625456)] - **doc**: replace sane with reasonable (Lewis Cowper) [#3980](https://github.com/nodejs/node/pull/3980) +* [[`c5be3c63f0`](https://github.com/nodejs/node/commit/c5be3c63f0)] - **doc**: fix rare case of misaligned columns (Roman Reiss) [#3948](https://github.com/nodejs/node/pull/3948) +* [[`bd82fb06ff`](https://github.com/nodejs/node/commit/bd82fb06ff)] - **doc**: fix broken references (Alexander Gromnitsky) [#3944](https://github.com/nodejs/node/pull/3944) +* [[`8eb28c3d50`](https://github.com/nodejs/node/commit/8eb28c3d50)] - **doc**: add reference for buffer.inspect() (cjihrig) [#3921](https://github.com/nodejs/node/pull/3921) +* [[`4bc71e0078`](https://github.com/nodejs/node/commit/4bc71e0078)] - **doc**: clarify module loading behavior (cjihrig) [#3920](https://github.com/nodejs/node/pull/3920) +* [[`4c382e7aaa`](https://github.com/nodejs/node/commit/4c382e7aaa)] - **doc**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`5207099dc9`](https://github.com/nodejs/node/commit/5207099dc9)] - **doc**: clarify that fs streams expect blocking fd (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`753c5071ea`](https://github.com/nodejs/node/commit/753c5071ea)] - **doc**: Adding best practises for crypto.pbkdf2 (Tom Gallacher) [#3290](https://github.com/nodejs/node/pull/3290) +* [[`8f0291beba`](https://github.com/nodejs/node/commit/8f0291beba)] - **doc**: update WORKING_GROUPS.md to include Intl (Steven R. Loomis) [#3251](https://github.com/nodejs/node/pull/3251) +* [[`c31d472487`](https://github.com/nodejs/node/commit/c31d472487)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3859](https://github.com/nodejs/node/pull/3859) +* [[`6b172d9fe8`](https://github.com/nodejs/node/commit/6b172d9fe8)] - **doc**: consistent reference-style links (Bryan English) [#3845](https://github.com/nodejs/node/pull/3845) +* [[`ffd3335e29`](https://github.com/nodejs/node/commit/ffd3335e29)] - **doc**: address use of profanity in code of conduct (James M Snell) [#3827](https://github.com/nodejs/node/pull/3827) +* [[`a36a5b63cf`](https://github.com/nodejs/node/commit/a36a5b63cf)] - **doc**: reword message.headers to indicate they are not read-only (Tristian Flanagan) [#3814](https://github.com/nodejs/node/pull/3814) +* [[`6de77cd320`](https://github.com/nodejs/node/commit/6de77cd320)] - **doc**: clarify duplicate header handling (Bryan English) [#3810](https://github.com/nodejs/node/pull/3810) +* [[`b22973af81`](https://github.com/nodejs/node/commit/b22973af81)] - **doc**: replace head of readme with updated text (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`eab0d56ea9`](https://github.com/nodejs/node/commit/eab0d56ea9)] - **doc**: repl: add defineComand and displayPrompt (Bryan English) [#3765](https://github.com/nodejs/node/pull/3765) +* [[`15fb02985f`](https://github.com/nodejs/node/commit/15fb02985f)] - **doc**: document release types in readme (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`29f26b882f`](https://github.com/nodejs/node/commit/29f26b882f)] - **doc**: add link to \[customizing util.inspect colors\]. (Jesse McCarthy) [#3749](https://github.com/nodejs/node/pull/3749) +* [[`90fdb4f7b3`](https://github.com/nodejs/node/commit/90fdb4f7b3)] - **doc**: sort tls alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`39fa9fa85c`](https://github.com/nodejs/node/commit/39fa9fa85c)] - **doc**: sort stream alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`e98e8afb2b`](https://github.com/nodejs/node/commit/e98e8afb2b)] - **doc**: sort net alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`6de887483d`](https://github.com/nodejs/node/commit/6de887483d)] - **doc**: sort process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`37033dcb71`](https://github.com/nodejs/node/commit/37033dcb71)] - **doc**: sort zlib alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`9878034567`](https://github.com/nodejs/node/commit/9878034567)] - **doc**: sort util alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`48fc765eb6`](https://github.com/nodejs/node/commit/48fc765eb6)] - **doc**: sort https alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3546eb4f40`](https://github.com/nodejs/node/commit/3546eb4f40)] - **doc**: sort http alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`dedfb1156a`](https://github.com/nodejs/node/commit/dedfb1156a)] - **doc**: sort modules alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`71722fe1a1`](https://github.com/nodejs/node/commit/71722fe1a1)] - **doc**: sort readline alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`660062bf9e`](https://github.com/nodejs/node/commit/660062bf9e)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`34b8d28725`](https://github.com/nodejs/node/commit/34b8d28725)] - **doc**: sort string_decoder alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3f3b9ed7d7`](https://github.com/nodejs/node/commit/3f3b9ed7d7)] - **doc**: sort timers alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`af876ddc64`](https://github.com/nodejs/node/commit/af876ddc64)] - **doc**: sort tty alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3c2068704a`](https://github.com/nodejs/node/commit/3c2068704a)] - **doc**: sort url alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`363692fd0c`](https://github.com/nodejs/node/commit/363692fd0c)] - **doc**: sort vm alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`ca41b55166`](https://github.com/nodejs/node/commit/ca41b55166)] - **doc**: sort querystring alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`f37ff22b9f`](https://github.com/nodejs/node/commit/f37ff22b9f)] - **doc**: sort punycode alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`4d569607af`](https://github.com/nodejs/node/commit/4d569607af)] - **doc**: sort path alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`daa62447d1`](https://github.com/nodejs/node/commit/daa62447d1)] - **doc**: sort os alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0906f9a8bb`](https://github.com/nodejs/node/commit/0906f9a8bb)] - **doc**: sort globals alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`6cd06c1319`](https://github.com/nodejs/node/commit/6cd06c1319)] - **doc**: sort fs alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`5b310f8d9e`](https://github.com/nodejs/node/commit/5b310f8d9e)] - **doc**: sort events alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`782cb7d15b`](https://github.com/nodejs/node/commit/782cb7d15b)] - **doc**: sort errors alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`c39eabbec4`](https://github.com/nodejs/node/commit/c39eabbec4)] - **doc**: sort dgram alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`261e0f3a21`](https://github.com/nodejs/node/commit/261e0f3a21)] - **doc**: sort crypto alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0e6121d04d`](https://github.com/nodejs/node/commit/0e6121d04d)] - **doc**: sort dns alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`435ffb79f7`](https://github.com/nodejs/node/commit/435ffb79f7)] - **doc**: sort console alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`28935a10d6`](https://github.com/nodejs/node/commit/28935a10d6)] - **doc**: sort cluster alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`5e79dc4406`](https://github.com/nodejs/node/commit/5e79dc4406)] - **doc**: sort child_process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`af0bf1a72c`](https://github.com/nodejs/node/commit/af0bf1a72c)] - **doc**: sort buffer alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`f43a0330aa`](https://github.com/nodejs/node/commit/f43a0330aa)] - **doc**: sort assert alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`1bbc3b3ff8`](https://github.com/nodejs/node/commit/1bbc3b3ff8)] - **doc**: add note on tls connection meta data methods (Tyler Henkel) [#3746](https://github.com/nodejs/node/pull/3746) +* [[`3c415bbb12`](https://github.com/nodejs/node/commit/3c415bbb12)] - **doc**: add note to util.isBuffer (Evan Lucas) [#3790](https://github.com/nodejs/node/pull/3790) +* [[`7b5e4574fd`](https://github.com/nodejs/node/commit/7b5e4574fd)] - **doc**: add romankl to collaborators (Roman Klauke) [#3725](https://github.com/nodejs/node/pull/3725) +* [[`4f7c638a7a`](https://github.com/nodejs/node/commit/4f7c638a7a)] - **doc**: add saghul as a collaborator (Saúl Ibarra Corretgé) +* [[`523251270a`](https://github.com/nodejs/node/commit/523251270a)] - **doc**: add thealphanerd to collaborators (Myles Borins) [#3723](https://github.com/nodejs/node/pull/3723) +* [[`488e74f27d`](https://github.com/nodejs/node/commit/488e74f27d)] - **doc**: update lts description in the collaborator guide (James M Snell) [#3668](https://github.com/nodejs/node/pull/3668) +* [[`fe3ae3cea4`](https://github.com/nodejs/node/commit/fe3ae3cea4)] - **doc**: add LTS info to COLLABORATOR_GUIDE.md (Myles Borins) [#3442](https://github.com/nodejs/node/pull/3442) +* [[`daa10a345e`](https://github.com/nodejs/node/commit/daa10a345e)] - **doc**: typo fix in readme.md (Sam P Gallagher-Bishop) [#3649](https://github.com/nodejs/node/pull/3649) +* [[`eca5720761`](https://github.com/nodejs/node/commit/eca5720761)] - **doc**: fix wrong date and known issue in changelog.md (James M Snell) [#3650](https://github.com/nodejs/node/pull/3650) +* [[`83494f8f3e`](https://github.com/nodejs/node/commit/83494f8f3e)] - **doc**: rename iojs-* groups to nodejs-* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) +* [[`347fb65aee`](https://github.com/nodejs/node/commit/347fb65aee)] - **doc**: fix crypto spkac function descriptions (Jason Gerfen) [#3614](https://github.com/nodejs/node/pull/3614) +* [[`11d2050d63`](https://github.com/nodejs/node/commit/11d2050d63)] - **doc**: Updated streams simplified constructor API (Tom Gallacher) [#3602](https://github.com/nodejs/node/pull/3602) +* [[`6db4392bfb`](https://github.com/nodejs/node/commit/6db4392bfb)] - **doc**: made code spans more visible in the API docs (phijohns) [#3573](https://github.com/nodejs/node/pull/3573) +* [[`8a7dd73af1`](https://github.com/nodejs/node/commit/8a7dd73af1)] - **doc**: added what buf.copy returns (Manuel B) [#3555](https://github.com/nodejs/node/pull/3555) +* [[`cf4b65c2d6`](https://github.com/nodejs/node/commit/cf4b65c2d6)] - **doc**: fix function param order in assert doc (David Woods) [#3533](https://github.com/nodejs/node/pull/3533) +* [[`a2efe4c72b`](https://github.com/nodejs/node/commit/a2efe4c72b)] - **doc**: add note about timeout delay > TIMEOUT_MAX (Guilherme Souza) [#3512](https://github.com/nodejs/node/pull/3512) +* [[`d1b5833476`](https://github.com/nodejs/node/commit/d1b5833476)] - **doc**: add caveats of algs and key size in crypto (Shigeki Ohtsu) [#3479](https://github.com/nodejs/node/pull/3479) +* [[`12cdf6fcf3`](https://github.com/nodejs/node/commit/12cdf6fcf3)] - **doc**: add method links in events.markdown (Alejandro Oviedo) [#3187](https://github.com/nodejs/node/pull/3187) +* [[`f50f19e384`](https://github.com/nodejs/node/commit/f50f19e384)] - **doc**: stdout/stderr can block when directed to file (Ben Noordhuis) [#3170](https://github.com/nodejs/node/pull/3170) +* [[`b2cc1302e0`](https://github.com/nodejs/node/commit/b2cc1302e0)] - **docs**: improve discoverability of Code of Conduct (Ashley Williams) [#3774](https://github.com/nodejs/node/pull/3774) +* [[`fa1ab497f1`](https://github.com/nodejs/node/commit/fa1ab497f1)] - **docs**: fs - change links to buffer encoding to Buffer class anchor (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) +* [[`34e64e5390`](https://github.com/nodejs/node/commit/34e64e5390)] - **domains**: fix handling of uncaught exceptions (Julien Gilli) [#3884](https://github.com/nodejs/node/pull/3884) +* [[`0311836e7a`](https://github.com/nodejs/node/commit/0311836e7a)] - **meta**: remove use of profanity in source (Myles Borins) [#4122](https://github.com/nodejs/node/pull/4122) +* [[`971762ada9`](https://github.com/nodejs/node/commit/971762ada9)] - **module**: cache regular expressions (Evan Lucas) [#3869](https://github.com/nodejs/node/pull/3869) +* [[`d80fa2c77c`](https://github.com/nodejs/node/commit/d80fa2c77c)] - **module**: remove unnecessary JSON.stringify (Andres Suarez) [#3578](https://github.com/nodejs/node/pull/3578) +* [[`aa85d62f09`](https://github.com/nodejs/node/commit/aa85d62f09)] - **net**: add local address/port for better errors (Jan Schär) [#3946](https://github.com/nodejs/node/pull/3946) +* [[`803a56de52`](https://github.com/nodejs/node/commit/803a56de52)] - **querystring**: Parse multiple separator characters (Yosuke Furukawa) [#3807](https://github.com/nodejs/node/pull/3807) +* [[`ff02b295fc`](https://github.com/nodejs/node/commit/ff02b295fc)] - **repl**: don't crash if cannot open history file (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630) +* [[`329e88e545`](https://github.com/nodejs/node/commit/329e88e545)] - **repl**: To exit, press ^C again or type .exit. (Hemanth.HM) [#3368](https://github.com/nodejs/node/pull/3368) +* [[`9b05905361`](https://github.com/nodejs/node/commit/9b05905361)] - **src**: Revert "nix stdin _readableState.reading" (Roman Reiss) [#3490](https://github.com/nodejs/node/pull/3490) +* [[`957c1f2543`](https://github.com/nodejs/node/commit/957c1f2543)] - **stream_wrap**: error if stream has StringDecoder (Fedor Indutny) [#4031](https://github.com/nodejs/node/pull/4031) +* [[`43e3b69dae`](https://github.com/nodejs/node/commit/43e3b69dae)] - **test**: refactor test-http-exit-delay (Rich Trott) [#4055](https://github.com/nodejs/node/pull/4055) +* [[`541d0d21be`](https://github.com/nodejs/node/commit/541d0d21be)] - **test**: fix cluster-disconnect-handles flakiness (Santiago Gimeno) [#4009](https://github.com/nodejs/node/pull/4009) +* [[`5f66d66e84`](https://github.com/nodejs/node/commit/5f66d66e84)] - **test**: don't check the # of chunks in test-http-1.0 (Santiago Gimeno) [#3961](https://github.com/nodejs/node/pull/3961) +* [[`355edf585b`](https://github.com/nodejs/node/commit/355edf585b)] - **test**: fix cluster-worker-isdead (Santiago Gimeno) [#3954](https://github.com/nodejs/node/pull/3954) +* [[`4e46e04002`](https://github.com/nodejs/node/commit/4e46e04002)] - **test**: add test for repl.defineCommand() (Bryan English) [#3908](https://github.com/nodejs/node/pull/3908) +* [[`4ea1a69c53`](https://github.com/nodejs/node/commit/4ea1a69c53)] - **test**: mark test flaky on FreeBSD (Rich Trott) [#4016](https://github.com/nodejs/node/pull/4016) +* [[`05b64c11f5`](https://github.com/nodejs/node/commit/05b64c11f5)] - **test**: mark cluster-net-send test flaky on windows (Rich Trott) [#4006](https://github.com/nodejs/node/pull/4006) +* [[`695015579b`](https://github.com/nodejs/node/commit/695015579b)] - **test**: remove flaky designation from ls-no-sslv3 (Rich Trott) [#3620](https://github.com/nodejs/node/pull/3620) +* [[`abbd87b273`](https://github.com/nodejs/node/commit/abbd87b273)] - **test**: mark fork regression test flaky on windows (Rich Trott) [#4005](https://github.com/nodejs/node/pull/4005) +* [[`38ba152a7a`](https://github.com/nodejs/node/commit/38ba152a7a)] - **test**: skip test if in FreeBSD jail (Rich Trott) [#3995](https://github.com/nodejs/node/pull/3995) +* [[`cc24f0ea58`](https://github.com/nodejs/node/commit/cc24f0ea58)] - **test**: fix test-domain-exit-dispose-again (Julien Gilli) [#3990](https://github.com/nodejs/node/pull/3990) +* [[`b2f1014d26`](https://github.com/nodejs/node/commit/b2f1014d26)] - **test**: remove flaky status for cluster test (Rich Trott) [#3975](https://github.com/nodejs/node/pull/3975) +* [[`e66794fd30`](https://github.com/nodejs/node/commit/e66794fd30)] - **test**: address flaky test-http-client-timeout-event (Rich Trott) [#3968](https://github.com/nodejs/node/pull/3968) +* [[`5a2727421a`](https://github.com/nodejs/node/commit/5a2727421a)] - **test**: retry on smartos if ECONNREFUSED (Rich Trott) [#3941](https://github.com/nodejs/node/pull/3941) +* [[`dbc85a275c`](https://github.com/nodejs/node/commit/dbc85a275c)] - **test**: avoid test timeouts on rpi (Stefan Budeanu) [#3902](https://github.com/nodejs/node/pull/3902) +* [[`b9d7378d20`](https://github.com/nodejs/node/commit/b9d7378d20)] - **test**: fix flaky test-child-process-spawnsync-input (Rich Trott) [#3889](https://github.com/nodejs/node/pull/3889) +* [[`cca216a034`](https://github.com/nodejs/node/commit/cca216a034)] - **test**: move test-specific function out of common (Rich Trott) [#3871](https://github.com/nodejs/node/pull/3871) +* [[`fb8df8d6c2`](https://github.com/nodejs/node/commit/fb8df8d6c2)] - **test**: module loading error fix solaris #3798 (fansworld-claudio) [#3855](https://github.com/nodejs/node/pull/3855) +* [[`9ea6bc1e0f`](https://github.com/nodejs/node/commit/9ea6bc1e0f)] - **test**: skip test if FreeBSD jail will break it (Rich Trott) [#3839](https://github.com/nodejs/node/pull/3839) +* [[`150f126618`](https://github.com/nodejs/node/commit/150f126618)] - **test**: fix flaky SmartOS test (Rich Trott) [#3830](https://github.com/nodejs/node/pull/3830) +* [[`603a6f5405`](https://github.com/nodejs/node/commit/603a6f5405)] - **test**: run pipeline flood test in parallel (Rich Trott) [#3811](https://github.com/nodejs/node/pull/3811) +* [[`4a26f74ee3`](https://github.com/nodejs/node/commit/4a26f74ee3)] - **test**: skip/replace weak crypto tests in FIPS mode (Stefan Budeanu) [#3757](https://github.com/nodejs/node/pull/3757) +* [[`3f9562b6bd`](https://github.com/nodejs/node/commit/3f9562b6bd)] - **test**: stronger crypto in test fixtures (Stefan Budeanu) [#3759](https://github.com/nodejs/node/pull/3759) +* [[`1f83eebec5`](https://github.com/nodejs/node/commit/1f83eebec5)] - **test**: increase crypto strength for FIPS standard (Stefan Budeanu) [#3758](https://github.com/nodejs/node/pull/3758) +* [[`7c5fbf7850`](https://github.com/nodejs/node/commit/7c5fbf7850)] - **test**: add hasFipsCrypto to test/common.js (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`f30214f135`](https://github.com/nodejs/node/commit/f30214f135)] - **test**: add test for invalid DSA key size (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`9a6c9faafb`](https://github.com/nodejs/node/commit/9a6c9faafb)] - **test**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`93d1d3cfcd`](https://github.com/nodejs/node/commit/93d1d3cfcd)] - **test**: refactor test-http-pipeline-flood (Rich Trott) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`6c23f67504`](https://github.com/nodejs/node/commit/6c23f67504)] - **test**: fix flaky test test-http-pipeline-flood (Devin Nakamura) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`4e5cae4360`](https://github.com/nodejs/node/commit/4e5cae4360)] - **test**: use really invalid hostname (Sakthipriyan Vairamani) [#3711](https://github.com/nodejs/node/pull/3711) +* [[`da189f793b`](https://github.com/nodejs/node/commit/da189f793b)] - **test**: Fix test-cluster-worker-exit.js for AIX (Imran Iqbal) [#3666](https://github.com/nodejs/node/pull/3666) +* [[`7b4194a863`](https://github.com/nodejs/node/commit/7b4194a863)] - **test**: fix test-module-loading-error for musl (Hugues Malphettes) [#3657](https://github.com/nodejs/node/pull/3657) +* [[`3dc52e99df`](https://github.com/nodejs/node/commit/3dc52e99df)] - **test**: fix test-net-persistent-keepalive for AIX (Imran Iqbal) [#3646](https://github.com/nodejs/node/pull/3646) +* [[`0e8eb66a78`](https://github.com/nodejs/node/commit/0e8eb66a78)] - **test**: fix path to module for repl test on Windows (Michael Cornacchia) [#3608](https://github.com/nodejs/node/pull/3608) +* [[`3aecbc86d2`](https://github.com/nodejs/node/commit/3aecbc86d2)] - **test**: add test-zlib-flush-drain (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`542d05cbe1`](https://github.com/nodejs/node/commit/542d05cbe1)] - **test**: enhance fs-watch-recursive test (Sakthipriyan Vairamani) [#2599](https://github.com/nodejs/node/pull/2599) +* [[`0eb0119d64`](https://github.com/nodejs/node/commit/0eb0119d64)] - **tls**: Use SHA1 for sessionIdContext in FIPS mode (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755) +* [[`c10c08604c`](https://github.com/nodejs/node/commit/c10c08604c)] - **tls**: remove util and calls to util.format (Myles Borins) [#3456](https://github.com/nodejs/node/pull/3456) +* [[`a558a570c0`](https://github.com/nodejs/node/commit/a558a570c0)] - **util**: use regexp instead of str.replace().join() (qinjia) [#3689](https://github.com/nodejs/node/pull/3689) +* [[`47bb94a0c3`](https://github.com/nodejs/node/commit/47bb94a0c3)] - **zlib**: only apply drain listener if given callback (Craig Cavalier) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`4733a60158`](https://github.com/nodejs/node/commit/4733a60158)] - **zlib**: pass kind to recursive calls to flush (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) + +## 2015-12-04, Version 4.2.3 'Argon' (LTS), @rvagg + +Security Update + +### 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 + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`49bbd563be`](https://github.com/nodejs/node/commit/49bbd563be)] - **deps**: upgrade openssl sources to 1.0.2e (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) +* [[`9a063fd492`](https://github.com/nodejs/node/commit/9a063fd492)] - **deps**: backport a7e50a5 from upstream v8 (Ben Noordhuis) +* [[`07233206e9`](https://github.com/nodejs/node/commit/07233206e9)] - **deps**: backport 6df9a1d from upstream v8 (Ben Noordhuis) +* [[`1c8e6de78e`](https://github.com/nodejs/node/commit/1c8e6de78e)] - **http**: fix pipeline regression (Fedor Indutny) + +## 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-13, Version 4.2.1 'Argon' (LTS), @jasnell + +### Notable changes + +* Includes fixes for two regressions + - Assertion error in WeakCallback - see [#3329](https://github.com/nodejs/node/pull/3329) + - Undefined timeout regression - see [#3331](https://github.com/nodejs/node/pull/3331) + +### Known issues + +* When a server queues a large amount of data to send to a client over a pipelined HTTP connection, the underlying socket may be destroyed. See [#3332](https://github.com/nodejs/node/issues/3332) and [#3342](https://github.com/nodejs/node/pull/3342). +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`b3cbd13340`](https://github.com/nodejs/node/commit/b3cbd13340)] - **buffer**: fix assertion error in WeakCallback (Fedor Indutny) [#3329](https://github.com/nodejs/node/pull/3329) +* [[`102cb7288c`](https://github.com/nodejs/node/commit/102cb7288c)] - **doc**: label v4.2.0 as LTS in changelog heading (Rod Vagg) [#3343](https://github.com/nodejs/node/pull/3343) +* [[`c245a199a7`](https://github.com/nodejs/node/commit/c245a199a7)] - **lib**: fix undefined timeout regression (Ryan Graham) [#3331](https://github.com/nodejs/node/pull/3331) + +## 2015-10-07, Version 4.2.0 'Argon' (LTS), @jasnell + +### Notable changes + +The first Node.js LTS release! See https://github.com/nodejs/LTS/ for details of the LTS process. + +* **icu**: Updated to version 56 with significant performance improvements (Steven R. Loomis) [#3281](https://github.com/nodejs/node/pull/3281) +* **node**: + - Added new `-c` (or `--check`) command line argument for checking script syntax without executing the code (Dave Eddy) [#2411](https://github.com/nodejs/node/pull/2411) + - Added `process.versions.icu` to hold the current ICU library version (Evan Lucas) [#3102](https://github.com/nodejs/node/pull/3102) + - Added `process.release.lts` to hold the current LTS codename when the binary is from an active LTS release line (Rod Vagg) [#3212](https://github.com/nodejs/node/pull/3212) +* **npm**: Upgraded to npm 2.14.7 from 2.14.4, see [release notes](https://github.com/npm/npm/releases/tag/v2.14.7) for full details (Kat Marchán) [#3299](https://github.com/nodejs/node/pull/3299) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + + +* [[`8383c4fe00`](https://github.com/nodejs/node/commit/8383c4fe00)] - **assert**: support arrow functions in .throws() (Ben Noordhuis) [#3276](https://github.com/nodejs/node/pull/3276) +* [[`3eaa593a32`](https://github.com/nodejs/node/commit/3eaa593a32)] - **async_wrap**: correctly pass parent to init callback (Trevor Norris) [#3216](https://github.com/nodejs/node/pull/3216) +* [[`54795620f6`](https://github.com/nodejs/node/commit/54795620f6)] - **buffer**: don't abort on prototype getters (Trevor Norris) [#3302](https://github.com/nodejs/node/pull/3302) +* [[`660f7591c8`](https://github.com/nodejs/node/commit/660f7591c8)] - **buffer**: FreeCallback should be tied to ArrayBuffer (Fedor Indutny) [#3198](https://github.com/nodejs/node/pull/3198) +* [[`651a5b51eb`](https://github.com/nodejs/node/commit/651a5b51eb)] - **buffer**: only check if instance is Uint8Array (Trevor Norris) [#3080](https://github.com/nodejs/node/pull/3080) +* [[`d5a1b1ad7c`](https://github.com/nodejs/node/commit/d5a1b1ad7c)] - **buffer**: clean up usage of __proto__ (Trevor Norris) [#3080](https://github.com/nodejs/node/pull/3080) +* [[`af24376e18`](https://github.com/nodejs/node/commit/af24376e18)] - **build**: Intl: deps: bump ICU to 56.1 (GA) (Steven R. Loomis) [#3281](https://github.com/nodejs/node/pull/3281) +* [[`9136359d57`](https://github.com/nodejs/node/commit/9136359d57)] - **build**: make icu download path customizable (Johan Bergström) [#3200](https://github.com/nodejs/node/pull/3200) +* [[`b3c5ad10a8`](https://github.com/nodejs/node/commit/b3c5ad10a8)] - **build**: add --with-arm-fpu option (Jérémy Lal) [#3228](https://github.com/nodejs/node/pull/3228) +* [[`f00f3268e4`](https://github.com/nodejs/node/commit/f00f3268e4)] - **build**: intl: avoid 'duplicate main()' on ICU 56 (Steven R. Loomis) [#3066](https://github.com/nodejs/node/pull/3066) +* [[`071c72a6a3`](https://github.com/nodejs/node/commit/071c72a6a3)] - **deps**: upgrade to npm 2.14.7 (Kat Marchán) [#3299](https://github.com/nodejs/node/pull/3299) +* [[`8b50e95f06`](https://github.com/nodejs/node/commit/8b50e95f06)] - **(SEMVER-MINOR)** **deps**: backport 1ee712a from V8 upstream (Julien Gilli) [#3036](https://github.com/nodejs/node/pull/3036) +* [[`747271372f`](https://github.com/nodejs/node/commit/747271372f)] - **doc**: update the assert module summary (David Boivin) [#2799](https://github.com/nodejs/node/pull/2799) +* [[`0d506556b0`](https://github.com/nodejs/node/commit/0d506556b0)] - **doc**: replace node-gyp link with nodejs/node-gyp (Roman Klauke) [#3320](https://github.com/nodejs/node/pull/3320) +* [[`40a159e4f4`](https://github.com/nodejs/node/commit/40a159e4f4)] - **doc**: Amend capitalization of word JavaScript (Dave Hodder) [#3285](https://github.com/nodejs/node/pull/3285) +* [[`6dd34761fd`](https://github.com/nodejs/node/commit/6dd34761fd)] - **doc**: add method links in dns.markdown (Alejandro Oviedo) [#3196](https://github.com/nodejs/node/pull/3196) +* [[`333e8336be`](https://github.com/nodejs/node/commit/333e8336be)] - **doc**: add method links in child_process.markdown (Alejandro Oviedo) [#3186](https://github.com/nodejs/node/pull/3186) +* [[`0cfc6d39ca`](https://github.com/nodejs/node/commit/0cfc6d39ca)] - **doc**: recommend Infinity on emitter.setMaxListeners (Jason Karns) [#2559](https://github.com/nodejs/node/pull/2559) +* [[`d4fc6d93ef`](https://github.com/nodejs/node/commit/d4fc6d93ef)] - **doc**: add help repo link to CONTRIBUTING.md (Doug Shamoo) [#3233](https://github.com/nodejs/node/pull/3233) +* [[`28aac7f19d`](https://github.com/nodejs/node/commit/28aac7f19d)] - **doc**: add TLS session resumption example (Roman Reiss) [#3147](https://github.com/nodejs/node/pull/3147) +* [[`365cf22cce`](https://github.com/nodejs/node/commit/365cf22cce)] - **doc**: update AUTHORS list (Rod Vagg) [#3211](https://github.com/nodejs/node/pull/3211) +* [[`d4399613b7`](https://github.com/nodejs/node/commit/d4399613b7)] - **doc**: standardize references to userland (Martial) [#3192](https://github.com/nodejs/node/pull/3192) +* [[`75de258376`](https://github.com/nodejs/node/commit/75de258376)] - **doc**: fix spelling in Buffer documentation (Rod Machen) [#3226](https://github.com/nodejs/node/pull/3226) +* [[`725c7276dd`](https://github.com/nodejs/node/commit/725c7276dd)] - **doc**: fix README.md link to joyent/node intl wiki (Steven R. Loomis) [#3067](https://github.com/nodejs/node/pull/3067) +* [[`4a35ba4966`](https://github.com/nodejs/node/commit/4a35ba4966)] - **(SEMVER-MINOR)** **fs**: include filename in watch errors (charlierudolph) [#2748](https://github.com/nodejs/node/pull/2748) +* [[`2ddbbfd164`](https://github.com/nodejs/node/commit/2ddbbfd164)] - **http**: cork/uncork before flushing pipelined res (Fedor Indutny) [#3172](https://github.com/nodejs/node/pull/3172) +* [[`f638402e2f`](https://github.com/nodejs/node/commit/f638402e2f)] - **http**: add comment about `outputSize` in res/server (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`1850879b0e`](https://github.com/nodejs/node/commit/1850879b0e)] - **js_stream**: prevent abort if isalive doesn't exist (Trevor Norris) [#3282](https://github.com/nodejs/node/pull/3282) +* [[`63644dd1cd`](https://github.com/nodejs/node/commit/63644dd1cd)] - **lib**: remove redundant code, add tests in timers.js (Rich Trott) [#3143](https://github.com/nodejs/node/pull/3143) +* [[`74f443583c`](https://github.com/nodejs/node/commit/74f443583c)] - **module**: use UNC paths when loading native addons (Justin Chase) [#2965](https://github.com/nodejs/node/pull/2965) +* [[`01cb3fc36b`](https://github.com/nodejs/node/commit/01cb3fc36b)] - **net**: don't throw on bytesWritten access (Trevor Norris) [#3305](https://github.com/nodejs/node/pull/3305) +* [[`9d65528b01`](https://github.com/nodejs/node/commit/9d65528b01)] - **(SEMVER-MINOR)** **node**: add -c|--check CLI arg to syntax check script (Dave Eddy) [#2411](https://github.com/nodejs/node/pull/2411) +* [[`42b936e78d`](https://github.com/nodejs/node/commit/42b936e78d)] - **(SEMVER-MINOR)** **src**: add process.release.lts property (Rod Vagg) [#3212](https://github.com/nodejs/node/pull/3212) +* [[`589287b2e3`](https://github.com/nodejs/node/commit/589287b2e3)] - **src**: convert BE-utf16-string to LE before search (Karl Skomski) [#3295](https://github.com/nodejs/node/pull/3295) +* [[`2314378f06`](https://github.com/nodejs/node/commit/2314378f06)] - **src**: fix u-a-free if uv returns err in ASYNC_CALL (Karl Skomski) [#3049](https://github.com/nodejs/node/pull/3049) +* [[`d99336a391`](https://github.com/nodejs/node/commit/d99336a391)] - **(SEMVER-MINOR)** **src**: replace naive search in Buffer::IndexOf (Karl Skomski) [#2539](https://github.com/nodejs/node/pull/2539) +* [[`546e8333ba`](https://github.com/nodejs/node/commit/546e8333ba)] - **(SEMVER-MINOR)** **src**: fix --abort-on-uncaught-exception (Jeremy Whitlock) [#3036](https://github.com/nodejs/node/pull/3036) +* [[`7271cb047c`](https://github.com/nodejs/node/commit/7271cb047c)] - **(SEMVER-MINOR)** **src**: add process.versions.icu (Evan Lucas) [#3102](https://github.com/nodejs/node/pull/3102) +* [[`7b9f78acb2`](https://github.com/nodejs/node/commit/7b9f78acb2)] - **stream**: avoid pause with unpipe in buffered write (Brian White) [#2325](https://github.com/nodejs/node/pull/2325) +* [[`f0f8afd879`](https://github.com/nodejs/node/commit/f0f8afd879)] - **test**: remove common.inspect() (Rich Trott) [#3257](https://github.com/nodejs/node/pull/3257) +* [[`5ca4f6f8bd`](https://github.com/nodejs/node/commit/5ca4f6f8bd)] - **test**: test `util` rather than `common` (Rich Trott) [#3256](https://github.com/nodejs/node/pull/3256) +* [[`7a5ae34345`](https://github.com/nodejs/node/commit/7a5ae34345)] - **test**: refresh temp directory when using pipe (Rich Trott) [#3231](https://github.com/nodejs/node/pull/3231) +* [[`7c85557ef0`](https://github.com/nodejs/node/commit/7c85557ef0)] - **test**: Fix test-fs-read-stream-fd-leak race cond (Junliang Yan) [#3218](https://github.com/nodejs/node/pull/3218) +* [[`26a7ec6960`](https://github.com/nodejs/node/commit/26a7ec6960)] - **test**: fix losing original env vars issue (Junliang Yan) [#3190](https://github.com/nodejs/node/pull/3190) +* [[`e922716192`](https://github.com/nodejs/node/commit/e922716192)] - **test**: remove deprecated error logging (Rich Trott) [#3079](https://github.com/nodejs/node/pull/3079) +* [[`8f29d95a8c`](https://github.com/nodejs/node/commit/8f29d95a8c)] - **test**: report timeout in TapReporter (Karl Skomski) [#2647](https://github.com/nodejs/node/pull/2647) +* [[`2d0fe4c657`](https://github.com/nodejs/node/commit/2d0fe4c657)] - **test**: linting for buffer-free-callback test (Rich Trott) [#3230](https://github.com/nodejs/node/pull/3230) +* [[`70c9e4337e`](https://github.com/nodejs/node/commit/70c9e4337e)] - **test**: make common.js mandatory via linting rule (Rich Trott) [#3157](https://github.com/nodejs/node/pull/3157) +* [[`b7179562aa`](https://github.com/nodejs/node/commit/b7179562aa)] - **test**: load common.js in all tests (Rich Trott) [#3157](https://github.com/nodejs/node/pull/3157) +* [[`bab555a1c1`](https://github.com/nodejs/node/commit/bab555a1c1)] - **test**: speed up stringbytes-external test (Evan Lucas) [#3005](https://github.com/nodejs/node/pull/3005) +* [[`ddf258376d`](https://github.com/nodejs/node/commit/ddf258376d)] - **test**: use normalize() for unicode paths (Roman Reiss) [#3007](https://github.com/nodejs/node/pull/3007) +* [[`46876d519c`](https://github.com/nodejs/node/commit/46876d519c)] - **test**: remove arguments.callee usage (Roman Reiss) [#3167](https://github.com/nodejs/node/pull/3167) +* [[`af10df6108`](https://github.com/nodejs/node/commit/af10df6108)] - **tls**: use parent handle's close callback (Fedor Indutny) [#2991](https://github.com/nodejs/node/pull/2991) +* [[`9c2748bad1`](https://github.com/nodejs/node/commit/9c2748bad1)] - **tools**: remove leftover license boilerplate (Nathan Rajlich) [#3225](https://github.com/nodejs/node/pull/3225) +* [[`5d9f83ff2a`](https://github.com/nodejs/node/commit/5d9f83ff2a)] - **tools**: apply linting to custom rules code (Rich Trott) [#3195](https://github.com/nodejs/node/pull/3195) +* [[`18a8b2ec73`](https://github.com/nodejs/node/commit/18a8b2ec73)] - **tools**: remove unused gflags module (Ben Noordhuis) [#3220](https://github.com/nodejs/node/pull/3220) +* [[`e0fffca836`](https://github.com/nodejs/node/commit/e0fffca836)] - **util**: fix for inspecting promises (Evan Lucas) [#3221](https://github.com/nodejs/node/pull/3221) +* [[`8dfdee3733`](https://github.com/nodejs/node/commit/8dfdee3733)] - **util**: correctly inspect Map/Set Iterators (Evan Lucas) [#3119](https://github.com/nodejs/node/pull/3119) +* [[`b5c51fdba0`](https://github.com/nodejs/node/commit/b5c51fdba0)] - **util**: fix check for Array constructor (Evan Lucas) [#3119](https://github.com/nodejs/node/pull/3119) + +## 2015-10-05, Version 4.1.2 (Stable), @rvagg + +### Notable changes + +* **http**: + - Fix out-of-order 'finish' event bug in pipelining that can abort execution, fixes DoS vulnerability [CVE-2015-7384](https://github.com/nodejs/node/issues/3138) (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) + - Account for pending response data instead of just the data on the current request to decide whether pause the socket or not (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* **libuv**: Upgraded from v1.7.4 to v1.7.5, see [release notes](https://github.com/libuv/libuv/releases/tag/v1.7.5) for details (Saúl Ibarra Corretgé) [#3010](https://github.com/nodejs/node/pull/3010) + - A better rwlock implementation for all Windows versions + - Improved AIX support +* **v8**: + - Upgraded from v4.5.103.33 to v4.5.103.35 (Ali Ijaz Sheikh) [#3117](https://github.com/nodejs/node/pull/3117) + - Backported [f782159](https://codereview.chromium.org/1367123003) from v8's upstream to help speed up Promise introspection (Ben Noordhuis) [#3130](https://github.com/nodejs/node/pull/3130) + - Backported [c281c15](https://codereview.chromium.org/1363683002) from v8's upstream to add JSTypedArray length in post-mortem metadata (Julien Gilli) [#3031](https://github.com/nodejs/node/pull/3031) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`39b8730e8b`](https://github.com/nodejs/node/commit/39b8730e8b)] - **async_wrap**: ensure all objects have internal field (Trevor Norris) [#3139](https://github.com/nodejs/node/pull/3139) +* [[`99e66074d7`](https://github.com/nodejs/node/commit/99e66074d7)] - **async_wrap**: update providers and add test (Trevor Norris) [#3139](https://github.com/nodejs/node/pull/3139) +* [[`7a58157d4e`](https://github.com/nodejs/node/commit/7a58157d4e)] - **benchmark**: update comment in common.js (Minwoo Jung) [#2399](https://github.com/nodejs/node/pull/2399) +* [[`9e9bfa4dc0`](https://github.com/nodejs/node/commit/9e9bfa4dc0)] - **build**: iojs -> nodejs of release-urlbase (P.S.V.R) [#3015](https://github.com/nodejs/node/pull/3015) +* [[`8335ec7191`](https://github.com/nodejs/node/commit/8335ec7191)] - **build**: fix some typos inside the configure script (P.S.V.R) [#3016](https://github.com/nodejs/node/pull/3016) +* [[`d6ac547d5d`](https://github.com/nodejs/node/commit/d6ac547d5d)] - **build,win**: fix node.exe resource version (João Reis) [#3053](https://github.com/nodejs/node/pull/3053) +* [[`798dad24f4`](https://github.com/nodejs/node/commit/798dad24f4)] - **child_process**: `null` channel handle on close (Fedor Indutny) [#3041](https://github.com/nodejs/node/pull/3041) +* [[`e5615854ea`](https://github.com/nodejs/node/commit/e5615854ea)] - **contextify**: use CHECK instead of `if` (Oguz Bastemur) [#3125](https://github.com/nodejs/node/pull/3125) +* [[`f055a66a38`](https://github.com/nodejs/node/commit/f055a66a38)] - **crypto**: enable FIPS only when configured with it (Fedor Indutny) [#3153](https://github.com/nodejs/node/pull/3153) +* [[`4c8d96bc30`](https://github.com/nodejs/node/commit/4c8d96bc30)] - **crypto**: add more keylen sanity checks in pbkdf2 (Johann) [#3029](https://github.com/nodejs/node/pull/3029) +* [[`4c5940776c`](https://github.com/nodejs/node/commit/4c5940776c)] - **deps**: upgrade libuv to 1.7.5 (Saúl Ibarra Corretgé) [#3010](https://github.com/nodejs/node/pull/3010) +* [[`5a9e795577`](https://github.com/nodejs/node/commit/5a9e795577)] - **deps**: upgrade V8 to 4.5.103.35 (Ali Ijaz Sheikh) [#3117](https://github.com/nodejs/node/pull/3117) +* [[`925b29f959`](https://github.com/nodejs/node/commit/925b29f959)] - **deps**: backport f782159 from v8's upstream (Ben Noordhuis) [#3130](https://github.com/nodejs/node/pull/3130) +* [[`039f73fa83`](https://github.com/nodejs/node/commit/039f73fa83)] - **deps**: remove and gitignore .bin directory (Ben Noordhuis) [#3004](https://github.com/nodejs/node/pull/3004) +* [[`5fbb24812d`](https://github.com/nodejs/node/commit/5fbb24812d)] - **deps**: backport c281c15 from V8's upstream (Julien Gilli) [#3031](https://github.com/nodejs/node/pull/3031) +* [[`6ee5d0f69f`](https://github.com/nodejs/node/commit/6ee5d0f69f)] - **dns**: add missing exports.BADNAME (Roman Reiss) [#3051](https://github.com/nodejs/node/pull/3051) +* [[`f92aee7170`](https://github.com/nodejs/node/commit/f92aee7170)] - **doc**: fix outdated 'try/catch' statement in sync (Minwoo Jung) [#3087](https://github.com/nodejs/node/pull/3087) +* [[`c7161f39e8`](https://github.com/nodejs/node/commit/c7161f39e8)] - **doc**: add TSC meeting minutes 2015-09-16 (Rod Vagg) [#3023](https://github.com/nodejs/node/pull/3023) +* [[`928166c4a8`](https://github.com/nodejs/node/commit/928166c4a8)] - **doc**: copyedit fs.watch() information (Rich Trott) [#3097](https://github.com/nodejs/node/pull/3097) +* [[`75d5dcea76`](https://github.com/nodejs/node/commit/75d5dcea76)] - **doc**: jenkins-iojs.nodesource.com -> ci.nodejs.org (Michał Gołębiowski) [#2886](https://github.com/nodejs/node/pull/2886) +* [[`5c3f50b21d`](https://github.com/nodejs/node/commit/5c3f50b21d)] - **doc**: rearrange execSync and execFileSync (Laurent Fortin) [#2940](https://github.com/nodejs/node/pull/2940) +* [[`4fc33ac11a`](https://github.com/nodejs/node/commit/4fc33ac11a)] - **doc**: make execFileSync in line with execFile (Laurent Fortin) [#2940](https://github.com/nodejs/node/pull/2940) +* [[`a366e84b17`](https://github.com/nodejs/node/commit/a366e84b17)] - **doc**: fix typos in cluster & errors (reggi) [#3011](https://github.com/nodejs/node/pull/3011) +* [[`52031e1bf1`](https://github.com/nodejs/node/commit/52031e1bf1)] - **doc**: switch LICENSE from closure-linter to eslint (P.S.V.R) [#3018](https://github.com/nodejs/node/pull/3018) +* [[`b28f6a53bc`](https://github.com/nodejs/node/commit/b28f6a53bc)] - **docs**: Clarify assert.doesNotThrow behavior (Fabio Oliveira) [#2807](https://github.com/nodejs/node/pull/2807) +* [[`99943e189d`](https://github.com/nodejs/node/commit/99943e189d)] - **http**: fix out-of-order 'finish' bug in pipelining (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`fb7a491d1c`](https://github.com/nodejs/node/commit/fb7a491d1c)] - **http_server**: pause socket properly (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`a0b35bfcf3`](https://github.com/nodejs/node/commit/a0b35bfcf3)] - **i18n**: add caller to removal list for bidi in ICU55 (Michael Dawson) [#3115](https://github.com/nodejs/node/pull/3115) +* [[`ac2bce0b0c`](https://github.com/nodejs/node/commit/ac2bce0b0c)] - **path**: improve posixSplitPath performance (Evan Lucas) [#3034](https://github.com/nodejs/node/pull/3034) +* [[`37cdeafa2f`](https://github.com/nodejs/node/commit/37cdeafa2f)] - **smalloc**: remove module (Brendan Ashworth) [#3099](https://github.com/nodejs/node/pull/3099) +* [[`5ec5d0aa8b`](https://github.com/nodejs/node/commit/5ec5d0aa8b)] - **src**: internalize binding function property names (Ben Noordhuis) [#3060](https://github.com/nodejs/node/pull/3060) +* [[`c8175fc2af`](https://github.com/nodejs/node/commit/c8175fc2af)] - **src**: internalize per-isolate string properties (Ben Noordhuis) [#3060](https://github.com/nodejs/node/pull/3060) +* [[`9a593abc47`](https://github.com/nodejs/node/commit/9a593abc47)] - **src**: include signal.h in util.h (Cheng Zhao) [#3058](https://github.com/nodejs/node/pull/3058) +* [[`fde0c6f321`](https://github.com/nodejs/node/commit/fde0c6f321)] - **src**: fix function and variable names in comments (Sakthipriyan Vairamani) [#3039](https://github.com/nodejs/node/pull/3039) +* [[`1cc7b41ba4`](https://github.com/nodejs/node/commit/1cc7b41ba4)] - **stream_wrap**: support empty `TryWrite`s (Fedor Indutny) [#3128](https://github.com/nodejs/node/pull/3128) +* [[`9faf4c6fcf`](https://github.com/nodejs/node/commit/9faf4c6fcf)] - **test**: load common.js to test for global leaks (Rich Trott) [#3095](https://github.com/nodejs/node/pull/3095) +* [[`0858c86374`](https://github.com/nodejs/node/commit/0858c86374)] - **test**: fix invalid variable name (Sakthipriyan Vairamani) [#3150](https://github.com/nodejs/node/pull/3150) +* [[`1167171004`](https://github.com/nodejs/node/commit/1167171004)] - **test**: change calls to deprecated util.print() (Rich Trott) [#3083](https://github.com/nodejs/node/pull/3083) +* [[`5ada45bf28`](https://github.com/nodejs/node/commit/5ada45bf28)] - **test**: replace deprecated util.debug() calls (Rich Trott) [#3082](https://github.com/nodejs/node/pull/3082) +* [[`d8ab4e185d`](https://github.com/nodejs/node/commit/d8ab4e185d)] - **util**: optimize promise introspection (Ben Noordhuis) [#3130](https://github.com/nodejs/node/pull/3130) + +## 2015-09-22, Version 4.1.1 (Stable), @rvagg + +### Notable changes + +* **buffer**: Fixed a bug introduced in v4.1.0 where allocating a new zero-length buffer can result in the _next_ allocation of a TypedArray in JavaScript not being zero-filled. In certain circumstances this could result in data leakage via reuse of memory space in TypedArrays, breaking the normally safe assumption that TypedArrays should be always zero-filled. (Trevor Norris) [#2931](https://github.com/nodejs/node/pull/2931). +* **http**: Guard against response-splitting of HTTP trailing headers added via [`response.addTrailers()`](https://nodejs.org/api/http.html#http_response_addtrailers_headers) by removing new-line (`[\r\n]`) characters from values. Note that standard header values are already stripped of new-line characters. The expected security impact is low because trailing headers are rarely used. (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945). +* **npm**: Upgrade to npm 2.14.4 from 2.14.3, see [release notes](https://github.com/npm/npm/releases/tag/v2.14.4) for full details (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958) + - Upgrades `graceful-fs` on multiple dependencies to no longer rely on monkey-patching `fs` + - Fix `npm link` for pre-release / RC builds of Node +* **v8**: Update post-mortem metadata to allow post-mortem debugging tools to find and inspect: + - JavaScript objects that use dictionary properties (Julien Gilli) [#2959](https://github.com/nodejs/node/pull/2959) + - ScopeInfo and thus closures (Julien Gilli) [#2974](https://github.com/nodejs/node/pull/2974) + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`d63e02e08d`](https://github.com/nodejs/node/commit/d63e02e08d)] - **buffer**: don't set zero fill for zero-length buffer (Trevor Norris) [#2931](https://github.com/nodejs/node/pull/2931) +* [[`5905b14bff`](https://github.com/nodejs/node/commit/5905b14bff)] - **build**: fix icutrim when building small-icu on BE (Stewart Addison) [#2602](https://github.com/nodejs/node/pull/2602) +* [[`f010cb5d96`](https://github.com/nodejs/node/commit/f010cb5d96)] - **configure**: detect mipsel host (Jérémy Lal) [#2971](https://github.com/nodejs/node/pull/2971) +* [[`b93ad5abbd`](https://github.com/nodejs/node/commit/b93ad5abbd)] - **deps**: backport 357e6b9 from V8's upstream (Julien Gilli) [#2974](https://github.com/nodejs/node/pull/2974) +* [[`8da3da4d41`](https://github.com/nodejs/node/commit/8da3da4d41)] - **deps**: backport ff7d70b from V8's upstream (Julien Gilli) [#2959](https://github.com/nodejs/node/pull/2959) +* [[`2600fb8ae6`](https://github.com/nodejs/node/commit/2600fb8ae6)] - **deps**: upgraded to node-gyp@3.0.3 in npm (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958) +* [[`793aad2d7a`](https://github.com/nodejs/node/commit/793aad2d7a)] - **deps**: upgrade to npm 2.14.4 (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958) +* [[`43e2b7f836`](https://github.com/nodejs/node/commit/43e2b7f836)] - **doc**: remove usage of events.EventEmitter (Sakthipriyan Vairamani) [#2921](https://github.com/nodejs/node/pull/2921) +* [[`9c59d2f16a`](https://github.com/nodejs/node/commit/9c59d2f16a)] - **doc**: remove extra using v8::HandleScope statement (Christopher J. Brody) [#2983](https://github.com/nodejs/node/pull/2983) +* [[`f7edbab367`](https://github.com/nodejs/node/commit/f7edbab367)] - **doc**: clarify description of assert.ifError() (Rich Trott) [#2941](https://github.com/nodejs/node/pull/2941) +* [[`b2ddf0f9a2`](https://github.com/nodejs/node/commit/b2ddf0f9a2)] - **doc**: refine process.kill() and exit explanations (Rich Trott) [#2918](https://github.com/nodejs/node/pull/2918) +* [[`f68fed2e6f`](https://github.com/nodejs/node/commit/f68fed2e6f)] - **http**: remove redundant code in _deferToConnect (Malcolm Ahoy) [#2769](https://github.com/nodejs/node/pull/2769) +* [[`f542e74c93`](https://github.com/nodejs/node/commit/f542e74c93)] - **http**: guard against response splitting in trailers (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945) +* [[`bc9f629387`](https://github.com/nodejs/node/commit/bc9f629387)] - **http_parser**: do not dealloc during kOnExecute (Fedor Indutny) [#2956](https://github.com/nodejs/node/pull/2956) +* [[`1860e0cebd`](https://github.com/nodejs/node/commit/1860e0cebd)] - **lib,src**: remove usage of events.EventEmitter (Sakthipriyan Vairamani) [#2921](https://github.com/nodejs/node/pull/2921) +* [[`d4cd5ac407`](https://github.com/nodejs/node/commit/d4cd5ac407)] - **readline**: fix tab completion bug (Matt Harrison) [#2816](https://github.com/nodejs/node/pull/2816) +* [[`9760e04839`](https://github.com/nodejs/node/commit/9760e04839)] - **repl**: don't use tty control codes when $TERM is set to "dumb" (Salman Aljammaz) [#2712](https://github.com/nodejs/node/pull/2712) +* [[`cb971cc97d`](https://github.com/nodejs/node/commit/cb971cc97d)] - **repl**: backslash bug fix (Sakthipriyan Vairamani) [#2968](https://github.com/nodejs/node/pull/2968) +* [[`2034f68668`](https://github.com/nodejs/node/commit/2034f68668)] - **src**: honor --abort_on_uncaught_exception flag (Evan Lucas) [#2776](https://github.com/nodejs/node/pull/2776) +* [[`0b1ca4a9ef`](https://github.com/nodejs/node/commit/0b1ca4a9ef)] - **src**: Add ABORT macro (Evan Lucas) [#2776](https://github.com/nodejs/node/pull/2776) +* [[`4519dd00f9`](https://github.com/nodejs/node/commit/4519dd00f9)] - **test**: test sync version of mkdir & rmdir (Sakthipriyan Vairamani) [#2588](https://github.com/nodejs/node/pull/2588) +* [[`816f609c8b`](https://github.com/nodejs/node/commit/816f609c8b)] - **test**: use tmpDir instead of fixtures in readdir (Sakthipriyan Vairamani) [#2587](https://github.com/nodejs/node/pull/2587) +* [[`2084f52585`](https://github.com/nodejs/node/commit/2084f52585)] - **test**: test more http response splitting scenarios (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945) +* [[`fa08d1d8a1`](https://github.com/nodejs/node/commit/fa08d1d8a1)] - **test**: add test-spawn-cmd-named-pipe (Alexis Campailla) [#2770](https://github.com/nodejs/node/pull/2770) +* [[`71b5d80682`](https://github.com/nodejs/node/commit/71b5d80682)] - **test**: make cluster tests more time tolerant (Michael Dawson) [#2891](https://github.com/nodejs/node/pull/2891) +* [[`3e09dcfc32`](https://github.com/nodejs/node/commit/3e09dcfc32)] - **test**: update cwd-enoent tests for AIX (Imran Iqbal) [#2909](https://github.com/nodejs/node/pull/2909) +* [[`6ea8ec1c59`](https://github.com/nodejs/node/commit/6ea8ec1c59)] - **tools**: single, cross-platform tick processor (Matt Loring) [#2868](https://github.com/nodejs/node/pull/2868) + +## 2015-09-17, Version 4.1.0 (Stable), @Fishrock123 + +### Notable changes + +* **buffer**: + - Buffers are now created in JavaScript, rather than C++. This increases the speed of buffer creation (Trevor Norris) [#2866](https://github.com/nodejs/node/pull/2866). + - `Buffer#slice()` now uses `Uint8Array#subarray()` internally, increasing `slice()` performance (Karl Skomski) [#2777](https://github.com/nodejs/node/pull/2777). +* **fs**: + - `fs.utimes()` now properly converts numeric strings, `NaN`, and `Infinity` (Yazhong Liu) [#2387](https://github.com/nodejs/node/pull/2387). + - `fs.WriteStream` now implements `_writev`, allowing for super-fast bulk writes (Ron Korving) [#2167](https://github.com/nodejs/node/pull/2167). +* **http**: Fixed an issue with certain `write()` sizes causing errors when using `http.request()` (Fedor Indutny) [#2824](https://github.com/nodejs/node/pull/2824). +* **npm**: Upgrade to version 2.14.3, see https://github.com/npm/npm/releases/tag/v2.14.3 for more details (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822). +* **src**: V8 cpu profiling no longer erroneously shows idle time (Oleksandr Chekhovskyi) [#2324](https://github.com/nodejs/node/pull/2324). +* **timers**: `#ref()` and `#unref()` now return the timer they belong to (Sam Roberts) [#2905](https://github.com/nodejs/node/pull/2905). +* **v8**: Lateral upgrade to 4.5.103.33 from 4.5.103.30, contains minor fixes (Ali Ijaz Sheikh) [#2870](https://github.com/nodejs/node/pull/2870). + - This fixes a previously known bug where some computed object shorthand properties did not work correctly ([#2507](https://github.com/nodejs/node/issues/2507)). + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`b1abe812cd`](https://github.com/nodejs/node/commit/b1abe812cd)] - Working on 4.0.1 (Rod Vagg) +* [[`f9f8378853`](https://github.com/nodejs/node/commit/f9f8378853)] - 2015-09-08, Version 4.0.0 (Stable) Release (Rod Vagg) +* [[`9683e5df51`](https://github.com/nodejs/node/commit/9683e5df51)] - **bindings**: close after reading module struct (Fedor Indutny) [#2792](https://github.com/nodejs/node/pull/2792) +* [[`4b4cfa2d44`](https://github.com/nodejs/node/commit/4b4cfa2d44)] - **buffer**: always allocate typed arrays outside heap (Trevor Norris) [#2893](https://github.com/nodejs/node/pull/2893) +* [[`7df018a29b`](https://github.com/nodejs/node/commit/7df018a29b)] - **buffer**: construct Uint8Array in JS (Trevor Norris) [#2866](https://github.com/nodejs/node/pull/2866) +* [[`43397b204e`](https://github.com/nodejs/node/commit/43397b204e)] - **(SEMVER-MINOR)** **build**: Updates to enable AIX support (Michael Dawson) [#2364](https://github.com/nodejs/node/pull/2364) +* [[`e35b1fd610`](https://github.com/nodejs/node/commit/e35b1fd610)] - **build**: clean up the generated tap file (Sakthipriyan Vairamani) [#2837](https://github.com/nodejs/node/pull/2837) +* [[`96670ebe37`](https://github.com/nodejs/node/commit/96670ebe37)] - **deps**: backport 6d32be2 from v8's upstream (Michaël Zasso) [#2916](https://github.com/nodejs/node/pull/2916) +* [[`94972d5b13`](https://github.com/nodejs/node/commit/94972d5b13)] - **deps**: backport 0d01728 from v8's upstream (Fedor Indutny) [#2912](https://github.com/nodejs/node/pull/2912) +* [[`7ebd881c29`](https://github.com/nodejs/node/commit/7ebd881c29)] - **deps**: upgrade V8 to 4.5.103.33 (Ali Ijaz Sheikh) [#2870](https://github.com/nodejs/node/pull/2870) +* [[`ed47ab6e44`](https://github.com/nodejs/node/commit/ed47ab6e44)] - **deps**: upgraded to node-gyp@3.0.3 in npm (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822) +* [[`f4641ae875`](https://github.com/nodejs/node/commit/f4641ae875)] - **deps**: upgrade to npm 2.14.3 (Kat Marchán) [#2822](https://github.com/nodejs/node/pull/2822) +* [[`8119693a3d`](https://github.com/nodejs/node/commit/8119693a3d)] - **deps**: update libuv to version 1.7.4 (Saúl Ibarra Corretgé) [#2817](https://github.com/nodejs/node/pull/2817) +* [[`6098504685`](https://github.com/nodejs/node/commit/6098504685)] - **deps**: cherry-pick 6da51b4 from v8's upstream (Fedor Indutny) [#2801](https://github.com/nodejs/node/pull/2801) +* [[`bf42cc8dba`](https://github.com/nodejs/node/commit/bf42cc8dba)] - **doc**: process exit event is not guaranteed to fire (Rich Trott) [#2861](https://github.com/nodejs/node/pull/2861) +* [[`bb0f869f67`](https://github.com/nodejs/node/commit/bb0f869f67)] - **doc**: remove incorrect reference to TCP in net docs (Sam Roberts) [#2903](https://github.com/nodejs/node/pull/2903) +* [[`302d59dce8`](https://github.com/nodejs/node/commit/302d59dce8)] - **doc**: correct buffer.slice arg syntax (Sam Roberts) [#2903](https://github.com/nodejs/node/pull/2903) +* [[`74db9637b7`](https://github.com/nodejs/node/commit/74db9637b7)] - **doc**: describe spawn option.detached (Sam Roberts) [#2903](https://github.com/nodejs/node/pull/2903) +* [[`a7bd897273`](https://github.com/nodejs/node/commit/a7bd897273)] - **doc**: rename from iojs(1) to node(1) in benchmarks (Dmitry Vasilyev) [#2884](https://github.com/nodejs/node/pull/2884) +* [[`cd643d7c37`](https://github.com/nodejs/node/commit/cd643d7c37)] - **doc**: add missing backtick in buffer.markdown (Sven Slootweg) [#2881](https://github.com/nodejs/node/pull/2881) +* [[`e8a206e802`](https://github.com/nodejs/node/commit/e8a206e802)] - **doc**: fix broken link in repl.markdown (Danny Nemer) [#2827](https://github.com/nodejs/node/pull/2827) +* [[`7ee36d61f7`](https://github.com/nodejs/node/commit/7ee36d61f7)] - **doc**: fix typos in README (Ionică Bizău) [#2852](https://github.com/nodejs/node/pull/2852) +* [[`4d1ae26196`](https://github.com/nodejs/node/commit/4d1ae26196)] - **doc**: add tunniclm as a collaborator (Mike Tunnicliffe) [#2826](https://github.com/nodejs/node/pull/2826) +* [[`2d77d03643`](https://github.com/nodejs/node/commit/2d77d03643)] - **doc**: fix two doc errors in stream and process (Jeremiah Senkpiel) [#2549](https://github.com/nodejs/node/pull/2549) +* [[`55ac24f721`](https://github.com/nodejs/node/commit/55ac24f721)] - **doc**: fixed io.js references in process.markdown (Tristian Flanagan) [#2846](https://github.com/nodejs/node/pull/2846) +* [[`cd1297fb57`](https://github.com/nodejs/node/commit/cd1297fb57)] - **doc**: use "Calls" over "Executes" for consistency (Minwoo Jung) [#2800](https://github.com/nodejs/node/pull/2800) +* [[`d664b95581`](https://github.com/nodejs/node/commit/d664b95581)] - **doc**: use US English for consistency (Anne-Gaelle Colom) [#2784](https://github.com/nodejs/node/pull/2784) +* [[`82ba1839fb`](https://github.com/nodejs/node/commit/82ba1839fb)] - **doc**: use 3rd person singular for consistency (Anne-Gaelle Colom) [#2765](https://github.com/nodejs/node/pull/2765) +* [[`432cce6e95`](https://github.com/nodejs/node/commit/432cce6e95)] - **doc**: describe process API for IPC (Sam Roberts) [#1978](https://github.com/nodejs/node/pull/1978) +* [[`1d75012b9d`](https://github.com/nodejs/node/commit/1d75012b9d)] - **doc**: fix comma splice in Assertion Testing doc (Rich Trott) [#2728](https://github.com/nodejs/node/pull/2728) +* [[`6108ea9bb4`](https://github.com/nodejs/node/commit/6108ea9bb4)] - **fs**: consider NaN/Infinity in toUnixTimestamp (Yazhong Liu) [#2387](https://github.com/nodejs/node/pull/2387) +* [[`2b6aa9415f`](https://github.com/nodejs/node/commit/2b6aa9415f)] - **(SEMVER-MINOR)** **fs**: implemented WriteStream#writev (Ron Korving) [#2167](https://github.com/nodejs/node/pull/2167) +* [[`431bf74c55`](https://github.com/nodejs/node/commit/431bf74c55)] - **http**: default Agent.getName to 'localhost' (Malcolm Ahoy) [#2825](https://github.com/nodejs/node/pull/2825) +* [[`ea15d71c16`](https://github.com/nodejs/node/commit/ea15d71c16)] - **http_server**: fix resume after socket close (Fedor Indutny) [#2824](https://github.com/nodejs/node/pull/2824) +* [[`8e5843405b`](https://github.com/nodejs/node/commit/8e5843405b)] - **src**: null env_ field from constructor (Trevor Norris) [#2913](https://github.com/nodejs/node/pull/2913) +* [[`0a5f80a11f`](https://github.com/nodejs/node/commit/0a5f80a11f)] - **src**: use subarray() in Buffer#slice() for speedup (Karl Skomski) [#2777](https://github.com/nodejs/node/pull/2777) +* [[`57707e2490`](https://github.com/nodejs/node/commit/57707e2490)] - **src**: use ZCtxt as a source for v8::Isolates (Roman Klauke) [#2547](https://github.com/nodejs/node/pull/2547) +* [[`b0df2273ab`](https://github.com/nodejs/node/commit/b0df2273ab)] - **src**: fix v8::CpuProfiler idle sampling (Oleksandr Chekhovskyi) [#2324](https://github.com/nodejs/node/pull/2324) +* [[`eaa8e60b91`](https://github.com/nodejs/node/commit/eaa8e60b91)] - **streams**: refactor LazyTransform to internal/ (Brendan Ashworth) [#2566](https://github.com/nodejs/node/pull/2566) +* [[`648c003e14`](https://github.com/nodejs/node/commit/648c003e14)] - **test**: use tmp directory in chdir test (Sakthipriyan Vairamani) [#2589](https://github.com/nodejs/node/pull/2589) +* [[`079a2173d4`](https://github.com/nodejs/node/commit/079a2173d4)] - **test**: fix Buffer OOM error message (Trevor Norris) [#2915](https://github.com/nodejs/node/pull/2915) +* [[`52019a1b21`](https://github.com/nodejs/node/commit/52019a1b21)] - **test**: fix default value for additional param (Sakthipriyan Vairamani) [#2553](https://github.com/nodejs/node/pull/2553) +* [[`5df5d0423a`](https://github.com/nodejs/node/commit/5df5d0423a)] - **test**: remove disabled test (Rich Trott) [#2841](https://github.com/nodejs/node/pull/2841) +* [[`9e5f0995bd`](https://github.com/nodejs/node/commit/9e5f0995bd)] - **test**: split up internet dns tests (Rich Trott) [#2802](https://github.com/nodejs/node/pull/2802) +* [[`41f2dde51a`](https://github.com/nodejs/node/commit/41f2dde51a)] - **test**: increase dgram timeout for armv6 (Rich Trott) [#2808](https://github.com/nodejs/node/pull/2808) +* [[`6e2fe1c21a`](https://github.com/nodejs/node/commit/6e2fe1c21a)] - **test**: remove valid hostname check in test-dns.js (Rich Trott) [#2785](https://github.com/nodejs/node/pull/2785) +* [[`779e14f1a7`](https://github.com/nodejs/node/commit/779e14f1a7)] - **test**: expect error for test_lookup_ipv6_hint on FreeBSD (Rich Trott) [#2724](https://github.com/nodejs/node/pull/2724) +* [[`f931b9dd95`](https://github.com/nodejs/node/commit/f931b9dd95)] - **(SEMVER-MINOR)** **timer**: ref/unref return self (Sam Roberts) [#2905](https://github.com/nodejs/node/pull/2905) +* [[`59d03738cc`](https://github.com/nodejs/node/commit/59d03738cc)] - **tools**: enable arrow functions in .eslintrc (Sakthipriyan Vairamani) [#2840](https://github.com/nodejs/node/pull/2840) +* [[`69e7b875a2`](https://github.com/nodejs/node/commit/69e7b875a2)] - **tools**: open `test.tap` file in write-binary mode (Sakthipriyan Vairamani) [#2837](https://github.com/nodejs/node/pull/2837) +* [[`ff6d30d784`](https://github.com/nodejs/node/commit/ff6d30d784)] - **tools**: add missing tick processor polyfill (Matt Loring) [#2694](https://github.com/nodejs/node/pull/2694) +* [[`519caba021`](https://github.com/nodejs/node/commit/519caba021)] - **tools**: fix flakiness in test-tick-processor (Matt Loring) [#2694](https://github.com/nodejs/node/pull/2694) +* [[`ac004b8555`](https://github.com/nodejs/node/commit/ac004b8555)] - **tools**: remove hyphen in TAP result (Sakthipriyan Vairamani) [#2718](https://github.com/nodejs/node/pull/2718) +* [[`ba47511976`](https://github.com/nodejs/node/commit/ba47511976)] - **tsc**: adjust TSC membership for IBM+StrongLoop (James M Snell) [#2858](https://github.com/nodejs/node/pull/2858) +* [[`e035266805`](https://github.com/nodejs/node/commit/e035266805)] - **win,msi**: fix documentation shortcut url (Brian White) [#2781](https://github.com/nodejs/node/pull/2781) + +## 2015-09-08, Version 4.0.0 (Stable), @rvagg + +### Notable changes + +This list of changes is relative to the last io.js v3.x branch release, v3.3.0. Please see the list of notable changes in the v3.x, v2.x and v1.x releases for a more complete list of changes from 0.12.x. Note, that some changes in the v3.x series as well as major breaking changes in this release constitute changes required for full convergence of the Node.js and io.js projects. + +* **child_process**: `ChildProcess.prototype.send()` and `process.send()` operate asynchronously across all platforms so an optional callback parameter has been introduced that will be invoked once the message has been sent, i.e. `.send(message[, sendHandle][, callback])` (Ben Noordhuis) [#2620](https://github.com/nodejs/node/pull/2620). +* **node**: Rename "io.js" code to "Node.js" (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367). +* **node-gyp**: This release bundles an updated version of node-gyp that works with all versions of Node.js and io.js including nightly and release candidate builds. From io.js v3 and Node.js v4 onward, it will only download a headers tarball when building addons rather than the entire source. (Rod Vagg) [#2700](https://github.com/nodejs/node/pull/2700) +* **npm**: Upgrade to version 2.14.2 from 2.13.3, includes a security update, see https://github.com/npm/npm/releases/tag/v2.14.2 for more details, (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696). +* **timers**: Improved timer performance from porting the 0.12 implementation, plus minor fixes (Jeremiah Senkpiel) [#2540](https://github.com/nodejs/node/pull/2540), (Julien Gilli) [nodejs/node-v0.x-archive#8751](https://github.com/nodejs/node-v0.x-archive/pull/8751) [nodejs/node-v0.x-archive#8905](https://github.com/nodejs/node-v0.x-archive/pull/8905) +* **util**: The `util.is*()` functions have been deprecated, beginning with deprecation warnings in the documentation for this release, users are encouraged to seek more robust alternatives in the npm registry, (Sakthipriyan Vairamani) [#2447](https://github.com/nodejs/node/pull/2447). +* **v8**: Upgrade to version 4.5.103.30 from 4.4.63.30 (Ali Ijaz Sheikh) [#2632](https://github.com/nodejs/node/pull/2632). + - Implement new `TypedArray` prototype methods: `copyWithin()`, `every()`, `fill()`, `filter()`, `find()`, `findIndex()`, `forEach()`, `indexOf()`, `join()`, `lastIndexOf()`, `map()`, `reduce()`, `reduceRight()`, `reverse()`, `slice()`, `some()`, `sort()`. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. + - Implement new `TypedArray.from()` and `TypedArray.of()` functions. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray for further information. + - Implement arrow functions, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions for further information. + - Full ChangeLog available at https://github.com/v8/v8-git-mirror/blob/4.5.103/ChangeLog + +### Known issues + +See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues. + +* Some uses of computed object shorthand properties are not handled correctly by the current version of V8. e.g. `[{ [prop]: val }]` evaluates to `[{}]`. [#2507](https://github.com/nodejs/node/issues/2507) +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264). +* 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 + +* [[`4f50d3fb90`](https://github.com/nodejs/node/commit/4f50d3fb90)] - **(SEMVER-MAJOR)** This commit sets the value of process.release.name to "node". (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`d3178d8b1b`](https://github.com/nodejs/node/commit/d3178d8b1b)] - **buffer**: SlowBuffer only accept valid numeric values (Michaël Zasso) [#2635](https://github.com/nodejs/node/pull/2635) +* [[`0cb0f4a6e4`](https://github.com/nodejs/node/commit/0cb0f4a6e4)] - **build**: fix v8_enable_handle_zapping override (Karl Skomski) [#2731](https://github.com/nodejs/node/pull/2731) +* [[`a7596d7efc`](https://github.com/nodejs/node/commit/a7596d7efc)] - **build**: remote commands on staging in single session (Rod Vagg) [#2717](https://github.com/nodejs/node/pull/2717) +* [[`be427e9efa`](https://github.com/nodejs/node/commit/be427e9efa)] - **build**: make .msi install to "nodejs", not "node" (Rod Vagg) [#2701](https://github.com/nodejs/node/pull/2701) +* [[`5652ce0dbc`](https://github.com/nodejs/node/commit/5652ce0dbc)] - **build**: fix .pkg creation tooling (Rod Vagg) [#2687](https://github.com/nodejs/node/pull/2687) +* [[`101db80111`](https://github.com/nodejs/node/commit/101db80111)] - **build**: add --enable-asan with builtin leakcheck (Karl Skomski) [#2376](https://github.com/nodejs/node/pull/2376) +* [[`2c3939c9c0`](https://github.com/nodejs/node/commit/2c3939c9c0)] - **child_process**: use stdio.fd even if it is 0 (Evan Lucas) [#2727](https://github.com/nodejs/node/pull/2727) +* [[`609db5a1dd`](https://github.com/nodejs/node/commit/609db5a1dd)] - **child_process**: check execFile and fork args (James M Snell) [#2667](https://github.com/nodejs/node/pull/2667) +* [[`d010568c23`](https://github.com/nodejs/node/commit/d010568c23)] - **(SEMVER-MAJOR)** **child_process**: add callback parameter to .send() (Ben Noordhuis) [#2620](https://github.com/nodejs/node/pull/2620) +* [[`c60857a81a`](https://github.com/nodejs/node/commit/c60857a81a)] - **cluster**: allow shared reused dgram sockets (Fedor Indutny) [#2548](https://github.com/nodejs/node/pull/2548) +* [[`b2ecbb6191`](https://github.com/nodejs/node/commit/b2ecbb6191)] - **contextify**: ignore getters during initialization (Fedor Indutny) [#2091](https://github.com/nodejs/node/pull/2091) +* [[`3711934095`](https://github.com/nodejs/node/commit/3711934095)] - **cpplint**: make it possible to run outside git repo (Ben Noordhuis) [#2710](https://github.com/nodejs/node/pull/2710) +* [[`03f900ab25`](https://github.com/nodejs/node/commit/03f900ab25)] - **crypto**: replace rwlocks with simple mutexes (Ben Noordhuis) [#2723](https://github.com/nodejs/node/pull/2723) +* [[`847459c29b`](https://github.com/nodejs/node/commit/847459c29b)] - **(SEMVER-MAJOR)** **crypto**: show exponent in decimal and hex (Chad Johnston) [#2320](https://github.com/nodejs/node/pull/2320) +* [[`e1c976184d`](https://github.com/nodejs/node/commit/e1c976184d)] - **deps**: improve ArrayBuffer performance in v8 (Fedor Indutny) [#2732](https://github.com/nodejs/node/pull/2732) +* [[`cc0ab17a23`](https://github.com/nodejs/node/commit/cc0ab17a23)] - **deps**: float node-gyp v3.0.0 (Rod Vagg) [#2700](https://github.com/nodejs/node/pull/2700) +* [[`b2c3c6d727`](https://github.com/nodejs/node/commit/b2c3c6d727)] - **deps**: create .npmrc during npm tests (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696) +* [[`babdbfdbd5`](https://github.com/nodejs/node/commit/babdbfdbd5)] - **deps**: upgrade to npm 2.14.2 (Kat Marchán) [#2696](https://github.com/nodejs/node/pull/2696) +* [[`155783d876`](https://github.com/nodejs/node/commit/155783d876)] - **deps**: backport 75e43a6 from v8 upstream (again) (saper) [#2692](https://github.com/nodejs/node/pull/2692) +* [[`5424d6fcf0`](https://github.com/nodejs/node/commit/5424d6fcf0)] - **deps**: upgrade V8 to 4.5.103.30 (Ali Ijaz Sheikh) [#2632](https://github.com/nodejs/node/pull/2632) +* [[`c43172578e`](https://github.com/nodejs/node/commit/c43172578e)] - **(SEMVER-MAJOR)** **deps**: upgrade V8 to 4.5.103.24 (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`714e96e8b9`](https://github.com/nodejs/node/commit/714e96e8b9)] - **deps**: backport 75e43a6 from v8 upstream (saper) [#2636](https://github.com/nodejs/node/pull/2636) +* [[`8637755cbf`](https://github.com/nodejs/node/commit/8637755cbf)] - **doc**: add TSC meeting minutes 2015-09-02 (Rod Vagg) [#2674](https://github.com/nodejs/node/pull/2674) +* [[`d3d5b93214`](https://github.com/nodejs/node/commit/d3d5b93214)] - **doc**: update environment vars in manpage and --help (Roman Reiss) [#2690](https://github.com/nodejs/node/pull/2690) +* [[`29f586ac0a`](https://github.com/nodejs/node/commit/29f586ac0a)] - **doc**: update url doc to account for escaping (Jeremiah Senkpiel) [#2605](https://github.com/nodejs/node/pull/2605) +* [[`ba50cfebef`](https://github.com/nodejs/node/commit/ba50cfebef)] - **doc**: reorder collaborators by their usernames (Johan Bergström) [#2322](https://github.com/nodejs/node/pull/2322) +* [[`8a9a3bf798`](https://github.com/nodejs/node/commit/8a9a3bf798)] - **doc**: update changelog for io.js v3.3.0 (Rod Vagg) [#2653](https://github.com/nodejs/node/pull/2653) +* [[`6cd0e2664b`](https://github.com/nodejs/node/commit/6cd0e2664b)] - **doc**: update io.js reference (Ben Noordhuis) [#2580](https://github.com/nodejs/node/pull/2580) +* [[`f9539c19e8`](https://github.com/nodejs/node/commit/f9539c19e8)] - **doc**: update changelog for io.js v3.2.0 (Rod Vagg) [#2512](https://github.com/nodejs/node/pull/2512) +* [[`cded6e7993`](https://github.com/nodejs/node/commit/cded6e7993)] - **doc**: fix CHANGELOG.md on master (Roman Reiss) [#2513](https://github.com/nodejs/node/pull/2513) +* [[`93e2830686`](https://github.com/nodejs/node/commit/93e2830686)] - **(SEMVER-MINOR)** **doc**: document deprecation of util.is* functions (Sakthipriyan Vairamani) [#2447](https://github.com/nodejs/node/pull/2447) +* [[`7038388558`](https://github.com/nodejs/node/commit/7038388558)] - **doc,test**: enable recursive file watching in Windows (Sakthipriyan Vairamani) [#2649](https://github.com/nodejs/node/pull/2649) +* [[`f3696f64a1`](https://github.com/nodejs/node/commit/f3696f64a1)] - **events,lib**: don't require EE#listenerCount() (Jeremiah Senkpiel) [#2661](https://github.com/nodejs/node/pull/2661) +* [[`45a2046f5d`](https://github.com/nodejs/node/commit/45a2046f5d)] - **(SEMVER-MAJOR)** **installer**: fix installers for node.js rename (Frederic Hemberger) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`7a999a1376`](https://github.com/nodejs/node/commit/7a999a1376)] - **(SEMVER-MAJOR)** **lib**: add net.Socket#localFamily property (Ben Noordhuis) [#956](https://github.com/nodejs/node/pull/956) +* [[`de88255b0f`](https://github.com/nodejs/node/commit/de88255b0f)] - ***Revert*** "**lib,src**: add unix socket getsockname/getpeername" (Ben Noordhuis) [#2584](https://github.com/nodejs/node/pull/2584) +* [[`f337595441`](https://github.com/nodejs/node/commit/f337595441)] - **(SEMVER-MAJOR)** **lib,src**: add unix socket getsockname/getpeername (Ben Noordhuis) [#956](https://github.com/nodejs/node/pull/956) +* [[`3b602527d1`](https://github.com/nodejs/node/commit/3b602527d1)] - **(SEMVER-MAJOR)** **node**: additional cleanup for node rename (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`a69ab27ab4`](https://github.com/nodejs/node/commit/a69ab27ab4)] - **(SEMVER-MAJOR)** **node**: rename from io.js to node (cjihrig) [#2367](https://github.com/nodejs/node/pull/2367) +* [[`9358eee9dd`](https://github.com/nodejs/node/commit/9358eee9dd)] - **node-gyp**: float 3.0.1, minor fix for download url (Rod Vagg) [#2737](https://github.com/nodejs/node/pull/2737) +* [[`d2d981252b`](https://github.com/nodejs/node/commit/d2d981252b)] - **src**: s/ia32/x86 for process.release.libUrl for win (Rod Vagg) [#2699](https://github.com/nodejs/node/pull/2699) +* [[`eba3d3dccd`](https://github.com/nodejs/node/commit/eba3d3dccd)] - **src**: use standard conform snprintf on windows (Karl Skomski) [#2404](https://github.com/nodejs/node/pull/2404) +* [[`cddbec231f`](https://github.com/nodejs/node/commit/cddbec231f)] - **src**: fix buffer overflow for long exception lines (Karl Skomski) [#2404](https://github.com/nodejs/node/pull/2404) +* [[`dd3f3417c7`](https://github.com/nodejs/node/commit/dd3f3417c7)] - **src**: re-enable fast math on arm (Michaël Zasso) [#2592](https://github.com/nodejs/node/pull/2592) +* [[`e137c1177c`](https://github.com/nodejs/node/commit/e137c1177c)] - **(SEMVER-MAJOR)** **src**: enable vector ics on arm again (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`7ce749d722`](https://github.com/nodejs/node/commit/7ce749d722)] - **src**: replace usage of v8::Handle with v8::Local (Michaël Zasso) [#2202](https://github.com/nodejs/node/pull/2202) +* [[`b1a2d9509f`](https://github.com/nodejs/node/commit/b1a2d9509f)] - **src**: enable v8 deprecation warnings and fix them (Ben Noordhuis) [#2091](https://github.com/nodejs/node/pull/2091) +* [[`808de0da03`](https://github.com/nodejs/node/commit/808de0da03)] - **(SEMVER-MAJOR)** **src**: apply debug force load fixups from 41e63fb (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`5201cb0ff1`](https://github.com/nodejs/node/commit/5201cb0ff1)] - **src**: fix memory leak in ExternString (Karl Skomski) [#2402](https://github.com/nodejs/node/pull/2402) +* [[`2308a27c0a`](https://github.com/nodejs/node/commit/2308a27c0a)] - **src**: only set v8 flags if argc > 1 (Evan Lucas) [#2646](https://github.com/nodejs/node/pull/2646) +* [[`384effed20`](https://github.com/nodejs/node/commit/384effed20)] - **test**: fix use of `common` before required (Rod Vagg) [#2685](https://github.com/nodejs/node/pull/2685) +* [[`f146f686b7`](https://github.com/nodejs/node/commit/f146f686b7)] - **(SEMVER-MAJOR)** **test**: fix test-repl-tab-complete.js for V8 4.5 (Ali Ijaz Sheikh) [#2509](https://github.com/nodejs/node/pull/2509) +* [[`fe4b309fd3`](https://github.com/nodejs/node/commit/fe4b309fd3)] - **test**: refactor to eliminate flaky test (Rich Trott) [#2609](https://github.com/nodejs/node/pull/2609) +* [[`619721e6b8`](https://github.com/nodejs/node/commit/619721e6b8)] - **test**: mark eval_messages as flaky (Alexis Campailla) [#2648](https://github.com/nodejs/node/pull/2648) +* [[`93ba585b66`](https://github.com/nodejs/node/commit/93ba585b66)] - **test**: mark test-vm-syntax-error-stderr as flaky (João Reis) [#2662](https://github.com/nodejs/node/pull/2662) +* [[`367140bca0`](https://github.com/nodejs/node/commit/367140bca0)] - **test**: mark test-repl-persistent-history as flaky (João Reis) [#2659](https://github.com/nodejs/node/pull/2659) +* [[`f6b093343d`](https://github.com/nodejs/node/commit/f6b093343d)] - **timers**: minor `_unrefActive` fixes and improvements (Jeremiah Senkpiel) [#2540](https://github.com/nodejs/node/pull/2540) +* [[`403d7ee7d1`](https://github.com/nodejs/node/commit/403d7ee7d1)] - **timers**: don't mutate unref list while iterating it (Julien Gilli) [#2540](https://github.com/nodejs/node/pull/2540) +* [[`7a8c3e08c3`](https://github.com/nodejs/node/commit/7a8c3e08c3)] - **timers**: Avoid linear scan in `_unrefActive`. (Julien Gilli) [#2540](https://github.com/nodejs/node/pull/2540) +* [[`b630ebaf43`](https://github.com/nodejs/node/commit/b630ebaf43)] - **win,msi**: Upgrade from old upgrade code (João Reis) [#2439](https://github.com/nodejs/node/pull/2439) + +## 2015-09-02, Version 3.3.0, @rvagg + +### Notable changes + +* **build**: Add a `--link-module` option to `configure` that can be used to bundle additional JavaScript modules into a built binary (Bradley Meck) [#2497](https://github.com/nodejs/node/pull/2497) +* **docs**: Merge outstanding doc updates from joyent/node (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* **http_parser**: Significant performance improvement by having `http.Server` consume all initial data from its `net.Socket` and parsing directly without having to enter JavaScript. Any `'data'` listeners on the `net.Socket` will result in the data being "unconsumed" into JavaScript, thereby undoing any performance gains. (Fedor Indutny) [#2355](https://github.com/nodejs/node/pull/2355) +* **libuv**: Upgrade to 1.7.3 (from 1.6.1), see [ChangeLog](https://github.com/libuv/libuv/blob/v1.x/ChangeLog) for details (Saúl Ibarra Corretgé) [#2310](https://github.com/nodejs/node/pull/2310) +* **V8**: Upgrade to 4.4.63.30 (from 4.4.63.26) (Michaël Zasso) [#2482](https://github.com/nodejs/node/pull/2482) + +### Known issues + +See https://github.com/nodejs/io.js/labels/confirmed-bug for complete and current list of known issues. + +* Some uses of computed object shorthand properties are not handled correctly by the current version of V8. e.g. `[{ [prop]: val }]` evaluates to `[{}]`. [#2507](https://github.com/nodejs/node/issues/2507) +* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/io.js/issues/1264). +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/io.js/issues/690) +* `process.send()` is not synchronous as the docs suggest, a regression introduced in 1.0.2, see [#760](https://github.com/nodejs/io.js/issues/760). +* 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/io.js/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/io.js/issues/1435). + +### Commits + +* [[`1a531b4e44`](https://github.com/nodejs/node/commit/1a531b4e44)] - **(SEMVER-MINOR)** Introduce --link-module to ./configure (Bradley Meck) [#2497](https://github.com/nodejs/node/pull/2497) +* [[`d2f314c190`](https://github.com/nodejs/node/commit/d2f314c190)] - **build**: fix borked chmod call for release uploads (Rod Vagg) [#2645](https://github.com/nodejs/node/pull/2645) +* [[`3172e9c541`](https://github.com/nodejs/node/commit/3172e9c541)] - **build**: set file permissions before uploading (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`a860d7fae1`](https://github.com/nodejs/node/commit/a860d7fae1)] - **build**: change staging directory on new server (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`50c0baa8d7`](https://github.com/nodejs/node/commit/50c0baa8d7)] - **build**: rename 'doc' directory to 'docs' for upload (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`0a0577cf5f`](https://github.com/nodejs/node/commit/0a0577cf5f)] - **build**: fix bad cherry-pick for vcbuild.bat build-release (Rod Vagg) [#2625](https://github.com/nodejs/node/pull/2625) +* [[`34de90194b`](https://github.com/nodejs/node/commit/34de90194b)] - **build**: only define NODE_V8_OPTIONS if not empty (Evan Lucas) [#2532](https://github.com/nodejs/node/pull/2532) +* [[`944174b189`](https://github.com/nodejs/node/commit/944174b189)] - **build**: make ci test addons in test/addons (Ben Noordhuis) [#2428](https://github.com/nodejs/node/pull/2428) +* [[`e955f9a1b0`](https://github.com/nodejs/node/commit/e955f9a1b0)] - **crypto**: Use OPENSSL_cleanse to shred the data. (Сковорода Никита Андреевич) [#2575](https://github.com/nodejs/node/pull/2575) +* [[`395d736b9d`](https://github.com/nodejs/node/commit/395d736b9d)] - **debugger**: use strict equality comparison (Minwoo Jung) [#2558](https://github.com/nodejs/node/pull/2558) +* [[`1d0e5210a8`](https://github.com/nodejs/node/commit/1d0e5210a8)] - **deps**: upgrade libuv to 1.7.3 (Saúl Ibarra Corretgé) [#2310](https://github.com/nodejs/node/pull/2310) +* [[`34ef53364f`](https://github.com/nodejs/node/commit/34ef53364f)] - **deps**: update V8 to 4.4.63.30 (Michaël Zasso) [#2482](https://github.com/nodejs/node/pull/2482) +* [[`23579a5f4a`](https://github.com/nodejs/node/commit/23579a5f4a)] - **doc**: add TSC meeting minutes 2015-08-12 (Rod Vagg) [#2438](https://github.com/nodejs/node/pull/2438) +* [[`0cc59299a4`](https://github.com/nodejs/node/commit/0cc59299a4)] - **doc**: add TSC meeting minutes 2015-08-26 (Rod Vagg) [#2591](https://github.com/nodejs/node/pull/2591) +* [[`6efa96e33a`](https://github.com/nodejs/node/commit/6efa96e33a)] - **doc**: merge CHANGELOG.md with joyent/node ChangeLog (P.S.V.R) [#2536](https://github.com/nodejs/node/pull/2536) +* [[`f75d54607b`](https://github.com/nodejs/node/commit/f75d54607b)] - **doc**: clarify cluster behaviour with no workers (Jeremiah Senkpiel) [#2606](https://github.com/nodejs/node/pull/2606) +* [[`8936302121`](https://github.com/nodejs/node/commit/8936302121)] - **doc**: minor clarification in buffer.markdown (Сковорода Никита Андреевич) [#2574](https://github.com/nodejs/node/pull/2574) +* [[`0db0e53753`](https://github.com/nodejs/node/commit/0db0e53753)] - **doc**: add @jasnell and @sam-github to release team (Rod Vagg) [#2455](https://github.com/nodejs/node/pull/2455) +* [[`c16e100593`](https://github.com/nodejs/node/commit/c16e100593)] - **doc**: reorg release team to separate section (Rod Vagg) [#2455](https://github.com/nodejs/node/pull/2455) +* [[`e3e00143fd`](https://github.com/nodejs/node/commit/e3e00143fd)] - **doc**: fix bad merge on modules.markdown (James M Snell) +* [[`2f62455880`](https://github.com/nodejs/node/commit/2f62455880)] - **doc**: minor additional corrections and improvements (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`3bd08aac4b`](https://github.com/nodejs/node/commit/3bd08aac4b)] - **doc**: minor grammatical update in crypto.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`f707189370`](https://github.com/nodejs/node/commit/f707189370)] - **doc**: minor grammatical update (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`6c98cf0266`](https://github.com/nodejs/node/commit/6c98cf0266)] - **doc**: remove repeated statement in globals.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`48e6ccf8c2`](https://github.com/nodejs/node/commit/48e6ccf8c2)] - **doc**: remove 'dudes' from documentation (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`b5d68f8076`](https://github.com/nodejs/node/commit/b5d68f8076)] - **doc**: update tense in child_process.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`242e3fe3ba`](https://github.com/nodejs/node/commit/242e3fe3ba)] - **doc**: fixed worker.id type (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`ea9ee15c21`](https://github.com/nodejs/node/commit/ea9ee15c21)] - **doc**: port is optional for socket.bind() (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`0ff6657a50`](https://github.com/nodejs/node/commit/0ff6657a50)] - **doc**: fix minor types and grammar in fs docs (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`94d83c04f2`](https://github.com/nodejs/node/commit/94d83c04f2)] - **doc**: update parameter name in net.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`04111ce40f`](https://github.com/nodejs/node/commit/04111ce40f)] - **doc**: small typo in domain.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`c9fdd1bbbf`](https://github.com/nodejs/node/commit/c9fdd1bbbf)] - **doc**: fixed typo in net.markdown (missing comma) (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`27c07b3f8e`](https://github.com/nodejs/node/commit/27c07b3f8e)] - **doc**: update description of fs.exists in fs.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`52018e73d9`](https://github.com/nodejs/node/commit/52018e73d9)] - **doc**: clarification on the 'close' event (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`f6d3b87a25`](https://github.com/nodejs/node/commit/f6d3b87a25)] - **doc**: improve working in stream.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`b5da89431a`](https://github.com/nodejs/node/commit/b5da89431a)] - **doc**: update path.extname documentation (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`1d4ea609db`](https://github.com/nodejs/node/commit/1d4ea609db)] - **doc**: small clarifications to modules.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`c888985591`](https://github.com/nodejs/node/commit/c888985591)] - **doc**: code style cleanups in repl.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`105b493595`](https://github.com/nodejs/node/commit/105b493595)] - **doc**: correct grammar in cluster.markdown (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`51b86ccac7`](https://github.com/nodejs/node/commit/51b86ccac7)] - **doc**: Clarify the module.parent is set once (James M Snell) [#2378](https://github.com/nodejs/node/pull/2378) +* [[`d2ffecba2d`](https://github.com/nodejs/node/commit/d2ffecba2d)] - **doc**: add internal modules notice (Jeremiah Senkpiel) [#2523](https://github.com/nodejs/node/pull/2523) +* [[`b36debd5cb`](https://github.com/nodejs/node/commit/b36debd5cb)] - **env**: introduce `KickNextTick` (Fedor Indutny) [#2355](https://github.com/nodejs/node/pull/2355) +* [[`1bc446863f`](https://github.com/nodejs/node/commit/1bc446863f)] - **http_parser**: consume StreamBase instance (Fedor Indutny) [#2355](https://github.com/nodejs/node/pull/2355) +* [[`ce04b735cc`](https://github.com/nodejs/node/commit/ce04b735cc)] - **src**: only memcmp if length > 0 in Buffer::Compare (Karl Skomski) [#2544](https://github.com/nodejs/node/pull/2544) +* [[`31823e37c7`](https://github.com/nodejs/node/commit/31823e37c7)] - **src**: DRY getsockname/getpeername code (Ben Noordhuis) [#956](https://github.com/nodejs/node/pull/956) +* [[`13fd96dda3`](https://github.com/nodejs/node/commit/13fd96dda3)] - **src**: missing Exception::Error in node_http_parser (Jeremiah Senkpiel) [#2550](https://github.com/nodejs/node/pull/2550) +* [[`42e075ae02`](https://github.com/nodejs/node/commit/42e075ae02)] - **test**: improve performance of stringbytes test (Trevor Norris) [#2544](https://github.com/nodejs/node/pull/2544) +* [[`fc726399fd`](https://github.com/nodejs/node/commit/fc726399fd)] - **test**: unmark test-process-argv-0.js as flaky (Rich Trott) [#2613](https://github.com/nodejs/node/pull/2613) +* [[`7727ba1394`](https://github.com/nodejs/node/commit/7727ba1394)] - **test**: lint and refactor to avoid autocrlf issue (Roman Reiss) [#2494](https://github.com/nodejs/node/pull/2494) +* [[`c56aa829f0`](https://github.com/nodejs/node/commit/c56aa829f0)] - **test**: use tmpDir instead of fixturesDir (Sakthipriyan Vairamani) [#2583](https://github.com/nodejs/node/pull/2583) +* [[`5e65181ea4`](https://github.com/nodejs/node/commit/5e65181ea4)] - **test**: handling failure cases properly (Sakthipriyan Vairamani) [#2206](https://github.com/nodejs/node/pull/2206) +* [[`c48b95e847`](https://github.com/nodejs/node/commit/c48b95e847)] - **test**: initial list of flaky tests (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`94e88498ba`](https://github.com/nodejs/node/commit/94e88498ba)] - **test**: pass args to test-ci via env variable (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`09987c7a1c`](https://github.com/nodejs/node/commit/09987c7a1c)] - **test**: support flaky tests in test-ci (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`08b83c8b45`](https://github.com/nodejs/node/commit/08b83c8b45)] - **test**: add test configuration templates (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`8f8ab6fa57`](https://github.com/nodejs/node/commit/8f8ab6fa57)] - **test**: runner should return 0 on flaky tests (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`0cfd3be9c6`](https://github.com/nodejs/node/commit/0cfd3be9c6)] - **test**: runner support for flaky tests (Alexis Campailla) [#2424](https://github.com/nodejs/node/pull/2424) +* [[`3492d2d4c6`](https://github.com/nodejs/node/commit/3492d2d4c6)] - **test**: make test-process-argv-0 robust (Rich Trott) [#2541](https://github.com/nodejs/node/pull/2541) +* [[`a96cc31710`](https://github.com/nodejs/node/commit/a96cc31710)] - **test**: speed up test-child-process-spawnsync.js (Rich Trott) [#2542](https://github.com/nodejs/node/pull/2542) +* [[`856baf4c67`](https://github.com/nodejs/node/commit/856baf4c67)] - **test**: make spawnSync() test robust (Rich Trott) [#2535](https://github.com/nodejs/node/pull/2535) +* [[`3aa6bbb648`](https://github.com/nodejs/node/commit/3aa6bbb648)] - **tools**: update release.sh to work with new website (Rod Vagg) [#2623](https://github.com/nodejs/node/pull/2623) +* [[`f2f0fe45ff`](https://github.com/nodejs/node/commit/f2f0fe45ff)] - **tools**: make add-on scraper print filenames (Ben Noordhuis) [#2428](https://github.com/nodejs/node/pull/2428) +* [[`bb24c4a418`](https://github.com/nodejs/node/commit/bb24c4a418)] - **win,msi**: correct installation path registry keys (João Reis) [#2565](https://github.com/nodejs/node/pull/2565) +* [[`752977b888`](https://github.com/nodejs/node/commit/752977b888)] - **win,msi**: change InstallScope to perMachine (João Reis) [#2565](https://github.com/nodejs/node/pull/2565) + ## 2015-08-25, Version 3.2.0, @rvagg ### Notable changes @@ -968,7 +2386,7 @@ _Note: a new version of the 'url' module was reverted prior to release as it was - Add support for default author field to make `npm init -y` work without user-input (@othiym23) [npm/npm/d8eee6cf9d](https://github.com/npm/npm/commit/d8eee6cf9d2ff7aca68dfaed2de76824a3e0d9af) - Include local modules in `npm outdated` and `npm update` (@ArnaudRinquin) [npm/npm#7426](https://github.com/npm/npm/issues/7426) - The prefix used before the version number on `npm version` is now configurable via `tag-version-prefix` (@kkragenbrink) [npm/npm#8014](https://github.com/npm/npm/issues/8014) -* **os**: `os.tmpdir()` is now cross-platform consistent and will no longer returns a path with a trailling slash on any platform (Christian Tellnes) [#747](https://github.com/nodejs/node/pull/747) +* **os**: `os.tmpdir()` is now cross-platform consistent and will no longer returns a path with a trailing slash on any platform (Christian Tellnes) [#747](https://github.com/nodejs/node/pull/747) * **process**: - `process.nextTick()` performance has been improved by between 2-42% across the benchmark suite, notable because this is heavily used across core (Brian White) [#1571](https://github.com/nodejs/node/pull/1571) - New `process.geteuid()`, `process.seteuid(id)`, `process.getegid()` and `process.setegid(id)` methods allow you to get and set effective UID and GID of the process (Evan Lucas) [#1536](https://github.com/nodejs/node/pull/1536) @@ -2007,7 +3425,7 @@ _Note: version **1.4.0** was tagged and built but not released. A libuv bug was * [[`10277d2`](https://github.com/nodejs/node/commit/10277d2e57ee7fe9e0e3f63f10b9ea521e86e7f0)] - docs: include mention of new crypto methods (Calvin Metcalf) * [[`9a8f186`](https://github.com/nodejs/node/commit/9a8f18613da4956c963377e2ad55cdd3dabc32aa)] - child_process: add debug and error details (Zach Bruggeman) * [[`6f7a978`](https://github.com/nodejs/node/commit/6f7a9784eaef82a1aa6cf53bbbd7224c446876a0)] - crypto: clear error on return in TLS methods (Fedor Indutny) -* [[`50daee7`](https://github.com/nodejs/node/commit/50daee7243a3f987e1a28d93c43f913471d6885a)] - stream: simpler stream constructon (Sam Newman) +* [[`50daee7`](https://github.com/nodejs/node/commit/50daee7243a3f987e1a28d93c43f913471d6885a)] - stream: simpler stream construction (Sam Newman) * [[`e0730ee`](https://github.com/nodejs/node/commit/e0730eeaa5231841a7eba080c8170e41278c3c52)] - benchmark: allow compare via fine-grained filters (Brian White) * [[`96ffcb9`](https://github.com/nodejs/node/commit/96ffcb9a210a2fa1248ae5931290193573512a96)] - src: reduce cpu profiler overhead (Ben Noordhuis) * [[`3e675e4`](https://github.com/nodejs/node/commit/3e675e44b59f1be8e5581de000f3cb17ef747c14)] - benchmark: don't use template strings (Evan Lucas) @@ -2104,7 +3522,7 @@ _Note: version **1.4.0** was tagged and built but not released. A libuv bug was * [[`b5166cb`](https://github.com/nodejs/node/commit/b5166cb7d269cd1bf90d1768f82767b05b9ac1f8)] - benchmark: add bench-(url & events) make targets (Yosuke Furukawa) * [[`5843ae8`](https://github.com/nodejs/node/commit/5843ae8dfba5db83f2c04ed2db847049cbd2ab0d)] - Revert "doc: clarify fs.symlink and fs.symlinkSync parameters" (Bert Belder) * [[`668bde8`](https://github.com/nodejs/node/commit/668bde8ac0d16382cbc98c904d8b5f55fd9fd9f0)] - win,msi: broadcast WM_SETTINGCHANGE after install (Mathias Küsel) -* [[`69ce064`](https://github.com/nodejs/node/commit/69ce0641dc6a84c90ffdd0906790cd945f1c3629)] - build: remove artefacts on distclean (Johan Bergström) +* [[`69ce064`](https://github.com/nodejs/node/commit/69ce0641dc6a84c90ffdd0906790cd945f1c3629)] - build: remove artifacts on distclean (Johan Bergström) * [[`1953886`](https://github.com/nodejs/node/commit/1953886126a2ab3e7291a73767ee4302a391a208)] - test: fs.createReadStream().destroy() fd leak (Rod Vagg) * [[`497fd72`](https://github.com/nodejs/node/commit/497fd72e21d2d1216e8457928d1a8082349fd0e5)] - fs: fix fd leak in ReadStream.destroy() (Alex Kocharin) * [[`8b09ae7`](https://github.com/nodejs/node/commit/8b09ae76f1d854a0db579fc0737df4809ce6087d)] - doc: add links for http_parser/libuv upgrades (Michael Hart) @@ -2504,7 +3922,7 @@ https://iojs.org/api/tls.html - Added async session storage events. - Added async SNI callback. - Added multi-key server support (for example, ECDSA+RSA server). -- Added optional callback to `checkServerIdentity` for manual certificate validation in user-land. +- Added optional callback to `checkServerIdentity` for manual certificate validation in userland. - Added support for ECDSA/ECDHE cipher. - Implemented TLS streams in C++, boosting their performance. - Moved `createCredentials` to `tls` and renamed it to `createSecureContext`. @@ -3674,7 +5092,7 @@ https://github.com/nodejs/node/commit/01994e8119c24f2284bac0779b32acb49c95bee7 * fs: make 'end' work with ReadStream without 'start' (Ben Noordhuis) * https: optimize createConnection() (Ryunosuke SATO) * buffer: speed up base64 encoding by 20% (Ben Noordhuis) -* doc: Colorize API stabilitity index headers in docs (Luke Arduini) +* doc: Colorize API stability index headers in docs (Luke Arduini) * net: socket.readyState corrections (bentaber) * http: Performance enhancements for http under streams2 (isaacs) * stream: fix to emit end event on http.ClientResponse (Shigeki Ohtsu) @@ -3882,7 +5300,7 @@ https://github.com/nodejs/node/commit/2c4eef0d972838c51999d32c0d251857a713dc18 * npm: Upgrade to v1.2.2 * dns: make error message match errno (Dan Milon) -* tls: follow RFC6125 more stricly (Fedor Indutny) +* tls: follow RFC6125 more strictly (Fedor Indutny) * buffer: reject negative SlowBuffer offsets (Ben Noordhuis) * install: add simplejson fallback (Chris Dent) * http: fix "Cannot call method 'emit' of null" (Ben Noordhuis) @@ -4145,7 +5563,7 @@ https://github.com/nodejs/node/commit/2134aa3d5c622fc3c3b02ccb713fcde0e0df479a - Support for parallel use of the cache folder - Retry on registry timeouts or network failures (Trent Mick) - Reduce 'engines' failures to a warning - - Use new zsh completion if aviailable (Jeremy Cantrell) + - Use new zsh completion if available (Jeremy Cantrell) * Fix [#3577](https://github.com/joyent/node/issues/3577) Un-break require('sys') * util: speed up formatting of large arrays/objects (Ben Noordhuis) @@ -4436,7 +5854,7 @@ https://github.com/nodejs/node/commit/9cc55dca6f67a6096c858b841c677b0593404321 * Upgrade V8 to 3.8.6 * Use GYP build system on unix (Ben Noordhuis) -* Experimenetal isolates support (Ben Noordhuis) +* Experimental isolates support (Ben Noordhuis) * Improvements to Cluster API (Andreas Madsen) * Use isolates for internal debugger (Fedor Indutny) * Bug fixes @@ -4819,7 +6237,7 @@ https://github.com/nodejs/node/commit/220e61c1f65bf4db09699fcf6399c0809c0bc446 * Remove cmake build system, support for Cygwin, legacy code base, process.ENV, process.ARGV, process.memoryUsage().vsize, os.openOSHandle -* Documentation improvments (Igor Zinkovsky, Bert Belder, Ilya Dmitrichenko, +* Documentation improvements (Igor Zinkovsky, Bert Belder, Ilya Dmitrichenko, koichik, Maciej Małecki, Guglielmo Ferri, isaacs) * Performance improvements (Daniel Ennis, Bert Belder, Ben Noordhuis) @@ -5144,7 +6562,7 @@ https://github.com/nodejs/node/commit/a745d19ce7d1c0e3778371af4f0346be70cf2c8e * cmake improvements (Tom Hughes) * node_net.cc: fix incorrect sizeof() (Tom Hughes) * Windows/cygwin: no more GetConsoleTitleW errors on XP (Bert Belder) -* Doc improvments (koichik, Logan Smyth, Ben Noordhuis, Arnout Kazemier) +* Doc improvements (koichik, Logan Smyth, Ben Noordhuis, Arnout Kazemier) ## 2011.07.19, Version 0.4.10 (stable) @@ -5629,7 +7047,7 @@ https://github.com/nodejs/node/commit/2a4568c85f33869c75ff43ccd30f0ec188b43eab * Fix Buffer.toString() on 0-length slices. (Peter Griess) * Cache modules based on filename rather than ID (Isaac Schlueter) -* querystring improvments (Jan Kassens, Micheil Smith) +* querystring improvements (Jan Kassens, Micheil Smith) * Support DEL in the REPL. (Jérémy Lal) * Upgrade http-parser, upgrade V8 to 2.3.2 @@ -6042,10 +7460,10 @@ https://github.com/nodejs/node/commit/39ca93549af91575ca9d4cbafd1e170fbcef3dfa * API: request.uri -> request.url It is no longer an object, but a string. The 'url' module - was addded to parse that string. That is, node no longer + was added to parse that string. That is, node no longer parses the request URL automatically. require('url').parse(request.url) - is roughly equivlent to the old request.uri object. + is roughly equivalent to the old request.uri object. (isaacs) * Bugfix: Several libeio related race conditions. @@ -6314,7 +7732,7 @@ https://github.com/nodejs/node/commit/12bb0d46ce761e3d00a27170e63b40408c15b558 * Bugfix: Internally use full paths when loading modules this fixes a shebang loading problem. - * Bugfix: Add '--' command line argument for seperating v8 + * Bugfix: Add '--' command line argument for separating v8 args from program args. * Add man page. @@ -6381,7 +7799,7 @@ https://github.com/nodejs/node/commit/b0fd3e281cb5f7cd8d3a26bd2b89e1b59998e5ed connection before sending data every time (Kevin van Zonneveld) * Bugfix: stdin fd (0) being ignored by node.File. (Abe Fettig) - * API: Remove connnection.fullClose() + * API: Remove connection.fullClose() * API: Return the EventEmitter from addListener for chaining. * API: tcp.Connection "disconnect" event renamed to "close" diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..8dee836460a3b3 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,41 @@ +## Code of Conduct + +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/). + +* 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"). diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 25f7ba14fda322..4e3077163d81e2 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,19 +64,19 @@ 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. All pull requests that modify executable code should be subjected to continuous integration tests on the -[project CI server](https://jenkins-iojs.nodesource.com/). +[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 @@ -227,3 +228,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 a096d4989d76fa..87d6d93584c22c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,23 @@ # 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 please make sure discussions are related to concrete technical issues with the Node.js software. +For general help using Node.js, please file an issue at the +[Node.js help repository](https://github.com/nodejs/help/issues). + 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 @@ -42,23 +51,26 @@ and built upon. The rules for the master branch are less strict; consult the [stability index](./doc/api/documentation.markdown#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 @@ -78,8 +90,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 @@ -121,15 +133,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 @@ -157,62 +169,33 @@ $ 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 +* (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 -## Code of Conduct - -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 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") +* (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..0ec424d45a1bf7 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,39 @@ 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. +CTC seats are not time-limited. There is no fixed size of the CTC. 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. -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 +102,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 +126,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 753f9c7e20910c..b39df1e0a8d9cb 100644 --- a/LICENSE +++ b/LICENSE @@ -51,149 +51,417 @@ 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: + """ + 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. """ - 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. +- 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. - - 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. + Additional changes are licensed under the same terms as NGINX and + copyright Joyent, Inc. and other Node contributors. All rights reserved. - - 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. + 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: - - Valgrind client API header, located at third_party/valgrind/valgrind.h - This is release under the BSD license. + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. - These libraries have their own licenses; we recommend you read them, - as their terms may differ from the terms below. + 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 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: +- ICU, located at deps/icu, is licensed as follows: + """ + ICU License - ICU 1.8.1 and later - * 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. + COPYRIGHT AND PERMISSION NOTICE - 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) 1995-2015 International Business Machines Corporation and others -- 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. - """ + All rights reserved. -- 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). - * - */ + 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-2015 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. """ -- HTTP Parser, located at deps/http_parser. HTTP Parser's license follows: +- libuv, located at deps/uv, is licensed as follows: """ - http_parser.c is based on src/http/ngx_http_parse.c from NGINX copyright - Igor Sysoev. + libuv is part of the Node project: http://nodejs.org/ + libuv may be distributed alone under Node's license: - Additional changes are licensed under the same terms as NGINX and - copyright Joyent, Inc. and other Node contributors. All rights reserved. + ==== + 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 @@ -211,129 +479,156 @@ The externally maintained libraries used by Node.js are: 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. - """ -- Closure Linter is located at tools/closure_linter. Closure's license - follows: - """ - # Copyright (c) 2007, 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. - """ + ==== -- python-gflags is located at tools/gflags. Its license follows: - """ - # Copyright (c) 2006, 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. + 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-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). """ -- 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 @@ -348,46 +643,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 @@ -454,14 +766,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 @@ -476,7 +786,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 @@ -510,7 +819,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 @@ -528,7 +836,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 @@ -545,7 +852,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 @@ -554,7 +860,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 @@ -591,33 +896,86 @@ 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. - -------- + The following additional terms shall apply to use of the npm software, the npm + website, the npm repository and any other services or products offered by npm, + Inc.: - "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. + "Node.js" trademark Joyent, Inc. npm is not officially part of the Node.js + project, and is neither owned by nor 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" and "The npm Registry" are owned by npm, Inc. All rights reserved. - "npm Logo" created by Mathias Pettersson and Brian Hammond, - used with permission. + Modules published on the npm registry are not officially endorsed by npm, Inc. + or the Node.js project. + + 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, warrantee, or assertion expressed or implied + as to the quality, fitness for a specific purpose, or lack of malice in any + given npm package. Packages downloaded through the npm registry are + independently licensed and are not covered by this license. + + Additional policies relating to, and restrictions on use of, npm products and + services are available on the npm website. All such policies and restrictions, + as updated from time to time, are hereby incorporated into this license + agreement. By using npm, you acknowledge your agreement to all such policies + and restrictions. + + If you have a complaint about a package in the public npm registry, and cannot + resolve it with the package owner, please email support@npmjs.com and explain + the situation. See the [npm Dispute Resolution + policy](https://github.com/npm/policies/blob/master/disputes.md) for more + details. + + 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. + + "npm Logo" contributed by Mathias Pettersson and Brian Hammond, + use is subject to https://www.npmjs.com/policies/trademark "Gubblebum Blocky" font - Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com + Copyright (c) by Tjarda Koster, https://jelloween.deviantart.com included for use in the npm website and documentation, used with permission. - This program uses several Node.js modules contained in the node_modules/ + This program uses several Node modules contained in the node_modules/ subdirectory, according to the terms of their respective licenses. """ -- tools/doc/node_modules/marked. Marked is a Markdown parser. Marked's - license follows: +- GYP, located at tools/gyp, 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. + """ + +- marked, located at tools/doc/node_modules/marked, is licensed as follows: """ Copyright (c) 2011-2012, Christopher Jeffrey (https://github.com/chjj/) @@ -640,405 +998,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. - - 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. +- ESLint, located at tools/eslint, is licensed as follows: + """ + ESLint + Copyright (c) 2013 Nicholas C. Zakas. All rights reserved. - 1. Unicode Data Files and Software - COPYRIGHT AND PERMISSION NOTICE + 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: - Copyright © 1991-2014 Unicode, Inc. All rights reserved. - Distributed under the Terms of Use in - http://www.unicode.org/copyright.html. + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. - 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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + """ - THE 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. +- gtest, located at deps/gtest, is licensed as follows: + """ + Copyright 2008, Google Inc. + All rights reserved. - 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. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - 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------------------------------------ + * 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. - 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. - # -------------------------------------------------------------------------------- + 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. + """ - 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. +- node-weak, located at test/gc/node_modules/weak, is licensed as follows: + """ + Copyright (c) 2011, Ben Noordhuis - 7. Database Ownership + 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 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 3f8f5fa30de32e..65a399b063aa2f 100644 --- a/Makefile +++ b/Makefile @@ -67,12 +67,14 @@ uninstall: clean: -rm -rf out/Makefile $(NODE_EXE) $(NODE_G_EXE) out/$(BUILDTYPE)/$(NODE_EXE) - @if [ -d out ]; then find out/ -name '*.o' -o -name '*.a' | xargs rm -rf; fi + @if [ -d out ]; then find out/ -name '*.o' -o -name '*.a' -o -name '*.d' | xargs rm -rf; fi -rm -rf node_modules + @if [ -d deps/icu ]; then echo deleting deps/icu; rm -rf deps/icu; fi + -rm -f test.tap 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 @@ -103,12 +105,12 @@ test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE) # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale. test/addons/.docbuildstamp: doc/api/addons.markdown - $(RM) -r test/addons/doc-*/ + $(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. @@ -270,6 +272,9 @@ else ifeq ($(DESTCPU),arm) ARCH=arm else +ifeq ($(DESTCPU),aarch64) +ARCH=arm64 +else ifeq ($(DESTCPU),ppc64) ARCH=ppc64 else @@ -281,6 +286,7 @@ endif endif endif endif +endif # enforce "x86" over "ia32" as the generally accepted way of referring to 32-bit intel ifeq ($(ARCH),ia32) @@ -338,7 +344,7 @@ $(PKG): release-only | sed -E "s/\\{npmversion\\}/$(NPMVERSION)/g" \ > tools/osx-pkg.pmdoc/index.xml $(PACKAGEMAKER) \ - --id "org.node.pkg" \ + --id "org.nodejs.pkg" \ --doc tools/osx-pkg.pmdoc \ --out $(PKG) SIGN="$(PRODUCTSIGN_CERT)" PKG="$(PKG)" bash tools/osx-productsign.sh @@ -346,9 +352,10 @@ $(PKG): release-only pkg: $(PKG) pkg-upload: pkg - ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)" - scp -p node-$(FULLVERSION).pkg $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg.done" + ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" + chmod 664 node-$(FULLVERSION).pkg + scp -p node-$(FULLVERSION).pkg $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).pkg.done" $(TARBALL): release-only $(NODE_EXE) doc git checkout-index -a -f --prefix=$(TARNAME)/ @@ -372,18 +379,21 @@ endif tar: $(TARBALL) tar-upload: tar - ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)" - scp -p node-$(FULLVERSION).tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz.done" + ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" + chmod 664 node-$(FULLVERSION).tar.gz + scp -p node-$(FULLVERSION).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.gz.done" ifeq ($(XZ), 0) - scp -p node-$(FULLVERSION).tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz.done" + chmod 664 node-$(FULLVERSION).tar.xz + scp -p node-$(FULLVERSION).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION).tar.xz.done" endif doc-upload: tar - ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)" - scp -r out/doc/ $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/ - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/doc.done" + ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" + chmod -R ug=rw-x+X,o=r+X out/doc/ + scp -pr out/doc/ $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs/ + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/docs.done" $(TARBALL)-headers: config.gypi release-only $(PYTHON) ./configure \ @@ -405,12 +415,14 @@ endif tar-headers: $(TARBALL)-headers tar-headers-upload: tar-headers - ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)" - scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done" + ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" + chmod 664 $(TARNAME)-headers.tar.gz + scp -p $(TARNAME)-headers.tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.gz.done" ifeq ($(XZ), 0) - scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done" + chmod 664 $(TARNAME)-headers.tar.xz + scp -p $(TARNAME)-headers.tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/$(TARNAME)-headers.tar.xz.done" endif $(BINARYTAR): release-only @@ -437,12 +449,14 @@ endif binary: $(BINARYTAR) binary-upload: binary - ssh $(STAGINGSERVER) "mkdir -p staging/$(DISTTYPEDIR)/$(FULLVERSION)" - scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz.done" + ssh $(STAGINGSERVER) "mkdir -p nodejs/$(DISTTYPEDIR)/$(FULLVERSION)" + chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz + scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.gz.done" ifeq ($(XZ), 0) - scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz - ssh $(STAGINGSERVER) "touch staging/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz.done" + chmod 664 node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz + scp -p node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz $(STAGINGSERVER):nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz + ssh $(STAGINGSERVER) "touch nodejs/$(DISTTYPEDIR)/$(FULLVERSION)/node-$(FULLVERSION)-$(OSTYPE)-$(ARCH).tar.xz.done" endif haswrk=$(shell which wrk > /dev/null 2>&1; echo $$?) @@ -483,6 +497,9 @@ bench-url: all bench-events: all @$(NODE) benchmark/common.js events +bench-util: all + @$(NODE) benchmark/common.js util + bench-all: bench bench-misc bench-array bench-buffer bench-url bench-events bench: bench-net bench-http bench-fs bench-tls @@ -496,7 +513,8 @@ bench-idle: $(NODE) benchmark/idle_clients.js & jslint: - $(NODE) tools/eslint/bin/eslint.js src lib test --rulesdir tools/eslint-rules --reset --quiet + $(NODE) tools/eslint/bin/eslint.js lib src test tools/doc tools/eslint-rules \ + --rulesdir tools/eslint-rules --quiet CPPLINT_EXCLUDE ?= CPPLINT_EXCLUDE += src/node_lttng.cc @@ -506,7 +524,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/* \ 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 436169ef4327f5..22883b569a5914 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,11 +63,12 @@ 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 it through `sha256sum` with a command such as: @@ -44,9 +80,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 @@ -116,7 +152,7 @@ $ man doc/node.1 To test if Node.js was built correctly: ``` -$ node -e "console.log('Hello from node.js ' + process.version)" +$ node -e "console.log('Hello from Node.js ' + process.version)" ``` ### Windows @@ -124,8 +160,8 @@ $ node -e "console.log('Hello from node.js ' + process.version)" 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 +* 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`. @@ -143,7 +179,7 @@ To run the tests: To test if Node.js was built correctly: ``` -$ node -e "console.log('Hello from node.js ' + process.version)" +$ node -e "console.log('Hello from Node.js ' + process.version)" ``` ### Android / Android based devices, aka. Firefox OS @@ -159,7 +195,7 @@ $ make ### `Intl` (ECMA-402) support: -[Intl](https://github.com/joyent/node/wiki/Intl) support is not +[Intl](https://github.com/nodejs/node/wiki/Intl) support is not enabled by default. #### "small" (English only) support @@ -184,7 +220,7 @@ The `small-icu` mode builds with English-only data. You can add full data at runtime. *Note:* more docs are on -[the joyent/node wiki](https://github.com/joyent/node/wiki/Intl). +[the node wiki](https://github.com/nodejs/node/wiki/Intl). #### Build with full ICU support (all locales supported by ICU): @@ -226,6 +262,9 @@ Windows: $ 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 @@ -282,7 +321,7 @@ 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 intallation" as described in section 6.6 in + 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/ @@ -295,7 +334,9 @@ Instructions: 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` ) + 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 @@ -305,18 +346,19 @@ Instructions: ## 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](http://webchat.freenode.net?channels=node.js&uio=d4) +* IRC (node core development): [#node-dev on Freenode.net](http://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,73 +367,85 @@ 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) - -* **Ben Noordhuis** <info@bnoordhuis.nl> ([@bnoordhuis](https://github.com/bnoordhuis)) -* **Bert Belder** <bertbelder@gmail.com> ([@piscisaureus](https://github.com/piscisaureus)) -* **Fedor Indutny** <fedor.indutny@gmail.com> ([@indutny](https://github.com/indutny)) -* **Trevor Norris** <trev.norris@gmail.com> ([@trevnorris](https://github.com/trevnorris)) -* **Chris Dickinson** <christopher.s.dickinson@gmail.com> ([@chrisdickinson](https://github.com/chrisdickinson)) -* **Rod Vagg** <rod@vagg.org> ([@rvagg](https://github.com/rvagg)) -* **Jeremiah Senkpiel** <fishrock123@rocketmail.com> ([@fishrock123](https://github.com/fishrock123)) -* **Colin Ihrig** <cjihrig@gmail.com> ([@cjihrig](https://github.com/cjihrig)) -* **Alexis Campailla** <orangemocha@nodejs.org> ([@orangemocha](https://github.com/orangemocha)) -* **Julien Gilli** <jgilli@nodejs.org> ([@misterdjules](https://github.com/misterdjules)) -* **James M Snell** <jasnell@gmail.com> ([@jasnell](https://github.com/jasnell)) -* **Steven R Loomis** <srloomis@us.ibm.com> ([@srl295](https://github.com/srl295)) -* **Michael Dawson** <michael_dawson@ca.ibm.com> ([@mhdawson](https://github.com/mhdawson)) -* **Shigeki Ohtsu** <ohtsu@iij.ad.jp> ([@shigeki](https://github.com/shigeki)) -* **Brian White** <mscdex@mscdex.net> ([@mscdex](https://github.com/mscdex)) +### CTC (Core Technical Committee) + +* [bnoordhuis](https://github.com/bnoordhuis) - **Ben Noordhuis** <info@bnoordhuis.nl> +* [chrisdickinson](https://github.com/chrisdickinson) - **Chris Dickinson** <christopher.s.dickinson@gmail.com> +* [cjihrig](https://github.com/cjihrig) - **Colin Ihrig** <cjihrig@gmail.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> +* [misterdjules](https://github.com/misterdjules) - **Julien Gilli** <jgilli@nodejs.org> +* [mscdex](https://github.com/mscdex) - **Brian White** <mscdex@mscdex.net> +* [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> ### Collaborators -* **Isaac Z. Schlueter** <i@izs.me> ([@isaacs](https://github.com/isaacs)) -* **Mikeal Rogers** <mikeal.rogers@gmail.com> ([@mikeal](https://github.com/mikeal)) -* **Thorsten Lorenz** <thlorenz@gmx.de> ([@thlorenz](https://github.com/thlorenz)) -* **Stephen Belanger** <admin@stephenbelanger.com> ([@qard](https://github.com/qard)) -* **Evan Lucas** <evanlucas@me.com> ([@evanlucas](https://github.com/evanlucas)) -* **Brendan Ashworth** <brendan.ashworth@me.com> ([@brendanashworth](https://github.com/brendanashworth)) -* **Vladimir Kurchatkin** <vladimir.kurchatkin@gmail.com> ([@vkurchatkin](https://github.com/vkurchatkin)) -* **Nikolai Vavilov** <vvnicholas@gmail.com> ([@seishun](https://github.com/seishun)) -* **Nicu Micleușanu** <micnic90@gmail.com> ([@micnic](https://github.com/micnic)) -* **Aleksey Smolenchuk** <lxe@lxe.co> ([@lxe](https://github.com/lxe)) -* **Sam Roberts** <vieuxtech@gmail.com> ([@sam-github](https://github.com/sam-github)) -* **Wyatt Preul** <wpreul@gmail.com> ([@geek](https://github.com/geek)) -* **Christian Tellnes** <christian@tellnes.no> ([@tellnes](https://github.com/tellnes)) -* **Robert Kowalski** <rok@kowalski.gd> ([@robertkowalski](https://github.com/robertkowalski)) -* **Julian Duque** <julianduquej@gmail.com> ([@julianduque](https://github.com/julianduque)) -* **Johan Bergström** <bugs@bergstroem.nu> ([@jbergstroem](https://github.com/jbergstroem)) -* **Roman Reiss** <me@silverwind.io> ([@silverwind](https://github.com/silverwind)) -* **Petka Antonov** <petka_antonov@hotmail.com> ([@petkaantonov](https://github.com/petkaantonov)) -* **Yosuke Furukawa** <yosuke.furukawa@gmail.com> ([@yosuke-furukawa](https://github.com/yosuke-furukawa)) -* **Alex Kocharin** <alex@kocharin.ru> ([@rlidwka](https://github.com/rlidwka)) -* **Christopher Monsanto** <chris@monsan.to> ([@monsanto](https://github.com/monsanto)) -* **Ali Ijaz Sheikh** <ofrobots@google.com> ([@ofrobots](https://github.com/ofrobots)) -* **Oleg Elifantiev** <oleg@elifantiev.ru> ([@Olegas](https://github.com/Olegas)) -* **Domenic Denicola** <d@domenic.me> ([@domenic](https://github.com/domenic)) -* **Rich Trott** <rtrott@gmail.com> ([@Trott](https://github.com/Trott)) -* **Сковорода Никита Андреевич** <chalkerx@gmail.com> ([@ChALkeR](https://github.com/ChALkeR)) -* **Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> ([@thefourtheye](https://github.com/thefourtheye)) -* **Michaël Zasso** <mic.besace@gmail.com> ([@targos](https://github.com/targos)) -* **João Reis** <reis@janeasystems.com> ([@joaocgreis](https://github.com/joaocgreis)) - -Collaborators & TSC members follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in +* [brendanashworth](https://github.com/brendanashworth) - **Brendan Ashworth** <brendan.ashworth@me.com> +* [calvinmetcalf](https://github.com/calvinmetcalf) - **Calvin Metcalf** <calvin.metcalf@gmail.com> +* [ChALkeR](https://github.com/ChALkeR) - **Сковорода Никита Андреевич** <chalkerx@gmail.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> +* [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> +* [mcollina](https://github.com/mcollina) - **Matteo Collina** <matteo.collina@gmail.com> +* [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <michael_dawson@ca.ibm.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> +* [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> +* [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> +* [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> +* [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> +* [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 & 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: @@ -402,14 +456,16 @@ 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 -details on what to do with these keys to verify a downloaded file is official. +details on what to do with these keys to verify that a downloaded file is official. 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/WORKING_GROUPS.md b/WORKING_GROUPS.md index 5e19a93639d70e..5c062ca7325a9b 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,6 +27,14 @@ 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) + +#### Process: + * [Starting a Working Group](#starting-a-wg) * [Bootstrap Governance](#bootstrap-governance) @@ -103,43 +111,56 @@ to date and of high quality. * Promotion of Node.js speakers for meetups and conferences in their language. -Each language community maintains its own membership. +Note that the i18n working groups are distinct from the [Intl](#Intl) working group. -* [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) +Each language community maintains its own membership. +* [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) + +The Intl Working Group is dedicated to support and improvement of +Internationalization (i18n) and Localization (l10n) in Node. Its responsibilities are: + +1. Functionality & compliance (standards: ECMA, Unicode…) +2. Support for Globalization and Internationalization issues that come up in the tracker +3. Guidance and Best Practices +4. Refinement of existing `Intl` implementation + +The Intl WG is not responsible for translation of content. That is the responsibility of the specific [i18n](#i18n) group for each language. ### [Evangelism](https://github.com/nodejs/evangelism) @@ -154,6 +175,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) @@ -195,9 +229,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. @@ -205,6 +239,54 @@ 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. + ## Starting a WG A Working Group is established by first defining a charter that can be @@ -387,40 +469,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/benchmark/README.md b/benchmark/README.md index 3216141c4e2cf6..c3d950f792e31f 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -23,8 +23,8 @@ There are three ways to run benchmark tests: For example, buffers: -```sh -iojs benchmark/common.js buffers +```bash +node benchmark/common.js buffers ``` The above command will find all scripts under `buffers` directory and require @@ -87,8 +87,8 @@ The last number is the rate of operations. Higher is better. For example, buffer-slice.js: -```sh -iojs benchmark/buffers/buffer-read.js +```bash +node benchmark/buffers/buffer-read.js ``` The output: ``` @@ -104,8 +104,8 @@ This example will run only the first type of url test, with one iteration. (Note: benchmarks require __many__ iterations to be statistically accurate.) -```sh -iojs benchmark/url/url-parse.js type=one n=1 +```bash +node benchmark/url/url-parse.js type=one n=1 ``` Output: ``` 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..d8d2b57331f7ef --- /dev/null +++ b/benchmark/assert/deepequal-prims-and-objs-big-array.js @@ -0,0 +1,37 @@ +'use strict'; +var common = require('../common.js'); +var assert = require('assert'); +var bench = common.createBenchmark(main, { + prim: [ + null, + undefined, + 'a', + 1, + true, + {0: 'a'}, + [1, 2, 3], + new Array([1, 2, 3]) + ], + n: [25] +}); + +function main(conf) { + var prim = 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..5f0519bb3b45ad --- /dev/null +++ b/benchmark/assert/deepequal-prims-and-objs-big-loop.js @@ -0,0 +1,30 @@ +'use strict'; +var common = require('../common.js'); +var assert = require('assert'); +var bench = common.createBenchmark(main, { + prim: [ + null, + undefined, + 'a', + 1, + true, + {0: 'a'}, + [1, 2, 3], + new Array([1, 2, 3]) + ], + n: [1e5] +}); + +function main(conf) { + var prim = 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-indexof.js b/benchmark/buffers/buffer-indexof.js new file mode 100644 index 00000000000000..c575f54b6a638c --- /dev/null +++ b/benchmark/buffers/buffer-indexof.js @@ -0,0 +1,38 @@ +var common = require('../common.js'); +var fs = require('fs'); + +var bench = common.createBenchmark(main, { + search: ['@', 'SQ', '10x', '--l', 'Alice', 'Gryphon', 'Panther', + 'Ou est ma chatte?', 'found it very', 'among mad people', + 'neighbouring pool', 'Soo--oop', 'aaaaaaaaaaaaaaaaa', + 'venture to go near the house till she had brought herself down to', + ' to the Caterpillar'], + encoding: ['undefined', 'utf8', 'ucs2', 'binary'], + type: ['buffer', 'string'], + iter: [1] +}); + +function main(conf) { + var iter = (conf.iter) * 100000; + var aliceBuffer = fs.readFileSync(__dirname + '/../fixtures/alice.html'); + var search = conf.search; + var encoding = conf.encoding; + + if (encoding === 'undefined') { + encoding = undefined; + } + + if (encoding === 'ucs2') { + aliceBuffer = new Buffer(aliceBuffer.toString(), encoding); + } + + if (conf.type === 'buffer') { + search = new Buffer(new Buffer(search).toString(), encoding); + } + + bench.start(); + for (var i = 0; i < iter; i++) { + aliceBuffer.indexOf(search, 0, encoding); + } + bench.end(iter); +} 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/common.js b/benchmark/common.js index 158354004cd6bb..511ae384f418bf 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -137,7 +137,7 @@ Benchmark.prototype._run = function() { if (this.config) return this.fn(this.config); - // one more more options weren't set. + // some options weren't set. // run with all combinations var main = require.main.filename; var settings = []; diff --git a/benchmark/fixtures/alice.html b/benchmark/fixtures/alice.html new file mode 100644 index 00000000000000..a794e2582ae4a5 --- /dev/null +++ b/benchmark/fixtures/alice.html @@ -0,0 +1,3865 @@ +The Project Gutenberg Etext of Alice's Adventures in Wonderland, by Lewis Carroll
+The Project Gutenberg Etext of Alice's Adventures in Wonderland
+This is an HTML reprint of #1 in our series by Lewis Carroll
+
+
+Copyright laws are changing all over the world, be sure to check
+the copyright laws for your country before posting these files!!
+
+Please take a look at the important information in this header.
+We encourage you to keep this file on your own disk, keeping an
+electronic path open for the next readers.  Do not remove this.
+
+
+**Welcome To The World of Free Plain Vanilla Electronic Texts**
+
+**Etexts Readable By Both Humans and By Computers, Since 1971**
+
+*These Etexts Prepared By Hundreds of Volunteers and Donations*
+
+Information on contacting Project Gutenberg to get Etexts, and
+further information is included below.  We need your donations.
+
+
+Alice's Adventures in Wonderland
+
+[Also known as "Alice in Wonderland"]
+
+by Lewis Carroll
+
+May, 1997  [Etext #928]
+[Date last updated: April 15, 2005]
+
+
+The Project Gutenberg Etext of Alice's Adventures in Wonderland
+*****This file should be named alice30h.htm or alice30h.zip****
+
+Corrected EDITIONS of our etexts get a new NUMBER, alice31h.htm.
+
+
+This etext was prepared by James Rose, Granada Hills, CA.
+
+
+We are now trying to release all our books one month in advance
+of the official release dates, for time for better editing.
+
+Please note:  neither this list nor its contents are final till
+midnight of the last day of the month of any such announcement.
+The official release date of all Project Gutenberg Etexts is at
+Midnight, Central Time, of the last day of the stated month.  A
+preliminary version may often be posted for suggestion, comment
+and editing by those who wish to do so.  To be sure you have an
+up to date first edition [xxxxx10x.xxx] please check file sizes
+in the first week of the next month.  Since our ftp program has
+a bug in it that scrambles the date [tried to fix and failed] a
+look at the file size will have to do, but we will try to see a
+new copy has at least one byte more or less.
+
+
+Information about Project Gutenberg (one page)
+
+We produce about two million dollars for each hour we work.  The
+fifty hours is one conservative estimate for how long it we take
+to get any etext selected, entered, proofread, edited, copyright
+searched and analyzed, the copyright letters written, etc.  This
+projected audience is one hundred million readers.  If our value
+per text is nominally estimated at one dollar then we produce $2
+million dollars per hour this year as we release thirty-two text
+files per month:  or 400 more Etexts in 1996 for a total of 800.
+If these reach just 10% of the computerized population, then the
+total should reach 80 billion Etexts.
+
+The Goal of Project Gutenberg is to Give Away One Trillion Etext
+Files by the December 31, 2001.  [10,000 x 100,000,000=Trillion]
+This is ten thousand titles each to one hundred million readers,
+which is only 10% of the present number of computer users.  2001
+should have at least twice as many computer users as that, so it
+will require us reaching less than 5% of the users in 2001.
+
+
+We need your donations more than ever!
+
+
+All donations should be made to "Project Gutenberg/CMU": and are
+tax deductible to the extent allowable by law.  (CMU = Carnegie
+Mellon University).
+
+For these and other matters, please mail to:
+
+Project Gutenberg
+P. O. Box  2782
+Champaign, IL 61825
+
+When all other email fails try our Executive Director:
+Michael S. Hart [hart@pobox.com]
+
+We would prefer to send you this information by email
+(Internet, Bitnet, Compuserve, ATTMAIL or MCImail).
+
+******
+If you have an FTP program (or emulator), please
+FTP directly to the Project Gutenberg archives:
+[Mac users, do NOT point and click. . .type]
+
+ftp uiarchive.cso.uiuc.edu
+login:  anonymous
+password:  your@login
+cd etext/etext90 through /etext96
+or cd etext/articles [get suggest gut for more information]
+dir [to see files]
+get or mget [to get files. . .set bin for zip files]
+GET INDEX?00.GUT
+for a list of books
+and
+GET NEW GUT for general information
+and
+MGET GUT* for newsletters.
+
+**Information prepared by the Project Gutenberg legal advisor**
+(Three Pages)
+
+
+***START**THE SMALL PRINT!**FOR PUBLIC DOMAIN ETEXTS**START***
+Why is this "Small Print!" statement here?  You know: lawyers.
+They tell us you might sue us if there is something wrong with
+your copy of this etext, even if you got it for free from
+someone other than us, and even if what's wrong is not our
+fault.  So, among other things, this "Small Print!" statement
+disclaims most of our liability to you.  It also tells you how
+you can distribute copies of this etext if you want to.
+
+*BEFORE!* YOU USE OR READ THIS ETEXT
+By using or reading any part of this PROJECT GUTENBERG-tm
+etext, you indicate that you understand, agree to and accept
+this "Small Print!" statement.  If you do not, you can receive
+a refund of the money (if any) you paid for this etext by
+sending a request within 30 days of receiving it to the person
+you got it from.  If you received this etext on a physical
+medium (such as a disk), you must return it with your request.
+
+ABOUT PROJECT GUTENBERG-TM ETEXTS
+This PROJECT GUTENBERG-tm etext, like most PROJECT GUTENBERG-
+tm etexts, is a "public domain" work distributed by Professor
+Michael S. Hart through the Project Gutenberg Association at
+Carnegie-Mellon University (the "Project").  Among other
+things, this means that no one owns a United States copyright
+on or for this work, so the Project (and you!) can copy and
+distribute it in the United States without permission and
+without paying copyright royalties.  Special rules, set forth
+below, apply if you wish to copy and distribute this etext
+under the Project's "PROJECT GUTENBERG" trademark.
+
+To create these etexts, the Project expends considerable
+efforts to identify, transcribe and proofread public domain
+works.  Despite these efforts, the Project's etexts and any
+medium they may be on may contain "Defects".  Among other
+things, Defects may take the form of incomplete, inaccurate or
+corrupt data, transcription errors, a copyright or other
+intellectual property infringement, a defective or damaged
+disk or other etext medium, a computer virus, or computer
+codes that damage or cannot be read by your equipment.
+
+LIMITED WARRANTY; DISCLAIMER OF DAMAGES
+But for the "Right of Replacement or Refund" described below,
+[1] the Project (and any other party you may receive this
+etext from as a PROJECT GUTENBERG-tm etext) disclaims all
+liability to you for damages, costs and expenses, including
+legal fees, and [2] YOU HAVE NO REMEDIES FOR NEGLIGENCE OR
+UNDER STRICT LIABILITY, OR FOR BREACH OF WARRANTY OR CONTRACT,
+INCLUDING BUT NOT LIMITED TO INDIRECT, CONSEQUENTIAL, PUNITIVE
+OR INCIDENTAL DAMAGES, EVEN IF YOU GIVE NOTICE OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+If you discover a Defect in this etext within 90 days of
+receiving it, you can receive a refund of the money (if any)
+you paid for it by sending an explanatory note within that
+time to the person you received it from.  If you received it
+on a physical medium, you must return it with your note, and
+such person may choose to alternatively give you a replacement
+copy.  If you received it electronically, such person may
+choose to alternatively give you a second opportunity to
+receive it electronically.
+
+THIS ETEXT IS OTHERWISE PROVIDED TO YOU "AS-IS".  NO OTHER
+WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, ARE MADE TO YOU AS
+TO THE ETEXT OR ANY MEDIUM IT MAY BE ON, INCLUDING BUT NOT
+LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
+PARTICULAR PURPOSE.
+
+Some states do not allow disclaimers of implied warranties or
+the exclusion or limitation of consequential damages, so the
+above disclaimers and exclusions may not apply to you, and you
+may have other legal rights.
+
+INDEMNITY
+You will indemnify and hold the Project, its directors,
+officers, members and agents harmless from all liability, cost
+and expense, including legal fees, that arise directly or
+indirectly from any of the following that you do or cause:
+[1] distribution of this etext, [2] alteration, modification,
+or addition to the etext, or [3] any Defect.
+
+DISTRIBUTION UNDER "PROJECT GUTENBERG-tm"
+You may distribute copies of this etext electronically, or by
+disk, book or any other medium if you either delete this
+"Small Print!" and all other references to Project Gutenberg,
+or:
+
+[1]  Only give exact copies of it.  Among other things, this
+     requires that you do not remove, alter or modify the
+     etext or this "small print!" statement.  You may however,
+     if you wish, distribute this etext in machine readable
+     binary, compressed, mark-up, or proprietary form,
+     including any form resulting from conversion by word pro-
+     cessing or hypertext software, but only so long as
+     *EITHER*:
+
+     [*]  The etext, when displayed, is clearly readable, and
+          does *not* contain characters other than those
+          intended by the author of the work, although tilde
+          (~), asterisk (*) and underline (_) characters may
+          be used to convey punctuation intended by the
+          author, and additional characters may be used to
+          indicate hypertext links; OR
+
+     [*]  The etext may be readily converted by the reader at
+          no expense into plain ASCII, EBCDIC or equivalent
+          form by the program that displays the etext (as is
+          the case, for instance, with most word processors);
+          OR
+
+     [*]  You provide, or agree to also provide on request at
+          no additional cost, fee or expense, a copy of the
+          etext in its original plain ASCII form (or in EBCDIC
+          or other equivalent proprietary form).
+
+[2]  Honor the etext refund and replacement provisions of this
+     "Small Print!" statement.
+
+[3]  Pay a trademark license fee to the Project of 20% of the
+     net profits you derive calculated using the method you
+     already use to calculate your applicable taxes.  If you
+     don't derive profits, no royalty is due.  Royalties are
+     payable to "Project Gutenberg Association/Carnegie-Mellon
+     University" within the 60 days following each
+     date you prepare (or were legally required to prepare)
+     your annual (or equivalent periodic) tax return.
+
+WHAT IF YOU *WANT* TO SEND MONEY EVEN IF YOU DON'T HAVE TO?
+The Project gratefully accepts contributions in money, time,
+scanning machines, OCR software, public domain etexts, royalty
+free copyright licenses, and every other sort of contribution
+you can think of.  Money should be paid to "Project Gutenberg
+Association / Carnegie-Mellon University".
+
+*END*THE SMALL PRINT! FOR PUBLIC DOMAIN ETEXTS*Ver.04.29.93*END*
+
+
+
+
+
+
+ +
+

ALICE'S ADVENTURES IN WONDERLAND

+ +

Lewis Carroll

+ +

THE MILLENNIUM FULCRUM EDITION 3.0

+ +
+

CHAPTER I

+ +

Down the Rabbit-Hole

+ +

Alice was beginning to get very tired of sitting by her sister +on the bank, and of having nothing to do: once or twice she had +peeped into the book her sister was reading, but it had no +pictures or conversations in it, 'and what is the use of a book,' +thought Alice 'without pictures or conversation?'

+ +

So she was considering in her own mind (as well as she could, +for the hot day made her feel very sleepy and stupid), whether +the pleasure of making a daisy-chain would be worth the trouble +of getting up and picking the daisies, when suddenly a White +Rabbit with pink eyes ran close by her.

+ +

There was nothing so very remarkable in that; nor did +Alice think it so very much out of the way to hear the +Rabbit say to itself, 'Oh dear! Oh dear! I shall be late!' (when +she thought it over afterwards, it occurred to her that she ought +to have wondered at this, but at the time it all seemed quite +natural); but when the Rabbit actually took a watch out of its +waistcoat-pocket, and looked at it, and then hurried on, +Alice started to her feet, for it flashed across her mind that +she had never before seen a rabbit with either a +waistcoat-pocket, or a watch to take out of it, and burning with +curiosity, she ran across the field after it, and fortunately was +just in time to see it pop down a large rabbit-hole under the +hedge.

+ +

In another moment down went Alice after it, never once +considering how in the world she was to get out again.

+ +

The rabbit-hole went straight on like a tunnel for some way, +and then dipped suddenly down, so suddenly that Alice had not a +moment to think about stopping herself before she found herself +falling down a very deep well.

+ +

Either the well was very deep, or she fell very slowly, for +she had plenty of time as she went down to look about her and to +wonder what was going to happen next. First, she tried to look +down and make out what she was coming to, but it was too dark to +see anything; then she looked at the sides of the well, and +noticed that they were filled with cupboards and book-shelves; +here and there she saw maps and pictures hung upon pegs. She took +down a jar from one of the shelves as she passed; it was labelled +'ORANGE MARMALADE', but to her great disappointment it was empty: +she did not like to drop the jar for fear of killing somebody, so +managed to put it into one of the cupboards as she fell past +it.

+ +

'Well!' thought Alice to herself, 'after such a fall as this, +I shall think nothing of tumbling down stairs! How brave they'll +all think me at home! Why, I wouldn't say anything about it, even +if I fell off the top of the house!' (Which was very likely +true.)

+ +

Down, down, down. Would the fall never come to an end! +'I wonder how many miles I've fallen by this time?' she said +aloud. 'I must be getting somewhere near the centre of the earth. +Let me see: that would be four thousand miles down, I think--' +(for, you see, Alice had learnt several things of this sort in +her lessons in the schoolroom, and though this was not a very +good opportunity for showing off her knowledge, as there was no +one to listen to her, still it was good practice to say it over) +'--yes, that's about the right distance--but then I wonder what +Latitude or Longitude I've got to?' (Alice had no idea what +Latitude was, or Longitude either, but thought they were nice +grand words to say.)

+ +

Presently she began again. 'I wonder if I shall fall right +through the earth! How funny it'll seem to come out among +the people that walk with their heads downward! The Antipathies, +I think--' (she was rather glad there was no one listening, this +time, as it didn't sound at all the right word) '--but I shall +have to ask them what the name of the country is, you know. +Please, Ma'am, is this New Zealand or Australia?' (and she tried +to curtsey as she spoke--fancy curtseying as you're +falling through the air! Do you think you could manage it?) 'And +what an ignorant little girl she'll think me for asking! No, +it'll never do to ask: perhaps I shall see it written up +somewhere.'

+ +

Down, down, down. There was nothing else to do, so Alice soon +began talking again. 'Dinah'll miss me very much to-night, I +should think!' (Dinah was the cat.) 'I hope they'll remember her +saucer of milk at tea-time. Dinah my dear! I wish you were down +here with me! There are no mice in the air, I'm afraid, but you +might catch a bat, and that's very like a mouse, you know. But do +cats eat bats, I wonder?' And here Alice began to get rather +sleepy, and went on saying to herself, in a dreamy sort of way, +'Do cats eat bats? Do cats eat bats?' and sometimes, 'Do bats eat +cats?' for, you see, as she couldn't answer either question, it +didn't much matter which way she put it. She felt that she was +dozing off, and had just begun to dream that she was walking hand +in hand with Dinah, and saying to her very earnestly, 'Now, +Dinah, tell me the truth: did you ever eat a bat?' when suddenly, +thump! thump! down she came upon a heap of sticks and dry leaves, +and the fall was over.

+ +

Alice was not a bit hurt, and she jumped up on to her feet in +a moment: she looked up, but it was all dark overhead; before her +was another long passage, and the White Rabbit was still in +sight, hurrying down it. There was not a moment to be lost: away +went Alice like the wind, and was just in time to hear it say, as +it turned a corner, 'Oh my ears and whiskers, how late it's +getting!' She was close behind it when she turned the corner, but +the Rabbit was no longer to be seen: she found herself in a long, +low hall, which was lit up by a row of lamps hanging from the +roof.

+ +

There were doors all round the hall, but they were all locked; +and when Alice had been all the way down one side and up the +other, trying every door, she walked sadly down the middle, +wondering how she was ever to get out again.

+ +

Suddenly she came upon a little three-legged table, all made +of solid glass; there was nothing on it except a tiny golden key, +and Alice's first thought was that it might belong to one of the +doors of the hall; but, alas! either the locks were too large, or +the key was too small, but at any rate it would not open any of +them. However, on the second time round, she came upon a low +curtain she had not noticed before, and behind it was a little +door about fifteen inches high: she tried the little golden key +in the lock, and to her great delight it fitted!

+ +

Alice opened the door and found that it led into a small +passage, not much larger than a rat-hole: she knelt down and +looked along the passage into the loveliest garden you ever saw. +How she longed to get out of that dark hall, and wander about +among those beds of bright flowers and those cool fountains, but +she could not even get her head though the doorway; 'and even if +my head would go through,' thought poor Alice, 'it would +be of very little use without my shoulders. Oh, how I wish I +could shut up like a telescope! I think I could, if I only know +how to begin.' For, you see, so many out-of-the-way things had +happened lately, that Alice had begun to think that very few +things indeed were really impossible.

+ +

There seemed to be no use in waiting by the little door, so +she went back to the table, half hoping she might find another +key on it, or at any rate a book of rules for shutting people up +like telescopes: this time she found a little bottle on it, +('which certainly was not here before,' said Alice,) and round +the neck of the bottle was a paper label, with the words 'DRINK +ME' beautifully printed on it in large letters.

+ +

It was all very well to say 'Drink me,' but the wise little +Alice was not going to do that in a hurry. 'No, I'll look +first,' she said, 'and see whether it's marked "poison" or +not'; for she had read several nice little histories about +children who had got burnt, and eaten up by wild beasts and other +unpleasant things, all because they would not remember the +simple rules their friends had taught them: such as, that a +red-hot poker will burn you if you hold it too long; and that if +you cut your finger very deeply with a knife, it usually +bleeds; and she had never forgotten that, if you drink much from +a bottle marked 'poison,' it is almost certain to disagree +with you, sooner or later.

+ +

However, this bottle was not marked 'poison,' so Alice +ventured to taste it, and finding it very nice, (it had, in fact, +a sort of mixed flavour of cherry-tart, custard, pine-apple, +roast turkey, toffee, and hot buttered toast,) she very soon +finished it off.

+ +

+
+*     *     *     *     * +
+*     *     *     * +
+*     *     *     *     * +
+

+ +

'What a curious feeling!' said Alice; 'I must be shutting up +like a telescope.'

+ +

And so it was indeed: she was now only ten inches high, and +her face brightened up at the thought that she was now the right +size for going through the little door into that lovely garden. +First, however, she waited for a few minutes to see if she was +going to shrink any further: she felt a little nervous about +this; 'for it might end, you know,' said Alice to herself, 'in my +going out altogether, like a candle. I wonder what I should be +like then?' And she tried to fancy what the flame of a candle is +like after the candle is blown out, for she could not remember +ever having seen such a thing.

+ +

After a while, finding that nothing more happened, she decided +on going into the garden at once; but, alas for poor Alice! when +she got to the door, she found she had forgotten the little +golden key, and when she went back to the table for it, she found +she could not possibly reach it: she could see it quite plainly +through the glass, and she tried her best to climb up one of the +legs of the table, but it was too slippery; and when she had +tired herself out with trying, the poor little thing sat down and +cried.

+ +

'Come, there's no use in crying like that!' said Alice to +herself, rather sharply; 'I advise you to leave off this minute!' +She generally gave herself very good advice, (though she very +seldom followed it), and sometimes she scolded herself so +severely as to bring tears into her eyes; and once she remembered +trying to box her own ears for having cheated herself in a game +of croquet she was playing against herself, for this curious +child was very fond of pretending to be two people. 'But it's no +use now,' thought poor Alice, 'to pretend to be two people! Why, +there's hardly enough of me left to make one respectable +person!'

+ +

Soon her eye fell on a little glass box that was lying under +the table: she opened it, and found in it a very small cake, on +which the words 'EAT ME' were beautifully marked in currants. +'Well, I'll eat it,' said Alice, 'and if it makes me grow larger, +I can reach the key; and if it makes me grow smaller, I can creep +under the door; so either way I'll get into the garden, and I +don't care which happens!'

+ +

She ate a little bit, and said anxiously to herself, 'Which +way? Which way?', holding her hand on the top of her head to feel +which way it was growing, and she was quite surprised to find +that she remained the same size: to be sure, this generally +happens when one eats cake, but Alice had got so much into the +way of expecting nothing but out-of-the-way things to happen, +that it seemed quite dull and stupid for life to go on in the +common way.

+ +

So she set to work, and very soon finished off the cake.

+ +

+
+*     *     *     *     * +
+*     *     *     * +
+*     *     *     *     * +
+

+ +
+

CHAPTER II

+ +

The Pool of Tears

+ +

'Curiouser and curiouser!' cried Alice (she was so much +surprised, that for the moment she quite forgot how to speak good +English); 'now I'm opening out like the largest telescope that +ever was! Good-bye, feet!' (for when she looked down at her feet, +they seemed to be almost out of sight, they were getting so far +off). 'Oh, my poor little feet, I wonder who will put on your +shoes and stockings for you now, dears? I'm sure I shan't +be able! I shall be a great deal too far off to trouble myself +about you: you must manage the best way you can; --but I must be +kind to them,' thought Alice, 'or perhaps they won't walk the way +I want to go! Let me see: I'll give them a new pair of boots +every Christmas.'

+ +

And she went on planning to herself how she would manage it. +'They must go by the carrier,' she thought; 'and how funny it'll +seem, sending presents to one's own feet! And how odd the +directions will look!

+ +
ALICE'S RIGHT FOOT, ESQ. +

HEARTHRUG,

+ +

NEAR THE FENDER,

+ +

(WITH ALICE'S LOVE).

+
+ +

Oh dear, what nonsense I'm talking!'

+ +

Just then her head struck against the roof of the hall: in +fact she was now more than nine feet high, and she at once took +up the little golden key and hurried off to the garden door.

+ +

Poor Alice! It was as much as she could do, lying down on one +side, to look through into the garden with one eye; but to get +through was more hopeless than ever: she sat down and began to +cry again.

+ +

'You ought to be ashamed of yourself,' said Alice, 'a great +girl like you,' (she might well say this), 'to go on crying in +this way! Stop this moment, I tell you!' But she went on all the +same, shedding gallons of tears, until there was a large pool all +round her, about four inches deep and reaching half down the +hall.

+ +

After a time she heard a little pattering of feet in the +distance, and she hastily dried her eyes to see what was coming. +It was the White Rabbit returning, splendidly dressed, with a +pair of white kid gloves in one hand and a large fan in the +other: he came trotting along in a great hurry, muttering to +himself as he came, 'Oh! the Duchess, the Duchess! Oh! +won't she be savage if I've kept her waiting!' Alice felt +so desperate that she was ready to ask help of any one; so, when +the Rabbit came near her, she began, in a low, timid voice, 'If +you please, sir--' The Rabbit started violently, dropped the +white kid gloves and the fan, and skurried away into the darkness +as hard as he could go.

+ +

Alice took up the fan and gloves, and, as the hall was very +hot, she kept fanning herself all the time she went on talking: +'Dear, dear! How queer everything is to-day! And yesterday things +went on just as usual. I wonder if I've been changed in the +night? Let me think: was I the same when I got up this +morning? I almost think I can remember feeling a little +different. But if I'm not the same, the next question is, Who in +the world am I? Ah, that's the great puzzle!' And she +began thinking over all the children she knew that were of the +same age as herself, to see if she could have been changed for +any of them.

+ +

'I'm sure I'm not Ada,' she said, 'for her hair goes in such +long ringlets, and mine doesn't go in ringlets at all; and I'm +sure I can't be Mabel, for I know all sorts of things, and she, +oh! she knows such a very little! Besides, she's she, and +I'm I, and--oh dear, how puzzling it all is! I'll try if I +know all the things I used to know. Let me see: four times five +is twelve, and four times six is thirteen, and four times seven +is--oh dear! I shall never get to twenty at that rate! However, +the Multiplication Table doesn't signify: let's try Geography. +London is the capital of Paris, and Paris is the capital of Rome, +and Rome--no, that's all wrong, I'm certain! I must have +been changed for Mabel! I'll try and say "How doth the +little--"' and she crossed her hands on her lap as if she +were saying lessons, and began to repeat it, but her voice +sounded hoarse and strange, and the words did not come the same +as they used to do:--

+ +
'How doth the little crocodile +

Improve his shining tail,

+ +

And pour the waters of the Nile

+ +

On every golden scale!

+ +


+'How cheerfully he seems to grin,

+ +

How neatly spread his claws,

+ +

And welcome little fishes in

+ +

With gently smiling jaws!'

+
+ +

'I'm sure those are not the right words,' said poor Alice, and +her eyes filled with tears again as she went on, 'I must be Mabel +after all, and I shall have to go and live in that poky little +house, and have next to no toys to play with, and oh! ever so +many lessons to learn! No, I've made up my mind about it; if I'm +Mabel, I'll stay down here! It'll be no use their putting their +heads down and saying "Come up again, dear!" I shall only look up +and say "Who am I then? Tell me that first, and then, if I like +being that person, I'll come up: if not, I'll stay down here till +I'm somebody else"--but, oh dear!' cried Alice, with a sudden +burst of tears, 'I do wish they would put their heads +down! I am so very tired of being all alone here!'

+ +

As she said this she looked down at her hands, and was +surprised to see that she had put on one of the Rabbit's little +white kid gloves while she was talking. 'How can I have +done that?' she thought. 'I must be growing small again.' She got +up and went to the table to measure herself by it, and found +that, as nearly as she could guess, she was now about two feet +high, and was going on shrinking rapidly: she soon found out that +the cause of this was the fan she was holding, and she dropped it +hastily, just in time to avoid shrinking away altogether.

+ +

'That was a narrow escape!' said Alice, a good deal +frightened at the sudden change, but very glad to find herself +still in existence; 'and now for the garden!' and she ran with +all speed back to the little door: but, alas! the little door was +shut again, and the little golden key was lying on the glass +table as before, 'and things are worse than ever,' thought the +poor child, 'for I never was so small as this before, never! And +I declare it's too bad, that it is!'

+ +

As she said these words her foot slipped, and in another +moment, splash! she was up to her chin in salt water. Her first +idea was that she had somehow fallen into the sea, 'and in that +case I can go back by railway,' she said to herself. (Alice had +been to the seaside once in her life, and had come to the general +conclusion, that wherever you go to on the English coast you find +a number of bathing machines in the sea, some children digging in +the sand with wooden spades, then a row of lodging houses, and +behind them a railway station.) However, she soon made out that +she was in the pool of tears which she had wept when she was nine +feet high.

+ +

'I wish I hadn't cried so much!' said Alice, as she swam +about, trying to find her way out. 'I shall be punished for it +now, I suppose, by being drowned in my own tears! That +will be a queer thing, to be sure! However, everything is +queer to-day.'

+ +

Just then she heard something splashing about in the pool a +little way off, and she swam nearer to make out what it was: at +first she thought it must be a walrus or hippopotamus, but then +she remembered how small she was now, and she soon made out that +it was only a mouse that had slipped in like herself.

+ +

'Would it be of any use, now,' thought Alice, 'to speak to +this mouse? Everything is so out-of-the-way down here, that I +should think very likely it can talk: at any rate, there's no +harm in trying.' So she began: 'O Mouse, do you know the way out +of this pool? I am very tired of swimming about here, O Mouse!' +(Alice thought this must be the right way of speaking to a mouse: +she had never done such a thing before, but she remembered having +seen in her brother's Latin Grammar, 'A mouse--of a mouse--to a +mouse--a mouse--O mouse!') The Mouse looked at her rather +inquisitively, and seemed to her to wink with one of its little +eyes, but it said nothing.

+ +

'Perhaps it doesn't understand English,' thought Alice; 'I +daresay it's a French mouse, come over with William the +Conqueror.' (For, with all her knowledge of history, Alice had no +very clear notion how long ago anything had happened.) So she +began again: 'Ou est ma chatte?' which was the first sentence in +her French lesson-book. The Mouse gave a sudden leap out of the +water, and seemed to quiver all over with fright. 'Oh, I beg your +pardon!' cried Alice hastily, afraid that she had hurt the poor +animal's feelings. 'I quite forgot you didn't like cats.'

+ +

'Not like cats!' cried the Mouse, in a shrill, passionate +voice. 'Would you like cats if you were me?'

+ +

'Well, perhaps not,' said Alice in a soothing tone: 'don't be +angry about it. And yet I wish I could show you our cat Dinah: I +think you'd take a fancy to cats if you could only see her. She +is such a dear quiet thing,' Alice went on, half to herself, as +she swam lazily about in the pool, 'and she sits purring so +nicely by the fire, licking her paws and washing her face--and +she is such a nice soft thing to nurse--and she's such a capital +one for catching mice--oh, I beg your pardon!' cried Alice again, +for this time the Mouse was bristling all over, and she felt +certain it must be really offended. 'We won't talk about her any +more if you'd rather not.'

+ +

'We indeed!' cried the Mouse, who was trembling down to the +end of his tail. 'As if I would talk on such a subject! Our +family always hated cats: nasty, low, vulgar things! Don't +let me hear the name again!'

+ +

'I won't indeed!' said Alice, in a great hurry to change the +subject of conversation. 'Are you--are you fond--of--of dogs?' +The Mouse did not answer, so Alice went on eagerly: 'There is +such a nice little dog near our house I should like to show you! +A little bright-eyed terrier, you know, with oh, such long curly +brown hair! And it'll fetch things when you throw them, and it'll +sit up and beg for its dinner, and all sorts of things--I can't +remember half of them--and it belongs to a farmer, you know, and +he says it's so useful, it's worth a hundred pounds! He says it +kills all the rats and--oh dear!' cried Alice in a sorrowful +tone, 'I'm afraid I've offended it again!' For the Mouse was +swimming away from her as hard as it could go, and making quite a +commotion in the pool as it went.

+ +

So she called softly after it, 'Mouse dear! Do come back +again, and we won't talk about cats or dogs either, if you don't +like them!' When the Mouse heard this, it turned round and swam +slowly back to her: its face was quite pale (with passion, Alice +thought), and it said in a low trembling voice, 'Let us get to +the shore, and then I'll tell you my history, and you'll +understand why it is I hate cats and dogs.'

+ +

It was high time to go, for the pool was getting quite crowded +with the birds and animals that had fallen into it: there were a +Duck and a Dodo, a Lory and an Eaglet, and several other curious +creatures. Alice led the way, and the whole party swam to the +shore.

+ +
+

CHAPTER III

+ +

A Caucus-Race and a Long Tale

+ +

They were indeed a queer-looking party that assembled on the +bank--the birds with draggled feathers, the animals with their +fur clinging close to them, and all dripping wet, cross, and +uncomfortable.

+ +

The first question of course was, how to get dry again: they +had a consultation about this, and after a few minutes it seemed +quite natural to Alice to find herself talking familiarly with +them, as if she had known them all her life. Indeed, she had +quite a long argument with the Lory, who at last turned sulky, +and would only say, 'I am older than you, and must know better'; +and this Alice would not allow without knowing how old it was, +and, as the Lory positively refused to tell its age, there was no +more to be said.

+ +

At last the Mouse, who seemed to be a person of authority +among them, called out, 'Sit down, all of you, and listen to me! +I'll soon make you dry enough!' They all sat down at once, +in a large ring, with the Mouse in the middle. Alice kept her +eyes anxiously fixed on it, for she felt sure she would catch a +bad cold if she did not get dry very soon.

+ +

'Ahem!' said the Mouse with an important air, 'are you all +ready? This is the driest thing I know. Silence all round, if you +please! "William the Conqueror, whose cause was favoured by the +pope, was soon submitted to by the English, who wanted leaders, +and had been of late much accustomed to usurpation and conquest. +Edwin and Morcar, the earls of Mercia and Northumbria--"'

+ +

'Ugh!' said the Lory, with a shiver.

+ +

'I beg your pardon!' said the Mouse, frowning, but very +politely: 'Did you speak?'

+ +

'Not I!' said the Lory hastily.

+ +

'I thought you did,' said the Mouse. '--I proceed. "Edwin and +Morcar, the earls of Mercia and Northumbria, declared for him: +and even Stigand, the patriotic archbishop of Canterbury, found +it advisable--"'

+ +

'Found what?' said the Duck.

+ +

'Found it,' the Mouse replied rather crossly: 'of +course you know what "it" means.'

+ +

'I know what "it" means well enough, when I find a +thing,' said the Duck: 'it's generally a frog or a worm. The +question is, what did the archbishop find?'

+ +

The Mouse did not notice this question, but hurriedly went on, +'"--found it advisable to go with Edgar Atheling to meet William +and offer him the crown. William's conduct at first was moderate. +But the insolence of his Normans--" How are you getting on now, +my dear?' it continued, turning to Alice as it spoke.

+ +

'As wet as ever,' said Alice in a melancholy tone: 'it doesn't +seem to dry me at all.'

+ +

'In that case,' said the Dodo solemnly, rising to its feet, 'I +move that the meeting adjourn, for the immediate adoption of more +energetic remedies--'

+ +

'Speak English!' said the Eaglet. 'I don't know the meaning of +half those long words, and, what's more, I don't believe you do +either!' And the Eaglet bent down its head to hide a smile: some +of the other birds tittered audibly.

+ +

'What I was going to say,' said the Dodo in an offended tone, +'was, that the best thing to get us dry would be a +Caucus-race.'

+ +

'What is a Caucus-race?' said Alice; not that she +wanted much to know, but the Dodo had paused as if it thought +that somebody ought to speak, and no one else seemed +inclined to say anything.

+ +

'Why,' said the Dodo, 'the best way to explain it is to do +it.' (And, as you might like to try the thing yourself, some +winter day, I will tell you how the Dodo managed it.)

+ +

First it marked out a race-course, in a sort of circle, ('the +exact shape doesn't matter,' it said,) and then all the party +were placed along the course, here and there. There was no 'One, +two, three, and away,' but they began running when they liked, +and left off when they liked, so that it was not easy to know +when the race was over. However, when they had been running half +an hour or so, and were quite dry again, the Dodo suddenly called +out 'The race is over!' and they all crowded round it, panting, +and asking, 'But who has won?'

+ +

This question the Dodo could not answer without a great deal +of thought, and it sat for a long time with one finger pressed +upon its forehead (the position in which you usually see +Shakespeare, in the pictures of him), while the rest waited in +silence. At last the Dodo said, 'everybody has won, and +all must have prizes.'

+ +

'But who is to give the prizes?' quite a chorus of voices +asked.

+ +

'Why, she, of course,' said the Dodo, pointing to Alice +with one finger; and the whole party at once crowded round her, +calling out in a confused way, 'Prizes! Prizes!'

+ +

Alice had no idea what to do, and in despair she put her hand +in her pocket, and pulled out a box of comfits, (luckily the salt +water had not got into it), and handed them round as prizes. +There was exactly one a-piece all round.

+ +

'But she must have a prize herself, you know,' said the +Mouse.

+ +

'Of course,' the Dodo replied very gravely. 'What else have +you got in your pocket?' he went on, turning to Alice.

+ +

'Only a thimble,' said Alice sadly.

+ +

'Hand it over here,' said the Dodo.

+ +

Then they all crowded round her once more, while the Dodo +solemnly presented the thimble, saying 'We beg your acceptance of +this elegant thimble'; and, when it had finished this short +speech, they all cheered.

+ +

Alice thought the whole thing very absurd, but they all looked +so grave that she did not dare to laugh; and, as she could not +think of anything to say, she simply bowed, and took the thimble, +looking as solemn as she could.

+ +

The next thing was to eat the comfits: this caused some noise +and confusion, as the large birds complained that they could not +taste theirs, and the small ones choked and had to be patted on +the back. However, it was over at last, and they sat down again +in a ring, and begged the Mouse to tell them something more.

+ +

'You promised to tell me your history, you know,' said Alice, +'and why it is you hate--C and D,' she added in a whisper, half +afraid that it would be offended again.

+ +

'Mine is a long and a sad tale!' said the Mouse, turning to +Alice, and sighing.

+ +

'It is a long tail, certainly,' said Alice, looking down with +wonder at the Mouse's tail; 'but why do you call it sad?' And she +kept on puzzling about it while the Mouse was speaking, so that +her idea of the tale was something like this:--

+ +

'Fury said to a mouse, That he met in the house, "Let us both +go to law: I will prosecute you. --Come, I'll take no +denial; We must have a trial: For really this morning I've +nothing to do." Said the mouse to the cur, "Such a trial, dear +Sir, With no jury or judge, would be wasting our breath." "I'll be +judge, I'll be jury," said cunning old Fury: "I'll try the whole +cause, and condemn you to death."'

+ +

'You are not attending!' said the Mouse to Alice severely. +'What are you thinking of?'

+ +

'I beg your pardon,' said Alice very humbly: 'you had got to +the fifth bend, I think?'

+ +

'I had not!' cried the Mouse, sharply and very +angrily.

+ +

'A knot!' said Alice, always ready to make herself useful, and +looking anxiously about her. 'Oh, do let me help to undo it!'

+ +

'I shall do nothing of the sort,' said the Mouse, getting up +and walking away. 'You insult me by talking such nonsense!'

+ +

'I didn't mean it!' pleaded poor Alice. 'But you're so easily +offended, you know!'

+ +

The Mouse only growled in reply.

+ +

'Please come back and finish your story!' Alice called after +it; and the others all joined in chorus, 'Yes, please do!' but +the Mouse only shook its head impatiently, and walked a little +quicker.

+ +

'What a pity it wouldn't stay!' sighed the Lory, as soon as it +was quite out of sight; and an old Crab took the opportunity of +saying to her daughter 'Ah, my dear! Let this be a lesson to you +never to lose your temper!' 'Hold your tongue, Ma!' said +the young Crab, a little snappishly. 'You're enough to try the +patience of an oyster!'

+ +

'I wish I had our Dinah here, I know I do!' said Alice aloud, +addressing nobody in particular. 'She'd soon fetch it back!'

+ +

'And who is Dinah, if I might venture to ask the question?' +said the Lory.

+ +

Alice replied eagerly, for she was always ready to talk about +her pet: 'Dinah's our cat. And she's such a capital one for +catching mice you can't think! And oh, I wish you could see her +after the birds! Why, she'll eat a little bird as soon as look at +it!'

+ +

This speech caused a remarkable sensation among the party. +Some of the birds hurried off at once: one old Magpie began +wrapping itself up very carefully, remarking, 'I really must be +getting home; the night-air doesn't suit my throat!' and a Canary +called out in a trembling voice to its children, 'Come away, my +dears! It's high time you were all in bed!' On various pretexts +they all moved off, and Alice was soon left alone.

+ +

'I wish I hadn't mentioned Dinah!' she said to herself in a +melancholy tone. 'Nobody seems to like her, down here, and I'm +sure she's the best cat in the world! Oh, my dear Dinah! I wonder +if I shall ever see you any more!' And here poor Alice began to +cry again, for she felt very lonely and low-spirited. In a little +while, however, she again heard a little pattering of footsteps +in the distance, and she looked up eagerly, half hoping that the +Mouse had changed his mind, and was coming back to finish his +story.

+ +
+

CHAPTER IV

+ +

The Rabbit Sends in a Little Bill

+ +

It was the White Rabbit, trotting slowly back again, and +looking anxiously about as it went, as if it had lost something; +and she heard it muttering to itself 'The Duchess! The Duchess! +Oh my dear paws! Oh my fur and whiskers! She'll get me executed, +as sure as ferrets are ferrets! Where can I have dropped +them, I wonder?' Alice guessed in a moment that it was looking +for the fan and the pair of white kid gloves, and she very +good-naturedly began hunting about for them, but they were +nowhere to be seen--everything seemed to have changed since her +swim in the pool, and the great hall, with the glass table and +the little door, had vanished completely.

+ +

Very soon the Rabbit noticed Alice, as she went hunting about, +and called out to her in an angry tone, 'Why, Mary Ann, what +are you doing out here? Run home this moment, and fetch me +a pair of gloves and a fan! Quick, now!' And Alice was so much +frightened that she ran off at once in the direction it pointed +to, without trying to explain the mistake it had made.

+ +

'He took me for his housemaid,' she said to herself as she +ran. 'How surprised he'll be when he finds out who I am! But I'd +better take him his fan and gloves--that is, if I can find them.' +As she said this, she came upon a neat little house, on the door +of which was a bright brass plate with the name 'W. RABBIT' +engraved upon it. She went in without knocking, and hurried +upstairs, in great fear lest she should meet the real Mary Ann, +and be turned out of the house before she had found the fan and +gloves.

+ +

'How queer it seems,' Alice said to herself, 'to be going +messages for a rabbit! I suppose Dinah'll be sending me on +messages next!' And she began fancying the sort of thing that +would happen: '"Miss Alice! Come here directly, and get ready for +your walk!" "Coming in a minute, nurse! But I've got to see that +the mouse doesn't get out." Only I don't think,' Alice went on, +'that they'd let Dinah stop in the house if it began ordering +people about like that!'

+ +

By this time she had found her way into a tidy little room +with a table in the window, and on it (as she had hoped) a fan +and two or three pairs of tiny white kid gloves: she took up the +fan and a pair of the gloves, and was just going to leave the +room, when her eye fell upon a little bottle that stood near the +looking- glass. There was no label this time with the words +'DRINK ME,' but nevertheless she uncorked it and put it to her +lips. 'I know something interesting is sure to happen,' +she said to herself, 'whenever I eat or drink anything; so I'll +just see what this bottle does. I do hope it'll make me grow +large again, for really I'm quite tired of being such a tiny +little thing!'

+ +

It did so indeed, and much sooner than she had expected: +before she had drunk half the bottle, she found her head pressing +against the ceiling, and had to stoop to save her neck from being +broken. She hastily put down the bottle, saying to herself +'That's quite enough--I hope I shan't grow any more--As it is, I +can't get out at the door--I do wish I hadn't drunk quite so +much!'

+ +

Alas! it was too late to wish that! She went on growing, and +growing, and very soon had to kneel down on the floor: in another +minute there was not even room for this, and she tried the effect +of lying down with one elbow against the door, and the other arm +curled round her head. Still she went on growing, and, as a last +resource, she put one arm out of the window, and one foot up the +chimney, and said to herself 'Now I can do no more, whatever +happens. What will become of me?'

+ +

Luckily for Alice, the little magic bottle had now had its +full effect, and she grew no larger: still it was very +uncomfortable, and, as there seemed to be no sort of chance of +her ever getting out of the room again, no wonder she felt +unhappy.

+ +

'It was much pleasanter at home,' thought poor Alice, 'when +one wasn't always growing larger and smaller, and being ordered +about by mice and rabbits. I almost wish I hadn't gone down that +rabbit-hole--and yet--and yet--it's rather curious, you know, +this sort of life! I do wonder what can have happened to +me! When I used to read fairy-tales, I fancied that kind of thing +never happened, and now here I am in the middle of one! There +ought to be a book written about me, that there ought! And when I +grow up, I'll write one--but I'm grown up now,' she added in a +sorrowful tone; 'at least there's no room to grow up any more +here.'

+ +

'But then,' thought Alice, 'shall I never get any older +than I am now? That'll be a comfort, one way--never to be an old +woman-- but then--always to have lessons to learn! Oh, I +shouldn't like that!'

+ +

'Oh, you foolish Alice!' she answered herself. 'How can you +learn lessons in here? Why, there's hardly room for you, and no +room at all for any lesson-books!'

+ +

And so she went on, taking first one side and then the other, +and making quite a conversation of it altogether; but after a few +minutes she heard a voice outside, and stopped to listen.

+ +

'Mary Ann! Mary Ann!' said the voice. 'Fetch me my gloves this +moment!' Then came a little pattering of feet on the stairs. +Alice knew it was the Rabbit coming to look for her, and she +trembled till she shook the house, quite forgetting that she was +now about a thousand times as large as the Rabbit, and had no +reason to be afraid of it.

+ +

Presently the Rabbit came up to the door, and tried to open +it; but, as the door opened inwards, and Alice's elbow was +pressed hard against it, that attempt proved a failure. Alice +heard it say to itself 'Then I'll go round and get in at the +window.'

+ +

'That you won't' thought Alice, and, after waiting till +she fancied she heard the Rabbit just under the window, she +suddenly spread out her hand, and made a snatch in the air. She +did not get hold of anything, but she heard a little shriek and a +fall, and a crash of broken glass, from which she concluded that +it was just possible it had fallen into a cucumber-frame, or +something of the sort.

+ +

Next came an angry voice--the Rabbit's--'Pat! Pat! Where are +you?' And then a voice she had never heard before, 'Sure then I'm +here! Digging for apples, yer honour!'

+ +

'Digging for apples, indeed!' said the Rabbit angrily. 'Here! +Come and help me out of this!' (Sounds of more broken +glass.)

+ +

'Now tell me, Pat, what's that in the window?'

+ +

'Sure, it's an arm, yer honour!' (He pronounced it +'arrum.')

+ +

'An arm, you goose! Who ever saw one that size? Why, it fills +the whole window!'

+ +

'Sure, it does, yer honour: but it's an arm for all that.'

+ +

'Well, it's got no business there, at any rate: go and take it +away!'

+ +

There was a long silence after this, and Alice could only hear +whispers now and then; such as, 'Sure, I don't like it, yer +honour, at all, at all!' 'Do as I tell you, you coward!' and at +last she spread out her hand again, and made another snatch in +the air. This time there were two little shrieks, and more +sounds of broken glass. 'What a number of cucumber-frames there +must be!' thought Alice. 'I wonder what they'll do next! As for +pulling me out of the window, I only wish they could! I'm +sure I don't want to stay in here any longer!'

+ +

She waited for some time without hearing anything more: at +last came a rumbling of little cartwheels, and the sound of a +good many voices all talking together: she made out the words: +'Where's the other ladder?--Why, I hadn't to bring but one; +Bill's got the other--Bill! fetch it here, lad!--Here, put 'em up +at this corner--No, tie 'em together first--they don't reach half +high enough yet--Oh! they'll do well enough; don't be +particular-- Here, Bill! catch hold of this rope--Will the roof +bear?--Mind that loose slate--Oh, it's coming down! Heads below!' +(a loud crash)--'Now, who did that?--It was Bill, I fancy--Who's +to go down the chimney?--Nay, I shan't! you do it!--That I +won't, then!--Bill's to go down--Here, Bill! the master says +you're to go down the chimney!'

+ +

'Oh! So Bill's got to come down the chimney, has he?' said +Alice to herself. 'Shy, they seem to put everything upon Bill! I +wouldn't be in Bill's place for a good deal: this fireplace is +narrow, to be sure; but I think I can kick a little!'

+ +

She drew her foot as far down the chimney as she could, and +waited till she heard a little animal (she couldn't guess of what +sort it was) scratching and scrambling about in the chimney close +above her: then, saying to herself 'This is Bill,' she gave one +sharp kick, and waited to see what would happen next.

+ +

The first thing she heard was a general chorus of 'There goes +Bill!' then the Rabbit's voice along--'Catch him, you by the +hedge!' then silence, and then another confusion of voices--'Hold +up his head--Brandy now--Don't choke him--How was it, old fellow? +What happened to you? Tell us all about it!'

+ +

Last came a little feeble, squeaking voice, ('That's Bill,' +thought Alice,) 'Well, I hardly know--No more, thank ye; I'm +better now--but I'm a deal too flustered to tell you--all I know +is, something comes at me like a Jack-in-the-box, and up I goes +like a sky-rocket!'

+ +

'So you did, old fellow!' said the others.

+ +

'We must burn the house down!' said the Rabbit's voice; and +Alice called out as loud as she could, 'If you do. I'll set Dinah +at you!'

+ +

There was a dead silence instantly, and Alice thought to +herself, 'I wonder what they will do next! If they had any +sense, they'd take the roof off.' After a minute or two, they +began moving about again, and Alice heard the Rabbit say, 'A +barrowful will do, to begin with.'

+ +

'A barrowful of what?' thought Alice; but she had not +long to doubt, for the next moment a shower of little pebbles +came rattling in at the window, and some of them hit her in the +face. 'I'll put a stop to this,' she said to herself, and shouted +out, 'You'd better not do that again!' which produced another +dead silence.

+ +

Alice noticed with some surprise that the pebbles were all +turning into little cakes as they lay on the floor, and a bright +idea came into her head. 'If I eat one of these cakes,' she +thought, 'it's sure to make some change in my size; and as +it can't possibly make me larger, it must make me smaller, I +suppose.'

+ +

So she swallowed one of the cakes, and was delighted to find +that she began shrinking directly. As soon as she was small +enough to get through the door, she ran out of the house, and +found quite a crowd of little animals and birds waiting outside. +The poor little Lizard, Bill, was in the middle, being held up by +two guinea-pigs, who were giving it something out of a bottle. +They all made a rush at Alice the moment she appeared; but she +ran off as hard as she could, and soon found herself safe in a +thick wood.

+ +

'The first thing I've got to do,' said Alice to herself, as +she wandered about in the wood, 'is to grow to my right size +again; and the second thing is to find my way into that lovely +garden. I think that will be the best plan.'

+ +

It sounded an excellent plan, no doubt, and very neatly and +simply arranged; the only difficulty was, that she had not the +smallest idea how to set about it; and while she was peering +about anxiously among the trees, a little sharp bark just over +her head made her look up in a great hurry.

+ +

An enormous puppy was looking down at her with large round +eyes, and feebly stretching out one paw, trying to touch her. +'Poor little thing!' said Alice, in a coaxing tone, and she tried +hard to whistle to it; but she was terribly frightened all the +time at the thought that it might be hungry, in which case it +would be very likely to eat her up in spite of all her +coaxing.

+ +

Hardly knowing what she did, she picked up a little bit of +stick, and held it out to the puppy; whereupon the puppy jumped +into the air off all its feet at once, with a yelp of delight, +and rushed at the stick, and made believe to worry it; then Alice +dodged behind a great thistle, to keep herself from being run +over; and the moment she appeared on the other side, the puppy +made another rush at the stick, and tumbled head over heels in +its hurry to get hold of it; then Alice, thinking it was very +like having a game of play with a cart-horse, and expecting every +moment to be trampled under its feet, ran round the thistle +again; then the puppy began a series of short charges at the +stick, running a very little way forwards each time and a long +way back, and barking hoarsely all the while, till at last it sat +down a good way off, panting, with its tongue hanging out of its +mouth, and its great eyes half shut.

+ +

This seemed to Alice a good opportunity for making her escape; +so she set off at once, and ran till she was quite tired and out +of breath, and till the puppy's bark sounded quite faint in the +distance.

+ +

'And yet what a dear little puppy it was!' said Alice, as she +leant against a buttercup to rest herself, and fanned herself +with one of the leaves: 'I should have liked teaching it tricks +very much, if--if I'd only been the right size to do it! Oh dear! +I'd nearly forgotten that I've got to grow up again! Let me +see--how is it to be managed? I suppose I ought to eat or drink +something or other; but the great question is, what?'

+ +

The great question certainly was, what? Alice looked all round +her at the flowers and the blades of grass, but she did not see +anything that looked like the right thing to eat or drink under +the circumstances. There was a large mushroom growing near her, +about the same height as herself; and when she had looked under +it, and on both sides of it, and behind it, it occurred to her +that she might as well look and see what was on the top of +it.

+ +

She stretched herself up on tiptoe, and peeped over the edge +of the mushroom, and her eyes immediately met those of a large +caterpillar, that was sitting on the top with its arms folded, +quietly smoking a long hookah, and taking not the smallest notice +of her or of anything else.

+ +
+

CHAPTER V

+ +

Advice from a Caterpillar

+ +

The Caterpillar and Alice looked at each other for some time +in silence: at last the Caterpillar took the hookah out of its +mouth, and addressed her in a languid, sleepy voice.

+ +

'Who are you?' said the Caterpillar.

+ +

This was not an encouraging opening for a conversation. Alice +replied, rather shyly, 'I--I hardly know, sir, just at present-- +at least I know who I was when I got up this morning, but I think +I must have been changed several times since then.'

+ +

'What do you mean by that?' said the Caterpillar sternly. +'Explain yourself!'

+ +

'I can't explain myself, I'm afraid, sir' said Alice, +'because I'm not myself, you see.'

+ +

'I don't see,' said the Caterpillar.

+ +

'I'm afraid I can't put it more clearly,' Alice replied very +politely, 'for I can't understand it myself to begin with; and +being so many different sizes in a day is very confusing.'

+ +

'It isn't,' said the Caterpillar.

+ +

'Well, perhaps you haven't found it so yet,' said Alice; 'but +when you have to turn into a chrysalis--you will some day, you +know--and then after that into a butterfly, I should think you'll +feel it a little queer, won't you?'

+ +

'Not a bit,' said the Caterpillar.

+ +

'Well, perhaps your feelings may be different,' said Alice; +'all I know is, it would feel very queer to me.'

+ +

'You!' said the Caterpillar contemptuously. 'Who are +you?'

+ +

Which brought them back again to the beginning of the +conversation. Alice felt a little irritated at the Caterpillar's +making such very short remarks, and she drew herself up +and said, very gravely, 'I think, you ought to tell me who +you are, first.'

+ +

'Why?' said the Caterpillar.

+ +

Here was another puzzling question; and as Alice could not +think of any good reason, and as the Caterpillar seemed to be in +a very unpleasant state of mind, she turned away.

+ +

'Come back!' the Caterpillar called after her. 'I've something +important to say!'

+ +

This sounded promising, certainly: Alice turned and came back +again.

+ +

'Keep your temper,' said the Caterpillar.

+ +

'Is that all?' said Alice, swallowing down her anger as well +as she could.

+ +

'No,' said the Caterpillar.

+ +

Alice thought she might as well wait, as she had nothing else +to do, and perhaps after all it might tell her something worth +hearing. For some minutes it puffed away without speaking, but at +last it unfolded its arms, took the hookah out of its mouth +again, and said, 'So you think you're changed, do you?'

+ +

'I'm afraid I am, sir,' said Alice; 'I can't remember things +as I used--and I don't keep the same size for ten minutes +together!'

+ +

'Can't remember what things?' said the Caterpillar.

+ +

'Well, I've tried to say "How doth the little busy +bee," but it all came different!' Alice replied in a very +melancholy voice.

+ +

'Repeat, "you are old, Father William,"' said the +Caterpillar.

+ +

Alice folded her hands, and began:--

+ +

'You are old, Father William,' the young man said, 'And +your hair has become very white; And yet you incessantly stand on +your head-- Do you think, at your age, it is right?'

+ +

'In my youth,' Father William replied to his son, 'I feared +it might injure the brain; But, now that I'm perfectly sure I +have none, Why, I do it again and again.'

+ +

'You are old,' said the youth, 'as I mentioned before, And +have grown most uncommonly fat; Yet you turned a back-somersault +in at the door-- Pray, what is the reason of that?'

+ +

'In my youth,' said the sage, as he shook his grey locks, +'I kept all my limbs very supple By the use of this ointment--one +shilling the box-- Allow me to sell you a couple?'

+ +

'You are old,' said the youth, 'and your jaws are too weak +For anything tougher than suet; Yet you finished the goose, with +the bones and the beak-- Pray how did you manage to do +it?'

+ +

'In my youth,' said his father, 'I took to the law, And +argued each case with my wife; And the muscular strength, which +it gave to my jaw, Has lasted the rest of my life.'

+ +

'You are old,' said the youth, 'one would hardly suppose +That your eye was as steady as ever; Yet you balanced an eel on +the end of your nose-- What made you so awfully clever?'

+ +

'I have answered three questions, and that is enough,' Said +his father; 'don't give yourself airs! Do you think I can listen +all day to such stuff? Be off, or I'll kick you down +stairs!'

+ +

'That is not said right,' said the Caterpillar.

+ +

'Not quite right, I'm afraid,' said Alice, timidly; +'some of the words have got altered.'

+ +

'It is wrong from beginning to end,' said the Caterpillar +decidedly, and there was silence for some minutes.

+ +

The Caterpillar was the first to speak.

+ +

'What size do you want to be?' it asked.

+ +

'Oh, I'm not particular as to size,' Alice hastily replied; +'only one doesn't like changing so often, you know.'

+ +

'I don't know,' said the Caterpillar.

+ +

Alice said nothing: she had never been so much contradicted in +her life before, and she felt that she was losing her temper.

+ +

'Are you content now?' said the Caterpillar.

+ +

'Well, I should like to be a little larger, sir, if you +wouldn't mind,' said Alice: 'three inches is such a wretched +height to be.'

+ +

'It is a very good height indeed!' said the Caterpillar +angrily, rearing itself upright as it spoke (it was exactly three +inches high).

+ +

'But I'm not used to it!' pleaded poor Alice in a piteous +tone. And she thought of herself, 'I wish the creatures wouldn't +be so easily offended!'

+ +

'You'll get used to it in time,' said the Caterpillar; and it +put the hookah into its mouth and began smoking again.

+ +

This time Alice waited patiently until it chose to speak +again. In a minute or two the Caterpillar took the hookah out of +its mouth and yawned once or twice, and shook itself. Then it got +down off the mushroom, and crawled away in the grass, merely +remarking as it went, 'One side will make you grow taller, and +the other side will make you grow shorter.'

+ +

'One side of what? The other side of what?' +thought Alice to herself.

+ +

'Of the mushroom,' said the Caterpillar, just as if she had +asked it aloud; and in another moment it was out of sight.

+ +

Alice remained looking thoughtfully at the mushroom for a +minute, trying to make out which were the two sides of it; and as +it was perfectly round, she found this a very difficult question. +However, at last she stretched her arms round it as far as they +would go, and broke off a bit of the edge with each hand.

+ +

'And now which is which?' she said to herself, and nibbled a +little of the right-hand bit to try the effect: the next moment +she felt a violent blow underneath her chin: it had struck her +foot!

+ +

She was a good deal frightened by this very sudden change, but +she felt that there was no time to be lost, as she was shrinking +rapidly; so she set to work at once to eat some of the other bit. +Her chin was pressed so closely against her foot, that there was +hardly room to open her mouth; but she did it at last, and +managed to swallow a morsel of the lefthand bit.

+ +

* * * * *

+ +

'Come, my head's free at last!' said Alice in a tone of +delight, which changed into alarm in another moment, when she +found that her shoulders were nowhere to be found: all she could +see, when she looked down, was an immense length of neck, which +seemed to rise like a stalk out of a sea of green leaves that lay +far below her.

+ +

'What can all that green stuff be?' said Alice. 'And +where have my shoulders got to? And oh, my poor hands, how +is it I can't see you?' She was moving them about as she spoke, +but no result seemed to follow, except a little shaking among the +distant green leaves.

+ +

As there seemed to be no chance of getting her hands up to her +head, she tried to get her head down to them, and was delighted +to find that her neck would bend about easily in any direction, +like a serpent. She had just succeeded in curving it down into a +graceful zigzag, and was going to dive in among the leaves, which +she found to be nothing but the tops of the trees under which she +had been wandering, when a sharp hiss made her draw back in a +hurry: a large pigeon had flown into her face, and was beating +her violently with its wings.

+ +

'Serpent!' screamed the Pigeon.

+ +

'I'm not a serpent!' said Alice indignantly. 'Let me +alone!'

+ +

'Serpent, I say again!' repeated the Pigeon, but in a more +subdued tone, and added with a kind of sob, 'I've tried every +way, and nothing seems to suit them!'

+ +

'I haven't the least idea what you're talking about,' said +Alice.

+ +

'I've tried the roots of trees, and I've tried banks, and I've +tried hedges,' the Pigeon went on, without attending to her; 'but +those serpents! There's no pleasing them!'

+ +

Alice was more and more puzzled, but she thought there was no +use in saying anything more till the Pigeon had finished.

+ +

'As if it wasn't trouble enough hatching the eggs,' said the +Pigeon; 'but I must be on the look-out for serpents night and +day! Why, I haven't had a wink of sleep these three weeks!'

+ +

'I'm very sorry you've been annoyed,' said Alice, who was +beginning to see its meaning.

+ +

'And just as I'd taken the highest tree in the wood,' +continued the Pigeon, raising its voice to a shriek, 'and just as +I was thinking I should be free of them at last, they must needs +come wriggling down from the sky! Ugh, Serpent!'

+ +

'But I'm not a serpent, I tell you!' said Alice. 'I'm +a--I'm a--'

+ +

'Well! what are you?' said the Pigeon. 'I can see +you're trying to invent something!'

+ +

'I--I'm a little girl,' said Alice, rather doubtfully, as she +remembered the number of changes she had gone through that +day.

+ +

'A likely story indeed!' said the Pigeon in a tone of the +deepest contempt. 'I've seen a good many little girls in my time, +but never one with such a neck as that! No, no! You're a +serpent; and there's no use denying it. I suppose you'll be +telling me next that you never tasted an egg!'

+ +

'I have tasted eggs, certainly,' said Alice, who was a +very truthful child; 'but little girls eat eggs quite as much as +serpents do, you know.'

+ +

'I don't believe it,' said the Pigeon; 'but if they do, why +then they're a kind of serpent, that's all I can say.'

+ +

This was such a new idea to Alice, that she was quite silent +for a minute or two, which gave the Pigeon the opportunity of +adding, 'You're looking for eggs, I know that well enough; +and what does it matter to me whether you're a little girl or a +serpent?'

+ +

'It matters a good deal to me,' said Alice hastily; +'but I'm not looking for eggs, as it happens; and if I was, I +shouldn't want yours: I don't like them raw.'

+ +

'Well, be off, then!' said the Pigeon in a sulky tone, as it +settled down again into its nest. Alice crouched down among the +trees as well as she could, for her neck kept getting entangled +among the branches, and every now and then she had to stop and +untwist it. After a while she remembered that she still held the +pieces of mushroom in her hands, and she set to work very +carefully, nibbling first at one and then at the other, and +growing sometimes taller and sometimes shorter, until she had +succeeded in bringing herself down to her usual height.

+ +

It was so long since she had been anything near the right +size, that it felt quite strange at first; but she got used to it +in a few minutes, and began talking to herself, as usual. 'Come, +there's half my plan done now! How puzzling all these changes +are! I'm never sure what I'm going to be, from one minute to +another! However, I've got back to my right size: the next thing +is, to get into that beautiful garden--how is that to be +done, I wonder?' As she said this, she came suddenly upon an open +place, with a little house in it about four feet high. 'Whoever +lives there,' thought Alice, 'it'll never do to come upon them +this size: why, I should frighten them out of their wits!' +So she began nibbling at the righthand bit again, and did not +venture to go near the house till she had brought herself down to +nine inches high.

+ +
+

CHAPTER VI

+ +

Pig and Pepper

+ +

For a minute or two she stood looking at the house, and +wondering what to do next, when suddenly a footman in livery came +running out of the wood--(she considered him to be a footman +because he was in livery: otherwise, judging by his face only, +she would have called him a fish)--and rapped loudly at the door +with his knuckles. It was opened by another footman in livery, +with a round face, and large eyes like a frog; and both footmen, +Alice noticed, had powdered hair that curled all over their +heads. She felt very curious to know what it was all about, and +crept a little way out of the wood to listen.

+ +

The Fish-Footman began by producing from under his arm a great +letter, nearly as large as himself, and this he handed over to +the other, saying, in a solemn tone, 'For the Duchess. An +invitation from the Queen to play croquet.' The Frog-Footman +repeated, in the same solemn tone, only changing the order of the +words a little, 'From the Queen. An invitation for the Duchess to +play croquet.'

+ +

Then they both bowed low, and their curls got entangled +together.

+ +

Alice laughed so much at this, that she had to run back into +the wood for fear of their hearing her; and when she next peeped +out the Fish-Footman was gone, and the other was sitting on the +ground near the door, staring stupidly up into the sky.

+ +

Alice went timidly up to the door, and knocked.

+ +

'There's no sort of use in knocking,' said the Footman, 'and +that for two reasons. First, because I'm on the same side of the +door as you are; secondly, because they're making such a noise +inside, no one could possibly hear you.' And certainly there was +a most extraordinary noise going on within--a constant howling +and sneezing, and every now and then a great crash, as if a dish +or kettle had been broken to pieces.

+ +

'Please, then,' said Alice, 'how am I to get in?'

+ +

'There might be some sense in your knocking,' the Footman went +on without attending to her, 'if we had the door between us. For +instance, if you were inside, you might knock, and I could +let you out, you know.' He was looking up into the sky all the +time he was speaking, and this Alice thought decidedly uncivil. +'But perhaps he can't help it,' she said to herself; 'his eyes +are so very nearly at the top of his head. But at any rate +he might answer questions.--How am I to get in?' she repeated, +aloud.

+ +

'I shall sit here,' the Footman remarked, 'till +tomorrow--'

+ +

At this moment the door of the house opened, and a large plate +came skimming out, straight at the Footman's head: it just grazed +his nose, and broke to pieces against one of the trees behind +him.

+ +

'--or next day, maybe,' the Footman continued in the same +tone, exactly as if nothing had happened.

+ +

'How am I to get in?' asked Alice again, in a louder tone.

+ +

'Are you to get in at all?' said the Footman. 'That's +the first question, you know.'

+ +

It was, no doubt: only Alice did not like to be told so. 'It's +really dreadful,' she muttered to herself, 'the way all the +creatures argue. It's enough to drive one crazy!'

+ +

The Footman seemed to think this a good opportunity for +repeating his remark, with variations. 'I shall sit here,' he +said, 'on and off, for days and days.'

+ +

'But what am I to do?' said Alice.

+ +

'Anything you like,' said the Footman, and began +whistling.

+ +

'Oh, there's no use in talking to him,' said Alice +desperately: 'he's perfectly idiotic!' And she opened the door +and went in.

+ +

The door led right into a large kitchen, which was full of +smoke from one end to the other: the Duchess was sitting on a +three-legged stool in the middle, nursing a baby; the cook was +leaning over the fire, stirring a large cauldron which seemed to +be full of soup.

+ +

'There's certainly too much pepper in that soup!' Alice said +to herself, as well as she could for sneezing.

+ +

There was certainly too much of it in the air. Even the +Duchess sneezed occasionally; and as for the baby, it was +sneezing and howling alternately without a moment's pause. The +only things in the kitchen that did not sneeze, were the cook, +and a large cat which was sitting on the hearth and grinning from +ear to ear.

+ +

'Please would you tell me,' said Alice, a little timidly, for +she was not quite sure whether it was good manners for her to +speak first, 'why your cat grins like that?'

+ +

'It's a Cheshire cat,' said the Duchess, 'and that's why. +Pig!'

+ +

She said the last word with such sudden violence that Alice +quite jumped; but she saw in another moment that it was addressed +to the baby, and not to her, so she took courage, and went on +again:--

+ +

'I didn't know that Cheshire cats always grinned; in fact, I +didn't know that cats could grin.'

+ +

'They all can,' said the Duchess; 'and most of 'em do.'

+ +

'I don't know of any that do,' Alice said very politely, +feeling quite pleased to have got into a conversation.

+ +

'You don't know much,' said the Duchess; 'and that's a +fact.'

+ +

Alice did not at all like the tone of this remark, and thought +it would be as well to introduce some other subject of +conversation. While she was trying to fix on one, the cook took +the cauldron of soup off the fire, and at once set to work +throwing everything within her reach at the Duchess and the baby +--the fire-irons came first; then followed a shower of saucepans, +plates, and dishes. The Duchess took no notice of them even when +they hit her; and the baby was howling so much already, that it +was quite impossible to say whether the blows hurt it or not.

+ +

'Oh, please mind what you're doing!' cried Alice, +jumping up and down in an agony of terror. 'Oh, there goes his +precious nose'; as an unusually large saucepan flew close +by it, and very nearly carried it off.

+ +

'If everybody minded their own business,' the Duchess said in +a hoarse growl, 'the world would go round a deal faster than it +does.'

+ +

'Which would not be an advantage,' said Alice, who felt +very glad to get an opportunity of showing off a little of her +knowledge. 'Just think of what work it would make with the day +and night! You see the earth takes twenty-four hours to turn +round on its axis--'

+ +

'Talking of axes,' said the Duchess, 'chop off her head!'

+ +

Alice glanced rather anxiously at the cook, to see if she +meant to take the hint; but the cook was busily stirring the +soup, and seemed not to be listening, so she went on again: +'Twenty-four hours, I think; or is it twelve? I--'

+ +

'Oh, don't bother me,' said the Duchess; 'I never could abide +figures!' And with that she began nursing her child again, +singing a sort of lullaby to it as she did so, and giving it a +violent shake at the end of every line:

+ +

'Speak roughly to your little boy,

+ +

And beat him when he sneezes:

+ +

He only does it to annoy,

+ +

Because he knows it teases.'

+ +

CHORUS

+ +

(In which the cook and the baby joined):--

+ +

'Wow! wow! wow!'

+ +

While the Duchess sang the second verse of the song, she kept +tossing the baby violently up and down, and the poor little thing +howled so, that Alice could hardly hear the words:--

+ +

'I speak severely to my boy,

+ +

I beat him when he sneezes;

+ +

For he can thoroughly enjoy

+ +

The pepper when he pleases!'

+ +

CHORUS

+ +

'Wow! wow! wow!'

+ +

'Here! you may nurse it a bit, if you like!' the Duchess said +to Alice, flinging the baby at her as she spoke. 'I must go and +get ready to play croquet with the Queen,' and she hurried out of +the room. The cook threw a frying-pan after her as she went out, +but it just missed her.

+ +

Alice caught the baby with some difficulty, as it was a queer- +shaped little creature, and held out its arms and legs in all +directions, 'just like a star-fish,' thought Alice. The poor +little thing was snorting like a steam-engine when she caught it, +and kept doubling itself up and straightening itself out again, +so that altogether, for the first minute or two, it was as much +as she could do to hold it.

+ +

As soon as she had made out the proper way of nursing it, +(which was to twist it up into a sort of knot, and then keep +tight hold of its right ear and left foot, so as to prevent its +undoing itself,) she carried it out into the open air. 'If +I don't take this child away with me,' thought Alice, 'they're +sure to kill it in a day or two: wouldn't it be murder to leave +it behind?' She said the last words out loud, and the little +thing grunted in reply (it had left off sneezing by this time). +'Don't grunt,' said Alice; 'that's not at all a proper way of +expressing yourself.'

+ +

The baby grunted again, and Alice looked very anxiously into +its face to see what was the matter with it. There could be no +doubt that it had a very turn-up nose, much more like a +snout than a real nose; also its eyes were getting extremely +small for a baby: altogether Alice did not like the look of the +thing at all. 'But perhaps it was only sobbing,' she thought, and +looked into its eyes again, to see if there were any tears.

+ +

No, there were no tears. 'If you're going to turn into a pig, +my dear,' said Alice, seriously, 'I'll have nothing more to do +with you. Mind now!' The poor little thing sobbed again (or +grunted, it was impossible to say which), and they went on for +some while in silence.

+ +

Alice was just beginning to think to herself, 'Now, what am I +to do with this creature when I get it home?' when it grunted +again, so violently, that she looked down into its face in some +alarm. This time there could be no mistake about it: it +was neither more nor less than a pig, and she felt that it would +be quite absurd for her to carry it further.

+ +

So she set the little creature down, and felt quite relieved +to see it trot away quietly into the wood. 'If it had grown up,' +she said to herself, 'it would have made a dreadfully ugly child: +but it makes rather a handsome pig, I think.' And she began +thinking over other children she knew, who might do very well as +pigs, and was just saying to herself, 'if one only knew the right +way to change them--' when she was a little startled by seeing +the Cheshire Cat sitting on a bough of a tree a few yards +off.

+ +

The Cat only grinned when it saw Alice. It looked good- +natured, she thought: still it had very long claws and a +great many teeth, so she felt that it ought to be treated with +respect.

+ +

'Cheshire Puss,' she began, rather timidly, as she did not at +all know whether it would like the name: however, it only grinned +a little wider. 'Come, it's pleased so far,' thought Alice, and +she went on. 'Would you tell me, please, which way I ought to go +from here?'

+ +

'That depends a good deal on where you want to get to,' said +the Cat.

+ +

'I don't much care where--' said Alice.

+ +

'Then it doesn't matter which way you go,' said the Cat.

+ +

'--so long as I get somewhere,' Alice added as an +explanation.

+ +

'Oh, you're sure to do that,' said the Cat, 'if you only walk +long enough.'

+ +

Alice felt that this could not be denied, so she tried another +question. 'What sort of people live about here?'

+ +

'In that direction,' the Cat said, waving its right paw +round, 'lives a Hatter: and in that direction,' waving the +other paw, 'lives a March Hare. Visit either you like: they're +both mad.'

+ +

'But I don't want to go among mad people,' Alice remarked.

+ +

'Oh, you can't help that,' said the Cat: 'we're all mad here. +I'm mad. You're mad.'

+ +

'How do you know I'm mad?' said Alice.

+ +

'You must be,' said the Cat, 'or you wouldn't have come +here.'

+ +

Alice didn't think that proved it at all; however, she went on +'And how do you know that you're mad?'

+ +

'To begin with,' said the Cat, 'a dog's not mad. You grant +that?'

+ +

'I suppose so,' said Alice.

+ +

'Well, then,' the Cat went on, 'you see, a dog growls when +it's angry, and wags its tail when it's pleased. Now I growl when +I'm pleased, and wag my tail when I'm angry. Therefore I'm +mad.'

+ +

'I call it purring, not growling,' said Alice.

+ +

'Call it what you like,' said the Cat. 'Do you play croquet +with the Queen to-day?'

+ +

'I should like it very much,' said Alice, 'but I haven't been +invited yet.'

+ +

'You'll see me there,' said the Cat, and vanished.

+ +

Alice was not much surprised at this, she was getting so used +to queer things happening. While she was looking at the place +where it had been, it suddenly appeared again.

+ +

'By-the-bye, what became of the baby?' said the Cat. 'I'd +nearly forgotten to ask.'

+ +

'It turned into a pig,' Alice quietly said, just as if it had +come back in a natural way.

+ +

'I thought it would,' said the Cat, and vanished again.

+ +

Alice waited a little, half expecting to see it again, but it +did not appear, and after a minute or two she walked on in the +direction in which the March Hare was said to live. 'I've seen +hatters before,' she said to herself; 'the March Hare will be +much the most interesting, and perhaps as this is May it won't be +raving mad--at least not so mad as it was in March.' As she said +this, she looked up, and there was the Cat again, sitting on a +branch of a tree.

+ +

'Did you say pig, or fig?' said the Cat.

+ +

'I said pig,' replied Alice; 'and I wish you wouldn't keep +appearing and vanishing so suddenly: you make one quite +giddy.'

+ +

'All right,' said the Cat; and this time it vanished quite +slowly, beginning with the end of the tail, and ending with the +grin, which remained some time after the rest of it had gone.

+ +

'Well! I've often seen a cat without a grin,' thought Alice; +'but a grin without a cat! It's the most curious thing I ever saw +in my life!'

+ +

She had not gone much farther before she came in sight of the +house of the March Hare: she thought it must be the right house, +because the chimneys were shaped like ears and the roof was +thatched with fur. It was so large a house, that she did not like +to go nearer till she had nibbled some more of the lefthand bit +of mushroom, and raised herself to about two feet high: even then +she walked up towards it rather timidly, saying to herself +'Suppose it should be raving mad after all! I almost wish I'd +gone to see the Hatter instead!'

+ +
+

CHAPTER VII

+ +

A Mad Tea-Party

+ +

There was a table set out under a tree in front of the house, +and the March Hare and the Hatter were having tea at it: a +Dormouse was sitting between them, fast asleep, and the other two +were using it as a cushion, resting their elbows on it, and +talking over its head. 'Very uncomfortable for the Dormouse,' +thought Alice; 'only, as it's asleep, I suppose it doesn't +mind.'

+ +

The table was a large one, but the three were all crowded +together at one corner of it: 'No room! No room!' they cried out +when they saw Alice coming. 'There's plenty of room!' said +Alice indignantly, and she sat down in a large arm-chair at one +end of the table.

+ +

'Have some wine,' the March Hare said in an encouraging +tone.

+ +

Alice looked all round the table, but there was nothing on it +but tea. 'I don't see any wine,' she remarked.

+ +

'There isn't any,' said the March Hare.

+ +

'Then it wasn't very civil of you to offer it,' said Alice +angrily.

+ +

'It wasn't very civil of you to sit down without being +invited,' said the March Hare.

+ +

'I didn't know it was your table,' said Alice; 'it's +laid for a great many more than three.'

+ +

'Your hair wants cutting,' said the Hatter. He had been +looking at Alice for some time with great curiosity, and this was +his first speech.

+ +

'You should learn not to make personal remarks,' Alice said +with some severity; 'it's very rude.'

+ +

The Hatter opened his eyes very wide on hearing this; but all +he said was, 'Why is a raven like a writing-desk?'

+ +

'Come, we shall have some fun now!' thought Alice. 'I'm glad +they've begun asking riddles.--I believe I can guess that,' she +added aloud.

+ +

'Do you mean that you think you can find out the answer to +it?' said the March Hare.

+ +

'Exactly so,' said Alice.

+ +

'Then you should say what you mean,' the March Hare went +on.

+ +

'I do,' Alice hastily replied; 'at least--at least I mean what +I say--that's the same thing, you know.'

+ +

'Not the same thing a bit!' said the Hatter. 'You might just +as well say that "I see what I eat" is the same thing as "I eat +what I see"!'

+ +

'You might just as well say,' added the March Hare, 'that "I +like what I get" is the same thing as "I get what I like"!'

+ +

'You might just as well say,' added the Dormouse, who seemed +to be talking in his sleep, 'that "I breathe when I sleep" is the +same thing as "I sleep when I breathe"!'

+ +

'It is the same thing with you,' said the Hatter, and +here the conversation dropped, and the party sat silent for a +minute, while Alice thought over all she could remember about +ravens and writing-desks, which wasn't much.

+ +

The Hatter was the first to break the silence. 'What day of +the month is it?' he said, turning to Alice: he had taken his +watch out of his pocket, and was looking at it uneasily, shaking +it every now and then, and holding it to his ear.

+ +

Alice considered a little, and then said 'The fourth.'

+ +

'Two days wrong!' sighed the Hatter. 'I told you butter +wouldn't suit the works!' he added looking angrily at the March +Hare.

+ +

'It was the best butter,' the March Hare meekly +replied.

+ +

'Yes, but some crumbs must have got in as well,' the Hatter +grumbled: 'you shouldn't have put it in with the +bread-knife.'

+ +

The March Hare took the watch and looked at it gloomily: then +he dipped it into his cup of tea, and looked at it again: but he +could think of nothing better to say than his first remark, 'It +was the best butter, you know.'

+ +

Alice had been looking over his shoulder with some curiosity. +'What a funny watch!' she remarked. 'It tells the day of the +month, and doesn't tell what o'clock it is!'

+ +

'Why should it?' muttered the Hatter. 'Does your watch +tell you what year it is?'

+ +

'Of course not,' Alice replied very readily: 'but that's +because it stays the same year for such a long time +together.'

+ +

'Which is just the case with mine,' said the +Hatter.

+ +

Alice felt dreadfully puzzled. The Hatter's remark seemed to +have no sort of meaning in it, and yet it was certainly English. +'I don't quite understand you,' she said, as politely as she +could.

+ +

'The Dormouse is asleep again,' said the Hatter, and he poured +a little hot tea upon its nose.

+ +

The Dormouse shook its head impatiently, and said, without +opening its eyes, 'Of course, of course; just what I was going to +remark myself.'

+ +

'Have you guessed the riddle yet?' the Hatter said, turning to +Alice again.

+ +

'No, I give it up,' Alice replied: 'what's the answer?'

+ +

'I haven't the slightest idea,' said the Hatter.

+ +

'Nor I,' said the March Hare.

+ +

Alice sighed wearily. 'I think you might do something better +with the time,' she said, 'than waste it in asking riddles that +have no answers.'

+ +

'If you knew Time as well as I do,' said the Hatter, 'you +wouldn't talk about wasting it. It's him.'

+ +

'I don't know what you mean,' said Alice.

+ +

'Of course you don't!' the Hatter said, tossing his head +contemptuously. 'I dare say you never even spoke to Time!'

+ +

'Perhaps not,' Alice cautiously replied: 'but I know I have to +beat time when I learn music.'

+ +

'Ah! that accounts for it,' said the Hatter. 'He won't stand +beating. Now, if you only kept on good terms with him, he'd do +almost anything you liked with the clock. For instance, suppose +it were nine o'clock in the morning, just time to begin lessons: +you'd only have to whisper a hint to Time, and round goes the +clock in a twinkling! Half-past one, time for dinner!'

+ +

('I only wish it was,' the March Hare said to itself in a +whisper.)

+ +

'That would be grand, certainly,' said Alice thoughtfully: +'but then--I shouldn't be hungry for it, you know.'

+ +

'Not at first, perhaps,' said the Hatter: 'but you could keep +it to half-past one as long as you liked.'

+ +

'Is that the way you manage?' Alice asked.

+ +

The Hatter shook his head mournfully. 'Not I!' he replied. 'We +quarrelled last March--just before he went mad, you +know--' (pointing with his tea spoon at the March Hare,) '--it +was at the great concert given by the Queen of Hearts, and I had +to sing

+ +

"Twinkle, twinkle, little bat!

+ +

How I wonder what you're at!"

+ +

You know the song, perhaps?'

+ +

'I've heard something like it,' said Alice.

+ +

'It goes on, you know,' the Hatter continued, 'in this +way:--

+ +

"Up above the world you fly,

+ +

Like a tea-tray in the sky.

+ +

Twinkle, twinkle--"'

+ +

Here the Dormouse shook itself, and began singing in its sleep +'Twinkle, twinkle, twinkle, twinkle--' and went on so long +that they had to pinch it to make it stop.

+ +

'Well, I'd hardly finished the first verse,' said the Hatter, +'when the Queen jumped up and bawled out, "He's murdering the +time! Off with his head!"'

+ +

'How dreadfully savage!' exclaimed Alice.

+ +

'And ever since that,' the Hatter went on in a mournful tone, +'he won't do a thing I ask! It's always six o'clock now.'

+ +

A bright idea came into Alice's head. 'Is that the reason so +many tea-things are put out here?' she asked.

+ +

'Yes, that's it,' said the Hatter with a sigh: 'it's always +tea-time, and we've no time to wash the things between +whiles.'

+ +

'Then you keep moving round, I suppose?' said Alice.

+ +

'Exactly so,' said the Hatter: 'as the things get used +up.'

+ +

'But what happens when you come to the beginning again?' Alice +ventured to ask.

+ +

'Suppose we change the subject,' the March Hare interrupted, +yawning. 'I'm getting tired of this. I vote the young lady tells +us a story.'

+ +

'I'm afraid I don't know one,' said Alice, rather alarmed at +the proposal.

+ +

'Then the Dormouse shall!' they both cried. 'Wake up, +Dormouse!' And they pinched it on both sides at once.

+ +

The Dormouse slowly opened his eyes. 'I wasn't asleep,' he +said in a hoarse, feeble voice: 'I heard every word you fellows +were saying.'

+ +

'Tell us a story!' said the March Hare.

+ +

'Yes, please do!' pleaded Alice.

+ +

'And be quick about it,' added the Hatter, 'or you'll be +asleep again before it's done.'

+ +

'Once upon a time there were three little sisters,' the +Dormouse began in a great hurry; 'and their names were Elsie, +Lacie, and Tillie; and they lived at the bottom of a well--'

+ +

'What did they live on?' said Alice, who always took a great +interest in questions of eating and drinking.

+ +

'They lived on treacle,' said the Dormouse, after thinking a +minute or two.

+ +

'They couldn't have done that, you know,' Alice gently +remarked; 'they'd have been ill.'

+ +

'So they were,' said the Dormouse; 'very ill.'

+ +

Alice tried to fancy to herself what such an extraordinary +ways of living would be like, but it puzzled her too much, so she +went on: 'But why did they live at the bottom of a well?'

+ +

'Take some more tea,' the March Hare said to Alice, very +earnestly.

+ +

'I've had nothing yet,' Alice replied in an offended tone, 'so +I can't take more.'

+ +

'You mean you can't take less,' said the Hatter: 'it's +very easy to take more than nothing.'

+ +

'Nobody asked your opinion,' said Alice.

+ +

'Who's making personal remarks now?' the Hatter asked +triumphantly.

+ +

Alice did not quite know what to say to this: so she helped +herself to some tea and bread-and-butter, and then turned to the +Dormouse, and repeated her question. 'Why did they live at the +bottom of a well?'

+ +

The Dormouse again took a minute or two to think about it, and +then said, 'It was a treacle-well.'

+ +

'There's no such thing!' Alice was beginning very angrily, but +the Hatter and the March Hare went 'Sh! sh!' and the Dormouse +sulkily remarked, 'If you can't be civil, you'd better finish the +story for yourself.'

+ +

'No, please go on!' Alice said very humbly; 'I won't interrupt +again. I dare say there may be one.'

+ +

'One, indeed!' said the Dormouse indignantly. However, he +consented to go on. 'And so these three little sisters--they were +learning to draw, you know--'

+ +

'What did they draw?' said Alice, quite forgetting her +promise.

+ +

'Treacle,' said the Dormouse, without considering at all this +time.

+ +

'I want a clean cup,' interrupted the Hatter: 'let's all move +one place on.'

+ +

He moved on as he spoke, and the Dormouse followed him: the +March Hare moved into the Dormouse's place, and Alice rather +unwillingly took the place of the March Hare. The Hatter was the +only one who got any advantage from the change: and Alice was a +good deal worse off than before, as the March Hare had just upset +the milk-jug into his plate.

+ +

Alice did not wish to offend the Dormouse again, so she began +very cautiously: 'But I don't understand. Where did they draw the +treacle from?'

+ +

'You can draw water out of a water-well,' said the Hatter; 'so +I should think you could draw treacle out of a treacle-well--eh, +stupid?'

+ +

'But they were in the well,' Alice said to the +Dormouse, not choosing to notice this last remark.

+ +

'Of course they were', said the Dormouse; '--well in.'

+ +

This answer so confused poor Alice, that she let the Dormouse +go on for some time without interrupting it.

+ +

'They were learning to draw,' the Dormouse went on, yawning +and rubbing its eyes, for it was getting very sleepy; 'and they +drew all manner of things--everything that begins with an +M--'

+ +

'Why with an M?' said Alice.

+ +

'Why not?' said the March Hare.

+ +

Alice was silent.

+ +

The Dormouse had closed its eyes by this time, and was going +off into a doze; but, on being pinched by the Hatter, it woke up +again with a little shriek, and went on: '--that begins with an +M, such as mouse-traps, and the moon, and memory, and muchness-- +you know you say things are "much of a muchness"--did you ever +see such a thing as a drawing of a muchness?'

+ +

'Really, now you ask me,' said Alice, very much confused, 'I +don't think--'

+ +

'Then you shouldn't talk,' said the Hatter.

+ +

This piece of rudeness was more than Alice could bear: she got +up in great disgust, and walked off; the Dormouse fell asleep +instantly, and neither of the others took the least notice of her +going, though she looked back once or twice, half hoping that +they would call after her: the last time she saw them, they were +trying to put the Dormouse into the teapot.

+ +

'At any rate I'll never go there again!' said Alice as +she picked her way through the wood. 'It's the stupidest +tea-party I ever was at in all my life!'

+ +

Just as she said this, she noticed that one of the trees had a +door leading right into it. 'That's very curious!' she thought. +'But everything's curious today. I think I may as well go in at +once.' And in she went.

+ +

Once more she found herself in the long hall, and close to the +little glass table. 'Now, I'll manage better this time,' she said +to herself, and began by taking the little golden key, and +unlocking the door that led into the garden. Then she went to +work nibbling at the mushroom (she had kept a piece of it in her +pocket) till she was about a foot high: then she walked down the +little passage: and then--she found herself at last in the +beautiful garden, among the bright flower-beds and the cool +fountains.

+ +
+

CHAPTER VIII

+ +

The Queen's Croquet-Ground

+ +

A large rose-tree stood near the entrance of the garden: the +roses growing on it were white, but there were three gardeners at +it, busily painting them red. Alice thought this a very curious +thing, and she went nearer to watch them, and just as she came up +to them she heard one of them say, 'Look out now, Five! Don't go +splashing paint over me like that!'

+ +

'I couldn't help it,' said Five, in a sulky tone; 'Seven +jogged my elbow.'

+ +

On which Seven looked up and said, 'That's right, Five! Always +lay the blame on others!'

+ +

You'd better not talk!' said Five. 'I heard the Queen +say only yesterday you deserved to be beheaded!'

+ +

'What for?' said the one who had spoken first.

+ +

'That's none of your business, Two!' said Seven.

+ +

'Yes, it is his business!' said Five, 'and I'll tell +him--it was for bringing the cook tulip-roots instead of +onions.'

+ +

Seven flung down his brush, and had just begun 'Well, of all +the unjust things--' when his eye chanced to fall upon Alice, as +she stood watching them, and he checked himself suddenly: the +others looked round also, and all of them bowed low.

+ +

'Would you tell me,' said Alice, a little timidly, 'why you +are painting those roses?'

+ +

Five and Seven said nothing, but looked at Two. Two began in a +low voice, 'Why the fact is, you see, Miss, this here ought to +have been a red rose-tree, and we put a white one in by +mistake; and if the Queen was to find it out, we should all have +our heads cut off, you know. So you see, Miss, we're doing our +best, afore she comes, to--' At this moment Five, who had been +anxiously looking across the garden, called out 'The Queen! The +Queen!' and the three gardeners instantly threw themselves flat +upon their faces. There was a sound of many footsteps, and Alice +looked round, eager to see the Queen.

+ +

First came ten soldiers carrying clubs; these were all shaped +like the three gardeners, oblong and flat, with their hands and +feet at the corners: next the ten courtiers; these were +ornamented all over with diamonds, and walked two and two, as the +soldiers did. After these came the royal children; there were ten +of them, and the little dears came jumping merrily along hand in +hand, in couples: they were all ornamented with hearts. Next came +the guests, mostly Kings and Queens, and among them Alice +recognised the White Rabbit: it was talking in a hurried nervous +manner, smiling at everything that was said, and went by without +noticing her. Then followed the Knave of Hearts, carrying the +King's crown on a crimson velvet cushion; and, last of all this +grand procession, came THE KING AND QUEEN OF HEARTS.

+ +

Alice was rather doubtful whether she ought not to lie down on +her face like the three gardeners, but she could not remember +ever having heard of such a rule at processions; 'and besides, +what would be the use of a procession,' thought she, 'if people +had all to lie down upon their faces, so that they couldn't see +it?' So she stood still where she was, and waited.

+ +

When the procession came opposite to Alice, they all stopped +and looked at her, and the Queen said severely 'Who is this?' She +said it to the Knave of Hearts, who only bowed and smiled in +reply.

+ +

'Idiot!' said the Queen, tossing her head impatiently; and, +turning to Alice, she went on, 'What's your name, child?'

+ +

'My name is Alice, so please your Majesty,' said Alice very +politely; but she added, to herself, 'Why, they're only a pack of +cards, after all. I needn't be afraid of them!'

+ +

'And who are these?' said the Queen, pointing to the +three gardeners who were lying round the rosetree; for, you see, +as they were lying on their faces, and the pattern on their backs +was the same as the rest of the pack, she could not tell whether +they were gardeners, or soldiers, or courtiers, or three of her +own children.

+ +

'How should I know?' said Alice, surprised at her own courage. +'It's no business of mine.'

+ +

The Queen turned crimson with fury, and, after glaring at her +for a moment like a wild beast, screamed 'Off with her head! +Off--'

+ +

'Nonsense!' said Alice, very loudly and decidedly, and the +Queen was silent.

+ +

The King laid his hand upon her arm, and timidly said +'Consider, my dear: she is only a child!'

+ +

The Queen turned angrily away from him, and said to the Knave +'Turn them over!'

+ +

The Knave did so, very carefully, with one foot.

+ +

'Get up!' said the Queen, in a shrill, loud voice, and the +three gardeners instantly jumped up, and began bowing to the +King, the Queen, the royal children, and everybody else.

+ +

'Leave off that!' screamed the Queen. 'You make me giddy.' And +then, turning to the rose-tree, she went on, 'What have +you been doing here?'

+ +

'May it please your Majesty,' said Two, in a very humble tone, +going down on one knee as he spoke, 'we were trying--'

+ +

'I see!' said the Queen, who had meanwhile been examining the +roses. 'Off with their heads!' and the procession moved on, three +of the soldiers remaining behind to execute the unfortunate +gardeners, who ran to Alice for protection.

+ +

'You shan't be beheaded!' said Alice, and she put them into a +large flower-pot that stood near. The three soldiers wandered +about for a minute or two, looking for them, and then quietly +marched off after the others.

+ +

'Are their heads off?' shouted the Queen.

+ +

'Their heads are gone, if it please your Majesty!' the +soldiers shouted in reply.

+ +

'That's right!' shouted the Queen. 'Can you play croquet?'

+ +

The soldiers were silent, and looked at Alice, as the question +was evidently meant for her.

+ +

'Yes!' shouted Alice.

+ +

'Come on, then!' roared the Queen, and Alice joined the +procession, wondering very much what would happen next.

+ +

'It's--it's a very fine day!' said a timid voice at her side. +She was walking by the White Rabbit, who was peeping anxiously +into her face.

+ +

'Very,' said Alice: '--where's the Duchess?'

+ +

'Hush! Hush!' said the Rabbit in a low, hurried tone. He +looked anxiously over his shoulder as he spoke, and then raised +himself upon tiptoe, put his mouth close to her ear, and +whispered 'She's under sentence of execution.'

+ +

'What for?' said Alice.

+ +

'Did you say "What a pity!"?' the Rabbit asked.

+ +

'No, I didn't,' said Alice: 'I don't think it's at all a pity. +I said "What for?"'

+ +

'She boxed the Queen's ears--' the Rabbit began. Alice gave a +little scream of laughter. 'Oh, hush!' the Rabbit whispered in a +frightened tone. 'The Queen will hear you! You see, she came +rather late, and the Queen said--'

+ +

'Get to your places!' shouted the Queen in a voice of thunder, +and people began running about in all directions, tumbling up +against each other; however, they got settled down in a minute or +two, and the game began. Alice thought she had never seen such a +curious croquet-ground in her life; it was all ridges and +furrows; the balls were live hedgehogs, the mallets live +flamingoes, and the soldiers had to double themselves up and to +stand on their hands and feet, to make the arches.

+ +

The chief difficulty Alice found at first was in managing her +flamingo: she succeeded in getting its body tucked away, +comfortably enough, under her arm, with its legs hanging down, +but generally, just as she had got its neck nicely straightened +out, and was going to give the hedgehog a blow with its head, it +would twist itself round and look up in her face, with +such a puzzled expression that she could not help bursting out +laughing: and when she had got its head down, and was going to +begin again, it was very provoking to find that the hedgehog had +unrolled itself, and was in the act of crawling away: besides all +this, there was generally a ridge or furrow in the way wherever +she wanted to send the hedgehog to, and, as the doubled-up +soldiers were always getting up and walking off to other parts of +the ground, Alice soon came to the conclusion that it was a very +difficult game indeed.

+ +

The players all played at once without waiting for turns, +quarrelling all the while, and fighting for the hedgehogs; and in +a very short time the Queen was in a furious passion, and went +stamping about, and shouting 'Off with his head!' or 'Off with +her head!' about once in a minute.

+ +

Alice began to feel very uneasy: to be sure, she had not as +yet had any dispute with the Queen, but she knew that it might +happen any minute, 'and then,' thought she, 'what would become of +me? They're dreadfully fond of beheading people here; the great +wonder is, that there's any one left alive!'

+ +

She was looking about for some way of escape, and wondering +whether she could get away without being seen, when she noticed a +curious appearance in the air: it puzzled her very much at first, +but, after watching it a minute or two, she made it out to be a +grin, and she said to herself 'It's the Cheshire Cat: now I shall +have somebody to talk to.'

+ +

'How are you getting on?' said the Cat, as soon as there was +mouth enough for it to speak with.

+ +

Alice waited till the eyes appeared, and then nodded. 'It's no +use speaking to it,' she thought, 'till its ears have come, or at +least one of them.' In another minute the whole head appeared, +and then Alice put down her flamingo, and began an account of the +game, feeling very glad she had someone to listen to her. The Cat +seemed to think that there was enough of it now in sight, and no +more of it appeared.

+ +

'I don't think they play at all fairly,' Alice began, in +rather a complaining tone, 'and they all quarrel so dreadfully +one can't hear oneself speak--and they don't seem to have any +rules in particular; at least, if there are, nobody attends to +them--and you've no idea how confusing it is all the things being +alive; for instance, there's the arch I've got to go through next +walking about at the other end of the ground--and I should have +croqueted the Queen's hedgehog just now, only it ran away when it +saw mine coming!'

+ +

'How do you like the Queen?' said the Cat in a low voice.

+ +

'Not at all,' said Alice: 'she's so extremely--' Just then she +noticed that the Queen was close behind her, listening: so she +went on, '--likely to win, that it's hardly worth while finishing +the game.'

+ +

The Queen smiled and passed on.

+ +

'Who are you talking to?' said the King, going up to +Alice, and looking at the Cat's head with great curiosity.

+ +

'It's a friend of mine--a Cheshire Cat,' said Alice: 'allow me +to introduce it.'

+ +

'I don't like the look of it at all,' said the King: 'however, +it may kiss my hand if it likes.'

+ +

'I'd rather not,' the Cat remarked.

+ +

'Don't be impertinent,' said the King, 'and don't look at me +like that!' He got behind Alice as he spoke.

+ +

'A cat may look at a king,' said Alice. 'I've read that in +some book, but I don't remember where.'

+ +

'Well, it must be removed,' said the King very decidedly, and +he called the Queen, who was passing at the moment, 'My dear! I +wish you would have this cat removed!'

+ +

The Queen had only one way of settling all difficulties, great +or small. 'Off with his head!' she said, without even looking +round.

+ +

'I'll fetch the executioner myself,' said the King eagerly, +and he hurried off.

+ +

Alice thought she might as well go back, and see how the game +was going on, as she heard the Queen's voice in the distance, +screaming with passion. She had already heard her sentence three +of the players to be executed for having missed their turns, and +she did not like the look of things at all, as the game was in +such confusion that she never knew whether it was her turn or +not. So she went in search of her hedgehog.

+ +

The hedgehog was engaged in a fight with another hedgehog, +which seemed to Alice an excellent opportunity for croqueting one +of them with the other: the only difficulty was, that her +flamingo was gone across to the other side of the garden, where +Alice could see it trying in a helpless sort of way to fly up +into a tree.

+ +

By the time she had caught the flamingo and brought it back, +the fight was over, and both the hedgehogs were out of sight: +'but it doesn't matter much,' thought Alice, 'as all the arches +are gone from this side of the ground.' So she tucked it away +under her arm, that it might not escape again, and went back for +a little more conversation with her friend.

+ +

When she got back to the Cheshire Cat, she was surprised to +find quite a large crowd collected round it: there was a dispute +going on between the executioner, the King, and the Queen, who +were all talking at once, while all the rest were quite silent, +and looked very uncomfortable.

+ +

The moment Alice appeared, she was appealed to by all three to +settle the question, and they repeated their arguments to her, +though, as they all spoke at once, she found it very hard indeed +to make out exactly what they said.

+ +

The executioner's argument was, that you couldn't cut off a +head unless there was a body to cut it off from: that he had +never had to do such a thing before, and he wasn't going to begin +at his time of life.

+ +

The King's argument was, that anything that had a head could +be beheaded, and that you weren't to talk nonsense.

+ +

The Queen's argument was, that if something wasn't done about +it in less than no time she'd have everybody executed, all round. +(It was this last remark that had made the whole party look so +grave and anxious.)

+ +

Alice could think of nothing else to say but 'It belongs to +the Duchess: you'd better ask her about it.'

+ +

'She's in prison,' the Queen said to the executioner: 'fetch +her here.' And the executioner went off like an arrow.

+ +

The Cat's head began fading away the moment he was gone, and, +by the time he had come back with the Duchess, it had entirely +disappeared; so the King and the executioner ran wildly up and +down looking for it, while the rest of the party went back to the +game.

+ +
+

CHAPTER IX

+ +

The Mock Turtle's Story

+ +

'You can't think how glad I am to see you again, you dear old +thing!' said the Duchess, as she tucked her arm affectionately +into Alice's, and they walked off together.

+ +

Alice was very glad to find her in such a pleasant temper, and +thought to herself that perhaps it was only the pepper that had +made her so savage when they met in the kitchen.

+ +

'When I'm a Duchess,' she said to herself, (not in a +very hopeful tone though), 'I won't have any pepper in my kitchen +at all. Soup does very well without--Maybe it's always +pepper that makes people hot-tempered,' she went on, very much +pleased at having found out a new kind of rule, 'and vinegar that +makes them sour--and camomile that makes them bitter--and--and +barley-sugar and such things that make children sweet-tempered. I +only wish people knew that: then they wouldn't be so stingy about +it, you know--'

+ +

She had quite forgotten the Duchess by this time, and was a +little startled when she heard her voice close to her ear. +'You're thinking about something, my dear, and that makes you +forget to talk. I can't tell you just now what the moral of that +is, but I shall remember it in a bit.'

+ +

'Perhaps it hasn't one,' Alice ventured to remark.

+ +

'Tut, tut, child!' said the Duchess. 'Everything's got a +moral, if only you can find it.' And she squeezed herself up +closer to Alice's side as she spoke.

+ +

Alice did not much like keeping so close to her: first, +because the Duchess was very ugly; and secondly, because she was +exactly the right height to rest her chin upon Alice's shoulder, +and it was an uncomfortably sharp chin. However, she did not like +to be rude, so she bore it as well as she could.

+ +

'The game's going on rather better now,' she said, by way of +keeping up the conversation a little.

+ +

''Tis so,' said the Duchess: 'and the moral of that is--"Oh, +'tis love, 'tis love, that makes the world go round!"'

+ +

'Somebody said,' Alice whispered, 'that it's done by everybody +minding their own business!'

+ +

'Ah, well! It means much the same thing,' said the Duchess, +digging her sharp little chin into Alice's shoulder as she added, +'and the moral of that is--"Take care of the sense, and +the sounds will take care of themselves."'

+ +

'How fond she is of finding morals in things!' Alice thought +to herself.

+ +

'I dare say you're wondering why I don't put my arm round your +waist,' the Duchess said after a pause: 'the reason is, that I'm +doubtful about the temper of your flamingo. Shall I try the +experiment?'

+ +

'He might bite,' Alice cautiously replied, not feeling +at all anxious to have the experiment tried.

+ +

'Very true,' said the Duchess: 'flamingoes and mustard both +bite. And the moral of that is--"Birds of a feather flock +together."'

+ +

'Only mustard isn't a bird,' Alice remarked.

+ +

'Right, as usual,' said the Duchess: 'what a clear way you +have of putting things!'

+ +

'It's a mineral, I think,' said Alice.

+ +

'Of course it is,' said the Duchess, who seemed ready to agree +to everything that Alice said; 'there's a large mustard-mine near +here. And the moral of that is--"The more there is of mine, the +less there is of yours."'

+ +

'Oh, I know!' exclaimed Alice, who had not attended to this +last remark, 'it's a vegetable. It doesn't look like one, but it +is.'

+ +

'I quite agree with you,' said the Duchess; 'and the moral of +that is--"Be what you would seem to be"--or if you'd like it put +more simply--"Never imagine yourself not to be otherwise than +what it might appear to others that what you were or might have +been was not otherwise than what you had been would have appeared +to them to be otherwise."'

+ +

'I think I should understand that better,' Alice said very +politely, 'if I had it written down: but I can't quite follow it +as you say it.'

+ +

'That's nothing to what I could say if I chose,' the Duchess +replied, in a pleased tone.

+ +

'Pray don't trouble yourself to say it any longer than that,' +said Alice.

+ +

'Oh, don't talk about trouble!' said the Duchess. 'I make you +a present of everything I've said as yet.'

+ +

'A cheap sort of present!' thought Alice. 'I'm glad they don't +give birthday presents like that!' But she did not venture to say +it out loud.

+ +

'Thinking again?' the Duchess asked, with another dig of her +sharp little chin.

+ +

'I've a right to think,' said Alice sharply, for she was +beginning to feel a little worried.

+ +

'Just about as much right,' said the Duchess, 'as pigs have to +fly; and the m--'

+ +

But here, to Alice's great surprise, the Duchess's voice died +away, even in the middle of her favourite word 'moral,' and the +arm that was linked into hers began to tremble. Alice looked up, +and there stood the Queen in front of them, with her arms folded, +frowning like a thunderstorm.

+ +

'A fine day, your Majesty!' the Duchess began in a low, weak +voice.

+ +

'Now, I give you fair warning,' shouted the Queen, stamping on +the ground as she spoke; 'either you or your head must be off, +and that in about half no time! Take your choice!'

+ +

The Duchess took her choice, and was gone in a moment.

+ +

'Let's go on with the game,' the Queen said to Alice; and +Alice was too much frightened to say a word, but slowly followed +her back to the croquet-ground.

+ +

The other guests had taken advantage of the Queen's absence, +and were resting in the shade: however, the moment they saw her, +they hurried back to the game, the Queen merely remarking that a +moment's delay would cost them their lives.

+ +

All the time they were playing the Queen never left off +quarrelling with the other players, and shouting 'Off with his +head!' or 'Off with her head!' Those whom she sentenced were +taken into custody by the soldiers, who of course had to leave +off being arches to do this, so that by the end of half an hour +or so there were no arches left, and all the players, except the +King, the Queen, and Alice, were in custody and under sentence of +execution.

+ +

Then the Queen left off, quite out of breath, and said to +Alice, 'Have you seen the Mock Turtle yet?'

+ +

'No,' said Alice. 'I don't even know what a Mock Turtle +is.'

+ +

'It's the thing Mock Turtle Soup is made from,' said the +Queen.

+ +

'I never saw one, or heard of one,' said Alice.

+ +

'Come on, then,' said the Queen, 'and he shall tell you his +history,'

+ +

As they walked off together, Alice heard the King say in a low +voice, to the company generally, 'You are all pardoned.' 'Come, +that's a good thing!' she said to herself, for she had +felt quite unhappy at the number of executions the Queen had +ordered.

+ +

They very soon came upon a Gryphon, lying fast asleep in the +sun. (If you don't know what a Gryphon is, look at the picture.) +'Up, lazy thing!' said the Queen, 'and take this young lady to +see the Mock Turtle, and to hear his history. I must go back and +see after some executions I have ordered'; and she walked off, +leaving Alice alone with the Gryphon. Alice did not quite like +the look of the creature, but on the whole she thought it would +be quite as safe to stay with it as to go after that savage +Queen: so she waited.

+ +

The Gryphon sat up and rubbed its eyes: then it watched the +Queen till she was out of sight: then it chuckled. 'What fun!' +said the Gryphon, half to itself, half to Alice.

+ +

'What is the fun?' said Alice.

+ +

'Why, she,' said the Gryphon. 'It's all her fancy, +that: they never executes nobody, you know. Come on!'

+ +

'Everybody says "come on!" here,' thought Alice, as she went +slowly after it: 'I never was so ordered about in all my life, +never!'

+ +

They had not gone far before they saw the Mock Turtle in the +distance, sitting sad and lonely on a little ledge of rock, and, +as they came nearer, Alice could hear him sighing as if his heart +would break. She pitied him deeply. 'What is his sorrow?' she +asked the Gryphon, and the Gryphon answered, very nearly in the +same words as before, 'It's all his fancy, that: he hasn't got no +sorrow, you know. Come on!'

+ +

So they went up to the Mock Turtle, who looked at them with +large eyes full of tears, but said nothing.

+ +

'This here young lady,' said the Gryphon, 'she wants for to +know your history, she do.'

+ +

'I'll tell it her,' said the Mock Turtle in a deep, hollow +tone: 'sit down, both of you, and don't speak a word till I've +finished.'

+ +

So they sat down, and nobody spoke for some minutes. Alice +thought to herself, 'I don't see how he can even finish, +if he doesn't begin.' But she waited patiently.

+ +

'Once,' said the Mock Turtle at last, with a deep sigh, 'I was +a real Turtle.'

+ +

These words were followed by a very long silence, broken only +by an occasional exclamation of 'Hjckrrh!' from the Gryphon, and +the constant heavy sobbing of the Mock Turtle. Alice was very +nearly getting up and saying, 'Thank you, sir, for your +interesting story,' but she could not help thinking there +must be more to come, so she sat still and said +nothing.

+ +

'When we were little,' the Mock Turtle went on at last, more +calmly, though still sobbing a little now and then, 'we went to +school in the sea. The master was an old Turtle--we used to call +him Tortoise--'

+ +

'Why did you call him Tortoise, if he wasn't one?' Alice +asked.

+ +

'We called him Tortoise because he taught us,' said the Mock +Turtle angrily: 'really you are very dull!'

+ +

'You ought to be ashamed of yourself for asking such a simple +question,' added the Gryphon; and then they both sat silent and +looked at poor Alice, who felt ready to sink into the earth. At +last the Gryphon said to the Mock Turtle, 'Drive on, old fellow! +Don't be all day about it!' and he went on in these words:

+ +

'Yes, we went to school in the sea, though you mayn't believe +it--'

+ +

'I never said I didn't!' interrupted Alice.

+ +

'You did,' said the Mock Turtle.

+ +

'Hold your tongue!' added the Gryphon, before Alice could +speak again. The Mock Turtle went on.

+ +

'We had the best of educations--in fact, we went to school +every day--'

+ +

'I've been to a day-school, too,' said Alice; 'you +needn't be so proud as all that.'

+ +

'With extras?' asked the Mock Turtle a little anxiously.

+ +

'Yes,' said Alice, 'we learned French and music.'

+ +

'And washing?' said the Mock Turtle.

+ +

'Certainly not!' said Alice indignantly.

+ +

'Ah! then yours wasn't a really good school,' said the Mock +Turtle in a tone of great relief. 'Now at ours they had at +the end of the bill, "French, music, and +washing--extra."'

+ +

'You couldn't have wanted it much,' said Alice; 'living at the +bottom of the sea.'

+ +

'I couldn't afford to learn it.' said the Mock Turtle with a +sigh. 'I only took the regular course.'

+ +

'What was that?' inquired Alice.

+ +

'Reeling and Writhing, of course, to begin with,' the Mock +Turtle replied; 'and then the different branches of Arithmetic-- +Ambition, Distraction, Uglification, and Derision.'

+ +

'I never heard of "Uglification,"' Alice ventured to say. +'What is it?'

+ +

The Gryphon lifted up both its paws in surprise. 'What! Never +heard of uglifying!' it exclaimed. 'You know what to beautify is, +I suppose?'

+ +

'Yes,' said Alice doubtfully: 'it +means--to--make--anything--prettier.'

+ +

'Well, then,' the Gryphon went on, 'if you don't know what to +uglify is, you are a simpleton.'

+ +

Alice did not feel encouraged to ask any more questions about +it, so she turned to the Mock Turtle, and said 'What else had you +to learn?'

+ +

'Well, there was Mystery,' the Mock Turtle replied, counting +off the subjects on his flappers, '--Mystery, ancient and modern, +with Seaography: then Drawling--the Drawling-master was an old +conger-eel, that used to come once a week: He taught us +Drawling, Stretching, and Fainting in Coils.'

+ +

'What was that like?' said Alice.

+ +

'Well, I can't show it you myself,' the Mock Turtle said: 'I'm +too stiff. And the Gryphon never learnt it.'

+ +

'Hadn't time,' said the Gryphon: 'I went to the Classics +master, though. He was an old crab, he was.'

+ +

'I never went to him,' the Mock Turtle said with a sigh: 'he +taught Laughing and Grief, they used to say.'

+ +

'So he did, so he did,' said the Gryphon, sighing in his turn; +and both creatures hid their faces in their paws.

+ +

'And how many hours a day did you do lessons?' said Alice, in +a hurry to change the subject.

+ +

'Ten hours the first day,' said the Mock Turtle: 'nine the +next, and so on.'

+ +

'What a curious plan!' exclaimed Alice.

+ +

'That's the reason they're called lessons,' the Gryphon +remarked: 'because they lessen from day to day.'

+ +

This was quite a new idea to Alice, and she thought it over a +little before she made her next remark. 'Then the eleventh day +must have been a holiday?'

+ +

'Of course it was,' said the Mock Turtle.

+ +

'And how did you manage on the twelfth?' Alice went on +eagerly.

+ +

'That's enough about lessons,' the Gryphon interrupted in a +very decided tone: 'tell her something about the games now.'

+ +
+

CHAPTER X

+ +

The Lobster Quadrille

+ +

The Mock Turtle sighed deeply, and drew the back of one +flapper across his eyes. He looked at Alice, and tried to speak, +but for a minute or two sobs choked his voice. 'Same as if he had +a bone in his throat,' said the Gryphon: and it set to work +shaking him and punching him in the back. At last the Mock Turtle +recovered his voice, and, with tears running down his cheeks, he +went on again:--

+ +

'You may not have lived much under the sea--' ('I haven't,' +said Alice)-- 'and perhaps you were never even introduced to a +lobster--' (Alice began to say 'I once tasted--' but checked +herself hastily, and said 'No, never') '--so you can have no idea +what a delightful thing a Lobster Quadrille is!'

+ +

'No, indeed,' said Alice. 'What sort of a dance is it?'

+ +

'Why,' said the Gryphon, 'you first form into a line along the +sea-shore--'

+ +

'Two lines!' cried the Mock Turtle. 'Seals, turtles, salmon, +and so on; then, when you've cleared all the jelly-fish out of +the way--'

+ +

'That generally takes some time,' interrupted the +Gryphon.

+ +

'--you advance twice--'

+ +

'Each with a lobster as a partner!' cried the Gryphon.

+ +

'Of course,' the Mock Turtle said: 'advance twice, set to +partners--'

+ +

'--change lobsters, and retire in same order,' continued the +Gryphon.

+ +

'Then, you know,' the Mock Turtle went on, 'you throw +the--'

+ +

'The lobsters!' shouted the Gryphon, with a bound into the +air.

+ +

'--as far out to sea as you can--'

+ +

'Swim after them!' screamed the Gryphon.

+ +

'Turn a somersault in the sea!' cried the Mock Turtle, +capering wildly about.

+ +

'Change lobster's again!' yelled the Gryphon at the top of its +voice.

+ +

'Back to land again, and that's all the first figure,' said +the Mock Turtle, suddenly dropping his voice; and the two +creatures, who had been jumping about like mad things all this +time, sat down again very sadly and quietly, and looked at +Alice.

+ +

'It must be a very pretty dance,' said Alice timidly.

+ +

'Would you like to see a little of it?' said the Mock +Turtle.

+ +

'Very much indeed,' said Alice.

+ +

'Come, let's try the first figure!' said the Mock Turtle to +the Gryphon. 'We can do without lobsters, you know. Which shall +sing?'

+ +

'Oh, you sing,' said the Gryphon. 'I've forgotten the +words.'

+ +

So they began solemnly dancing round and round Alice, every +now and then treading on her toes when they passed too close, and +waving their forepaws to mark the time, while the Mock Turtle +sang this, very slowly and sadly:--

+ +

'"Will you walk a little faster?" said a whiting to a +snail. "There's a porpoise close behind us, and he's treading on +my tail. See how eagerly the lobsters and the turtles all +advance! They are waiting on the shingle--will you come and join +the dance?

+ +

Will you, won't you, will you, won't you, will you join the +dance? Will you, won't you, will you, won't you, won't you join +the dance?

+ +

"You can really have no notion how delightful it will be +When they take us up and throw us, with the lobsters, out to +sea!" But the snail replied "Too far, too far!" and gave a look +askance-- Said he thanked the whiting kindly, but he would not +join the dance. Would not, could not, would not, could not, would +not join the dance. Would not, could not, would not, could not, +could not join the dance.

+ +

'"What matters it how far we go?" his scaly friend replied. +"There is another shore, you know, upon the other side. The +further off from England the nearer is to France-- Then turn not +pale, beloved snail, but come and join the dance.

+ +

Will you, won't you, will you, won't you, will you join the +dance? Will you, won't you, will you, won't you, won't you join +the dance?"'

+ +

'Thank you, it's a very interesting dance to watch,' said +Alice, feeling very glad that it was over at last: 'and I do so +like that curious song about the whiting!'

+ +

'Oh, as to the whiting,' said the Mock Turtle, 'they--you've +seen them, of course?'

+ +

'Yes,' said Alice, 'I've often seen them at dinn--' she +checked herself hastily.

+ +

'I don't know where Dinn may be,' said the Mock Turtle, 'but +if you've seen them so often, of course you know what they're +like.'

+ +

'I believe so,' Alice replied thoughtfully. 'They have their +tails in their mouths--and they're all over crumbs.'

+ +

'You're wrong about the crumbs,' said the Mock Turtle: 'crumbs +would all wash off in the sea. But they have their tails +in their mouths; and the reason is--' here the Mock Turtle yawned +and shut his eyes.--'Tell her about the reason and all that,' he +said to the Gryphon.

+ +

'The reason is,' said the Gryphon, 'that they would go +with the lobsters to the dance. So they got thrown out to sea. So +they had to fall a long way. So they got their tails fast in +their mouths. So they couldn't get them out again. That's +all.'

+ +

'Thank you,' said Alice, 'it's very interesting. I never knew +so much about a whiting before.'

+ +

'I can tell you more than that, if you like,' said the +Gryphon. 'Do you know why it's called a whiting?'

+ +

'I never thought about it,' said Alice. 'Why?'

+ +

'It does the boots and shoes.' the Gryphon replied very +solemnly.

+ +

Alice was thoroughly puzzled. 'Does the boots and shoes!' she +repeated in a wondering tone.

+ +

'Why, what are your shoes done with?' said the Gryphon. +'I mean, what makes them so shiny?'

+ +

Alice looked down at them, and considered a little before she +gave her answer. 'They're done with blacking, I believe.'

+ +

'Boots and shoes under the sea,' the Gryphon went on in a deep +voice, 'are done with a whiting. Now you know.'

+ +

'And what are they made of?' Alice asked in a tone of great +curiosity.

+ +

'Soles and eels, of course,' the Gryphon replied rather +impatiently: 'any shrimp could have told you that.'

+ +

'If I'd been the whiting,' said Alice, whose thoughts were +still running on the song, 'I'd have said to the porpoise, "Keep +back, please: we don't want you with us!"'

+ +

'They were obliged to have him with them,' the Mock Turtle +said: 'no wise fish would go anywhere without a porpoise.'

+ +

'Wouldn't it really?' said Alice in a tone of great +surprise.

+ +

'Of course not,' said the Mock Turtle: 'why, if a fish came to +me, and told me he was going a journey, I should say "With +what porpoise?"'

+ +

'Don't you mean "purpose"?' said Alice.

+ +

'I mean what I say,' the Mock Turtle replied in an offended +tone. And the Gryphon added 'Come, let's hear some of your +adventures.'

+ +

'I could tell you my adventures--beginning from this morning,' +said Alice a little timidly: 'but it's no use going back to +yesterday, because I was a different person then.'

+ +

'Explain all that,' said the Mock Turtle.

+ +

'No, no! The adventures first,' said the Gryphon in an +impatient tone: 'explanations take such a dreadful time.'

+ +

So Alice began telling them her adventures from the time when +she first saw the White Rabbit. She was a little nervous about it +just at first, the two creatures got so close to her, one on each +side, and opened their eyes and mouths so very wide, but +she gained courage as she went on. Her listeners were perfectly +quiet till she got to the part about her repeating 'You are +old, Father William,' to the Caterpillar, and the words all +coming different, and then the Mock Turtle drew a long breath, +and said 'That's very curious.'

+ +

'It's all about as curious as it can be,' said the +Gryphon.

+ +

'It all came different!' the Mock Turtle repeated +thoughtfully. 'I should like to hear her try and repeat something +now. Tell her to begin.' He looked at the Gryphon as if he +thought it had some kind of authority over Alice.

+ +

'Stand up and repeat "'Tis the voice of the sluggard,"' +said the Gryphon.

+ +

'How the creatures order one about, and make one repeat +lessons!' thought Alice; 'I might as well be at school at once.' +However, she got up, and began to repeat it, but her head was so +full of the Lobster Quadrille, that she hardly knew what she was +saying, and the words came very queer indeed:--

+ +

''Tis the voice of the Lobster; I heard him declare, "You have +baked me too brown, I must sugar my hair." As a duck with its +eyelids, so he with his nose Trims his belt and his buttons, and +turns out his toes.'

+ +

[later editions continued as follows When the sands are all +dry, he is gay as a lark, And will talk in contemptuous tones of +the Shark, But, when the tide rises and sharks are around, His +voice has a timid and tremulous sound.]

+ +

'That's different from what I used to say when I was a child,' +said the Gryphon.

+ +

'Well, I never heard it before,' said the Mock Turtle; 'but it +sounds uncommon nonsense.'

+ +

Alice said nothing; she had sat down with her face in her +hands, wondering if anything would ever happen in a +natural way again.

+ +

'I should like to have it explained,' said the Mock +Turtle.

+ +

'She can't explain it,' said the Gryphon hastily. 'Go on with +the next verse.'

+ +

'But about his toes?' the Mock Turtle persisted. 'How +could he turn them out with his nose, you know?'

+ +

'It's the first position in dancing.' Alice said; but was +dreadfully puzzled by the whole thing, and longed to change the +subject.

+ +

'Go on with the next verse,' the Gryphon repeated impatiently: +'it begins "I passed by his garden."'

+ +

Alice did not dare to disobey, though she felt sure it would +all come wrong, and she went on in a trembling voice:--

+ +

'I passed by his garden, and marked, with one eye, How the +Owl and the Panther were sharing a pie--'

+ +

[later editions continued as follows: The Panther +took pie-crust, and gravy, and meat, While the Owl had the dish +as its share of the treat. When the pie was all finished, the +Owl, as a boon, Was kindly permitted to pocket the spoon: While +the Panther received knife and fork with a growl, And concluded +the banquet--]

+ +

'What is the use of repeating all that stuff,' the Mock Turtle +interrupted, 'if you don't explain it as you go on? It's by far +the most confusing thing I ever heard!'

+ +

'Yes, I think you'd better leave off,' said the Gryphon: and +Alice was only too glad to do so.

+ +

'Shall we try another figure of the Lobster Quadrille?' the +Gryphon went on. 'Or would you like the Mock Turtle to sing you a +song?'

+ +

'Oh, a song, please, if the Mock Turtle would be so kind,' +Alice replied, so eagerly that the Gryphon said, in a rather +offended tone, 'Hm! No accounting for tastes! Sing her "Turtle +Soup," will you, old fellow?'

+ +

The Mock Turtle sighed deeply, and began, in a voice sometimes +choked with sobs, to sing this:--

+ +

'Beautiful Soup, so rich and green, Waiting in a hot +tureen! Who for such dainties would not stoop? Soup of the +evening, beautiful Soup! Soup of the evening, beautiful Soup! +Beau--ootiful Soo--oop! Beau--ootiful Soo--oop! Soo--oop of the +e--e--evening, Beautiful, beautiful Soup!

+ +

'Beautiful Soup! Who cares for fish, Game, or any other +dish? Who would not give all else for two pennyworth only of +beautiful Soup? Pennyworth only of beautiful Soup? Beau--ootiful +Soo--oop! Beau--ootiful Soo--oop! Soo--oop of the e--e--evening, +Beautiful, beauti--FUL SOUP!'

+ +

'Chorus again!' cried the Gryphon, and the Mock Turtle had +just begun to repeat it, when a cry of 'The trial's beginning!' +was heard in the distance.

+ +

'Come on!' cried the Gryphon, and, taking Alice by the hand, +it hurried off, without waiting for the end of the song.

+ +

'What trial is it?' Alice panted as she ran; but the Gryphon +only answered 'Come on!' and ran the faster, while more and more +faintly came, carried on the breeze that followed them, the +melancholy words:--

+ +

'Soo--oop of the e--e--evening, Beautiful, beautiful +Soup!'

+ +
+

CHAPTER XI

+ +

Who Stole the Tarts?

+ +

The King and Queen of Hearts were seated on their throne when +they arrived, with a great crowd assembled about them--all sorts +of little birds and beasts, as well as the whole pack of cards: +the Knave was standing before them, in chains, with a soldier on +each side to guard him; and near the King was the White Rabbit, +with a trumpet in one hand, and a scroll of parchment in the +other. In the very middle of the court was a table, with a large +dish of tarts upon it: they looked so good, that it made Alice +quite hungry to look at them--'I wish they'd get the trial done,' +she thought, 'and hand round the refreshments!' But there seemed +to be no chance of this, so she began looking at everything about +her, to pass away the time.

+ +

Alice had never been in a court of justice before, but she had +read about them in books, and she was quite pleased to find that +she knew the name of nearly everything there. 'That's the judge,' +she said to herself, 'because of his great wig.'

+ +

The judge, by the way, was the King; and as he wore his crown +over the wig, (look at the frontispiece if you want to see how he +did it,) he did not look at all comfortable, and it was certainly +not becoming.

+ +

'And that's the jury-box,' thought Alice, 'and those twelve +creatures,' (she was obliged to say 'creatures,' you see, because +some of them were animals, and some were birds,) 'I suppose they +are the jurors.' She said this last word two or three times over +to herself, being rather proud of it: for she thought, and +rightly too, that very few little girls of her age knew the +meaning of it at all. However, 'jury-men' would have done just as +well.

+ +

The twelve jurors were all writing very busily on slates. +'What are they doing?' Alice whispered to the Gryphon. 'They +can't have anything to put down yet, before the trial's +begun.'

+ +

'They're putting down their names,' the Gryphon whispered in +reply, 'for fear they should forget them before the end of the +trial.'

+ +

'Stupid things!' Alice began in a loud, indignant voice, but +she stopped hastily, for the White Rabbit cried out, 'Silence in +the court!' and the King put on his spectacles and looked +anxiously round, to make out who was talking.

+ +

Alice could see, as well as if she were looking over their +shoulders, that all the jurors were writing down 'stupid things!' +on their slates, and she could even make out that one of them +didn't know how to spell 'stupid,' and that he had to ask his +neighbour to tell him. 'A nice muddle their slates'll be in +before the trial's over!' thought Alice.

+ +

One of the jurors had a pencil that squeaked. This of course, +Alice could not stand, and she went round the court and +got behind him, and very soon found an opportunity of taking it +away. She did it so quickly that the poor little juror (it was +Bill, the Lizard) could not make out at all what had become of +it; so, after hunting all about for it, he was obliged to write +with one finger for the rest of the day; and this was of very +little use, as it left no mark on the slate.

+ +

'Herald, read the accusation!' said the King.

+ +

On this the White Rabbit blew three blasts on the trumpet, and +then unrolled the parchment scroll, and read as follows:--

+ +

'The Queen of Hearts, she made some tarts, All on a summer +day: The Knave of Hearts, he stole those tarts, And took them +quite away!'

+ +

'Consider your verdict,' the King said to the jury.

+ +

'Not yet, not yet!' the Rabbit hastily interrupted. 'There's a +great deal to come before that!'

+ +

'Call the first witness,' said the King; and the White Rabbit +blew three blasts on the trumpet, and called out, 'First +witness!'

+ +

The first witness was the Hatter. He came in with a teacup in +one hand and a piece of bread-and-butter in the other. 'I beg +pardon, your Majesty,' he began, 'for bringing these in: but I +hadn't quite finished my tea when I was sent for.'

+ +

'You ought to have finished,' said the King. 'When did you +begin?'

+ +

The Hatter looked at the March Hare, who had followed him into +the court, arm-in-arm with the Dormouse. 'Fourteenth of March, I +think it was,' he said.

+ +

'Fifteenth,' said the March Hare.

+ +

'Sixteenth,' added the Dormouse.

+ +

'Write that down,' the King said to the jury, and the jury +eagerly wrote down all three dates on their slates, and then +added them up, and reduced the answer to shillings and pence.

+ +

'Take off your hat,' the King said to the Hatter.

+ +

'It isn't mine,' said the Hatter.

+ +

'Stolen!' the King exclaimed, turning to the jury, who +instantly made a memorandum of the fact.

+ +

'I keep them to sell,' the Hatter added as an explanation; +'I've none of my own. I'm a hatter.'

+ +

Here the Queen put on her spectacles, and began staring at the +Hatter, who turned pale and fidgeted.

+ +

'Give your evidence,' said the King; 'and don't be nervous, or +I'll have you executed on the spot.'

+ +

This did not seem to encourage the witness at all: he kept +shifting from one foot to the other, looking uneasily at the +Queen, and in his confusion he bit a large piece out of his +teacup instead of the bread-and-butter.

+ +

Just at this moment Alice felt a very curious sensation, which +puzzled her a good deal until she made out what it was: she was +beginning to grow larger again, and she thought at first she +would get up and leave the court; but on second thoughts she +decided to remain where she was as long as there was room for +her.

+ +

'I wish you wouldn't squeeze so.' said the Dormouse, who was +sitting next to her. 'I can hardly breathe.'

+ +

'I can't help it,' said Alice very meekly: 'I'm growing.'

+ +

'You've no right to grow here,' said the Dormouse.

+ +

'Don't talk nonsense,' said Alice more boldly: 'you know +you're growing too.'

+ +

'Yes, but I grow at a reasonable pace,' said the +Dormouse: 'not in that ridiculous fashion.' And he got up very +sulkily and crossed over to the other side of the court.

+ +

All this time the Queen had never left off staring at the +Hatter, and, just as the Dormouse crossed the court, she said to +one of the officers of the court, 'Bring me the list of the +singers in the last concert!' on which the wretched Hatter +trembled so, that he shook both his shoes off.

+ +

'Give your evidence,' the King repeated angrily, 'or I'll have +you executed, whether you're nervous or not.'

+ +

'I'm a poor man, your Majesty,' the Hatter began, in a +trembling voice, '--and I hadn't begun my tea--not above a week +or so--and what with the bread-and-butter getting so thin--and +the twinkling of the tea--'

+ +

'The twinkling of the what?' said the King.

+ +

'It began with the tea,' the Hatter replied.

+ +

'Of course twinkling begins with a T!' said the King +sharply. 'Do you take me for a dunce? Go on!'

+ +

'I'm a poor man,' the Hatter went on, 'and most things +twinkled after that--only the March Hare said--'

+ +

'I didn't!' the March Hare interrupted in a great hurry.

+ +

'You did!' said the Hatter.

+ +

'I deny it!' said the March Hare.

+ +

'He denies it,' said the King: 'leave out that part.'

+ +

'Well, at any rate, the Dormouse said--' the Hatter went on, +looking anxiously round to see if he would deny it too: but the +Dormouse denied nothing, being fast asleep.

+ +

'After that,' continued the Hatter, 'I cut some more bread- +and-butter--'

+ +

'But what did the Dormouse say?' one of the jury asked.

+ +

'That I can't remember,' said the Hatter.

+ +

'You must remember,' remarked the King, 'or I'll have +you executed.'

+ +

The miserable Hatter dropped his teacup and bread-and-butter, +and went down on one knee. 'I'm a poor man, your Majesty,' he +began.

+ +

'You're a very poor speaker,' said the King.

+ +

Here one of the guinea-pigs cheered, and was immediately +suppressed by the officers of the court. (As that is rather a +hard word, I will just explain to you how it was done. They had a +large canvas bag, which tied up at the mouth with strings: into +this they slipped the guinea-pig, head first, and then sat upon +it.)

+ +

'I'm glad I've seen that done,' thought Alice. 'I've so often +read in the newspapers, at the end of trials, "There was some +attempts at applause, which was immediately suppressed by the +officers of the court," and I never understood what it meant till +now.'

+ +

'If that's all you know about it, you may stand down,' +continued the King.

+ +

'I can't go no lower,' said the Hatter: 'I'm on the floor, as +it is.'

+ +

'Then you may sit down,' the King replied.

+ +

Here the other guinea-pig cheered, and was suppressed.

+ +

'Come, that finished the guinea-pigs!' thought Alice. 'Now we +shall get on better.'

+ +

'I'd rather finish my tea,' said the Hatter, with an anxious +look at the Queen, who was reading the list of singers.

+ +

'You may go,' said the King, and the Hatter hurriedly left the +court, without even waiting to put his shoes on.

+ +

'--and just take his head off outside,' the Queen added to one +of the officers: but the Hatter was out of sight before the +officer could get to the door.

+ +

'Call the next witness!' said the King.

+ +

The next witness was the Duchess's cook. She carried the +pepper-box in her hand, and Alice guessed who it was, even before +she got into the court, by the way the people near the door began +sneezing all at once.

+ +

'Give your evidence,' said the King.

+ +

'Shan't,' said the cook.

+ +

The King looked anxiously at the White Rabbit, who said in a +low voice, 'Your Majesty must cross-examine this witness.'

+ +

'Well, if I must, I must,' the King said, with a melancholy +air, and, after folding his arms and frowning at the cook till +his eyes were nearly out of sight, he said in a deep voice, 'What +are tarts made of?'

+ +

'Pepper, mostly,' said the cook.

+ +

'Treacle,' said a sleepy voice behind her.

+ +

'Collar that Dormouse,' the Queen shrieked out. 'Behead that +Dormouse! Turn that Dormouse out of court! Suppress him! Pinch +him! Off with his whiskers!'

+ +

For some minutes the whole court was in confusion, getting the +Dormouse turned out, and, by the time they had settled down +again, the cook had disappeared.

+ +

'Never mind!' said the King, with an air of great relief. +'Call the next witness.' And he added in an undertone to the +Queen, 'Really, my dear, you must cross-examine the next +witness. It quite makes my forehead ache!'

+ +

Alice watched the White Rabbit as he fumbled over the list, +feeling very curious to see what the next witness would be like, +'--for they haven't got much evidence yet,' she said to +herself. Imagine her surprise, when the White Rabbit read out, at +the top of his shrill little voice, the name 'Alice!'

+ +
+

CHAPTER XII

+ +

Alice's Evidence

+ +

'Here!' cried Alice, quite forgetting in the flurry of the +moment how large she had grown in the last few minutes, and she +jumped up in such a hurry that she tipped over the jury-box with +the edge of her skirt, upsetting all the jurymen on to the heads +of the crowd below, and there they lay sprawling about, reminding +her very much of a globe of goldfish she had accidentally upset +the week before.

+ +

'Oh, I beg your pardon!' she exclaimed in a tone of +great dismay, and began picking them up again as quickly as she +could, for the accident of the goldfish kept running in her head, +and she had a vague sort of idea that they must be collected at +once and put back into the jury-box, or they would die.

+ +

'The trial cannot proceed,' said the King in a very grave +voice, 'until all the jurymen are back in their proper places-- +all,' he repeated with great emphasis, looking hard at +Alice as he said do.

+ +

Alice looked at the jury-box, and saw that, in her haste, she +had put the Lizard in head downwards, and the poor little thing +was waving its tail about in a melancholy way, being quite unable +to move. She soon got it out again, and put it right; 'not that +it signifies much,' she said to herself; 'I should think it would +be quite as much use in the trial one way up as the +other.'

+ +

As soon as the jury had a little recovered from the shock of +being upset, and their slates and pencils had been found and +handed back to them, they set to work very diligently to write +out a history of the accident, all except the Lizard, who seemed +too much overcome to do anything but sit with its mouth open, +gazing up into the roof of the court.

+ +

'What do you know about this business?' the King said to +Alice.

+ +

'Nothing,' said Alice.

+ +

'Nothing whatever?' persisted the King.

+ +

'Nothing whatever,' said Alice.

+ +

'That's very important,' the King said, turning to the jury. +They were just beginning to write this down on their slates, when +the White Rabbit interrupted: 'Unimportant, your Majesty +means, of course,' he said in a very respectful tone, but +frowning and making faces at him as he spoke.

+ +

'Unimportant, of course, I meant,' the King hastily +said, and went on to himself in an undertone, +'important--unimportant-- unimportant--important--' as if he were +trying which word sounded best.

+ +

Some of the jury wrote it down 'important,' and some +'unimportant.' Alice could see this, as she was near enough to +look over their slates; 'but it doesn't matter a bit,' she +thought to herself.

+ +

At this moment the King, who had been for some time busily +writing in his note-book, cackled out 'Silence!' and read out +from his book, 'Rule Forty-two. All persons more than a mile +hight to leave the court.'

+ +

Everybody looked at Alice.

+ +

'I'm not a mile high,' said Alice.

+ +

'You are,' said the King.

+ +

'Nearly two miles high,' added the Queen.

+ +

'Well, I shan't go, at any rate,' said Alice: 'besides, that's +not a regular rule: you invented it just now.'

+ +

'It's the oldest rule in the book,' said the King.

+ +

'Then it ought to be Number One,' said Alice.

+ +

The King turned pale, and shut his note-book hastily. +'Consider your verdict,' he said to the jury, in a low, trembling +voice.

+ +

'There's more evidence to come yet, please your Majesty,' said +the White Rabbit, jumping up in a great hurry; 'this paper has +just been picked up.'

+ +

'What's in it?' said the Queen.

+ +

'I haven't opened it yet,' said the White Rabbit, 'but it +seems to be a letter, written by the prisoner to--to +somebody.'

+ +

'It must have been that,' said the King, 'unless it was +written to nobody, which isn't usual, you know.'

+ +

'Who is it directed to?' said one of the jurymen.

+ +

'It isn't directed at all,' said the White Rabbit; 'in fact, +there's nothing written on the outside.' He unfolded the +paper as he spoke, and added 'It isn't a letter, after all: it's +a set of verses.'

+ +

'Are they in the prisoner's handwriting?' asked another of +they jurymen.

+ +

'No, they're not,' said the White Rabbit, 'and that's the +queerest thing about it.' (The jury all looked puzzled.)

+ +

'He must have imitated somebody else's hand,' said the King. +(The jury all brightened up again.)

+ +

'Please your Majesty,' said the Knave, 'I didn't write it, and +they can't prove I did: there's no name signed at the end.'

+ +

'If you didn't sign it,' said the King, 'that only makes the +matter worse. You must have meant some mischief, or else +you'd have signed your name like an honest man.'

+ +

There was a general clapping of hands at this: it was the +first really clever thing the King had said that day.

+ +

'That proves his guilt,' said the Queen.

+ +

'It proves nothing of the sort!' said Alice. 'Why, you don't +even know what they're about!'

+ +

'Read them,' said the King.

+ +

The White Rabbit put on his spectacles. 'Where shall I begin, +please your Majesty?' he asked.

+ +

'Begin at the beginning,' the King said gravely, 'and go on +till you come to the end: then stop.'

+ +

These were the verses the White Rabbit read:--

+ +

'They told me you had been to her, And mentioned me to him: +She gave me a good character, But said I could not swim.

+ +

He sent them word I had not gone (We know it to be true): +If she should push the matter on, What would become of +you?

+ +

I gave her one, they gave him two, You gave us three or +more; They all returned from him to you, Though they were mine +before.

+ +

If I or she should chance to be Involved in this affair, He +trusts to you to set them free, Exactly as we were.

+ +

My notion was that you had been (Before she had this fit) +An obstacle that came between Him, and ourselves, and it.

+ +

Don't let him know she liked them best, For this must ever +be A secret, kept from all the rest, Between yourself and +me.'

+ +

'That's the most important piece of evidence we've heard yet,' +said the King, rubbing his hands; 'so now let the jury--'

+ +

'If any one of them can explain it,' said Alice, (she had +grown so large in the last few minutes that she wasn't a bit +afraid of interrupting him,) 'I'll give him sixpence. _I_ don't +believe there's an atom of meaning in it.'

+ +

The jury all wrote down on their slates, 'She doesn't +believe there's an atom of meaning in it,' but none of them +attempted to explain the paper.

+ +

'If there's no meaning in it,' said the King, 'that saves a +world of trouble, you know, as we needn't try to find any. And +yet I don't know,' he went on, spreading out the verses on his +knee, and looking at them with one eye; 'I seem to see some +meaning in them, after all. "-said I could not swim--" you +can't swim, can you?' he added, turning to the Knave.

+ +

The Knave shook his head sadly. 'Do I look like it?' he said. +(Which he certainly did not, being made entirely of +cardboard.)

+ +

'All right, so far,' said the King, and he went on muttering +over the verses to himself: '"We know it to be true--" +that's the jury, of course-- "I gave her one, they gave him +two--" why, that must be what he did with the tarts, you +know--'

+ +

'But, it goes on "they all returned from him to you,"' +said Alice.

+ +

'Why, there they are!' said the King triumphantly, pointing to +the tarts on the table. 'Nothing can be clearer than that. +Then again--"before she had this fit--" you never had +fits, my dear, I think?' he said to the Queen.

+ +

'Never!' said the Queen furiously, throwing an inkstand at the +Lizard as she spoke. (The unfortunate little Bill had left off +writing on his slate with one finger, as he found it made no +mark; but he now hastily began again, using the ink, that was +trickling down his face, as long as it lasted.)

+ +

'Then the words don't fit you,' said the King, looking +round the court with a smile. There was a dead silence.

+ +

'It's a pun!' the King added in an offended tone, and +everybody laughed, 'Let the jury consider their verdict,' the +King said, for about the twentieth time that day.

+ +

'No, no!' said the Queen. 'Sentence first--verdict +afterwards.'

+ +

'Stuff and nonsense!' said Alice loudly. 'The idea of having +the sentence first!'

+ +

'Hold your tongue!' said the Queen, turning purple.

+ +

'I won't!' said Alice.

+ +

'Off with her head!' the Queen shouted at the top of her +voice. Nobody moved.

+ +

'Who cares for you?' said Alice, (she had grown to her full +size by this time.) 'You're nothing but a pack of cards!'

+ +

At this the whole pack rose up into the air, and came flying +down upon her: she gave a little scream, half of fright and half +of anger, and tried to beat them off, and found herself lying on +the bank, with her head in the lap of her sister, who was gently +brushing away some dead leaves that had fluttered down from the +trees upon her face.

+ +

'Wake up, Alice dear!' said her sister; 'Why, what a long +sleep you've had!'

+ +

'Oh, I've had such a curious dream!' said Alice, and she told +her sister, as well as she could remember them, all these strange +Adventures of hers that you have just been reading about; and +when she had finished, her sister kissed her, and said, 'It +was a curious dream, dear, certainly: but now run in to +your tea; it's getting late.' So Alice got up and ran off, +thinking while she ran, as well she might, what a wonderful dream +it had been.

+ +

But her sister sat still just as she left her, leaning her +head on her hand, watching the setting sun, and thinking of +little Alice and all her wonderful Adventures, till she too began +dreaming after a fashion, and this was her dream:--

+ +

First, she dreamed of little Alice herself, and once again the +tiny hands were clasped upon her knee, and the bright eager eyes +were looking up into hers--she could hear the very tones of her +voice, and see that queer little toss of her head to keep back +the wandering hair that would always get into her +eyes--and still as she listened, or seemed to listen, the whole +place around her became alive the strange creatures of her little +sister's dream.

+ +

The long grass rustled at her feet as the White Rabbit hurried +by--the frightened Mouse splashed his way through the +neighbouring pool--she could hear the rattle of the teacups as +the March Hare and his friends shared their never-ending meal, +and the shrill voice of the Queen ordering off her unfortunate +guests to execution--once more the pig-baby was sneezing on the +Duchess's knee, while plates and dishes crashed around it--once +more the shriek of the Gryphon, the squeaking of the Lizard's +slate-pencil, and the choking of the suppressed guinea-pigs, +filled the air, mixed up with the distant sobs of the miserable +Mock Turtle.

+ +

So she sat on, with closed eyes, and half believed herself in +Wonderland, though she knew she had but to open them again, and +all would change to dull reality--the grass would be only +rustling in the wind, and the pool rippling to the waving of the +reeds--the rattling teacups would change to tinkling sheep-bells, +and the Queen's shrill cries to the voice of the shepherd +boy--and the sneeze of the baby, the shriek of the Gryphon, and +all the other queer noises, would change (she knew) to the +confused clamour of the busy farm-yard--while the lowing of the +cattle in the distance would take the place of the Mock Turtle's +heavy sobs.

+ +

Lastly, she pictured to herself how this same little sister of +hers would, in the after-time, be herself a grown woman; and how +she would keep, through all her riper years, the simple and +loving heart of her childhood: and how she would gather about her +other little children, and make their eyes bright and eager with +many a strange tale, perhaps even with the dream of Wonderland of +long ago: and how she would feel with all their simple sorrows, +and find a pleasure in all their simple joys, remembering her own +child-life, and the happy summer days.

+ +

End of the Project Gutenberg Etext of Alice's Adventures in +Wonderland

+ + + 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/idle_server.js b/benchmark/idle_server.js index a4c70d76d36ffe..805c988811ea50 100644 --- a/benchmark/idle_server.js +++ b/benchmark/idle_server.js @@ -1,12 +1,13 @@ -net = require('net'); -connections = 0; +'use strict'; +const net = require('net'); +var connections = 0; var errors = 0; -server = net.Server(function (socket) { +var server = net.Server(function (socket) { socket.on('error', function () { - errors++; + errors++; }); }); @@ -28,4 +29,3 @@ setInterval(function () { console.log("SERVER %d errors: %d", process.pid, errors); } }, 1000); - diff --git a/benchmark/misc/function_call/binding.cc b/benchmark/misc/function_call/binding.cc index b8cedd7018f5ee..c6718e8e33adcc 100644 --- a/benchmark/misc/function_call/binding.cc +++ b/benchmark/misc/function_call/binding.cc @@ -9,7 +9,7 @@ void Hello(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(c++); } -extern "C" void init (Handle target) { +extern "C" void init (Local target) { HandleScope scope(Isolate::GetCurrent()); NODE_SET_METHOD(target, "hello", Hello); } diff --git a/benchmark/net/net-c2s-cork.js b/benchmark/net/net-c2s-cork.js new file mode 100644 index 00000000000000..5f8e0fa4357b99 --- /dev/null +++ b/benchmark/net/net-c2s-cork.js @@ -0,0 +1,96 @@ +// test the speed of .pipe() with sockets + +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); + break; + } + + 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/querystring/querystring-parse.js b/benchmark/querystring/querystring-parse.js index 3d88bed07d63da..6a4d9f5e6169f4 100644 --- a/benchmark/querystring/querystring-parse.js +++ b/benchmark/querystring/querystring-parse.js @@ -3,7 +3,7 @@ var querystring = require('querystring'); var v8 = require('v8'); var bench = common.createBenchmark(main, { - type: ['noencode', 'encodemany', 'encodelast'], + type: ['noencode', 'encodemany', 'encodelast', 'multivalue'], n: [1e6], }); @@ -14,7 +14,8 @@ function main(conf) { var inputs = { noencode: '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' }; var input = inputs[type]; diff --git a/benchmark/util/inspect.js b/benchmark/util/inspect.js new file mode 100644 index 00000000000000..8a59e6b48e54df --- /dev/null +++ b/benchmark/util/inspect.js @@ -0,0 +1,15 @@ +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) { + var r = util.inspect({a: 'a', b: 'b', c: 'c', d: 'd'}); + } + bench.end(n); +} diff --git a/c.js b/c.js new file mode 100644 index 00000000000000..a45148ad329061 --- /dev/null +++ b/c.js @@ -0,0 +1,6 @@ +n=require('net') + +n.connect(7001, '127.0.0.1').on('connect', function() { + console.log(this.address()) + this.destroy(); +}); diff --git a/common.gypi b/common.gypi index 7972c2d60a5a77..5b8b2c09d6b4a9 100644 --- a/common.gypi +++ b/common.gypi @@ -56,7 +56,7 @@ 'configurations': { 'Debug': { 'variables': { - 'v8_enable_handle_zapping%': 1, + 'v8_enable_handle_zapping': 1, }, 'defines': [ 'DEBUG', '_DEBUG' ], 'cflags': [ '-g', '-O0' ], @@ -64,6 +64,10 @@ ['target_arch=="x64"', { 'msvs_configuration_platform': 'x64', }], + ['OS=="aix"', { + 'cflags': [ '-gxcoff' ], + 'ldflags': [ '-Wl,-bbigtoc' ], + }], ], 'msvs_settings': { 'VCCLCompilerTool': { @@ -83,7 +87,7 @@ }, 'Release': { 'variables': { - 'v8_enable_handle_zapping%': 0, + 'v8_enable_handle_zapping': 0, }, 'cflags': [ '-O3', '-ffunction-sections', '-fdata-sections' ], 'conditions': [ @@ -173,16 +177,33 @@ }, 'msvs_disabled_warnings': [4351, 4355, 4800], 'conditions': [ - ['asan != 0', { + ['asan == 1 and OS != "mac"', { 'cflags+': [ '-fno-omit-frame-pointer', '-fsanitize=address', - '-w', # http://crbug.com/162783 + '-DLEAK_SANITIZER' ], - 'cflags_cc+': [ '-gline-tables-only' ], 'cflags!': [ '-fomit-frame-pointer' ], 'ldflags': [ '-fsanitize=address' ], }], + ['asan == 1 and OS == "mac"', { + 'xcode_settings': { + 'OTHER_CFLAGS+': [ + '-fno-omit-frame-pointer', + '-gline-tables-only', + '-fsanitize=address', + '-DLEAK_SANITIZER' + ], + 'OTHER_CFLAGS!': [ + '-fomit-frame-pointer', + ], + }, + 'target_conditions': [ + ['_type!="static_library"', { + 'xcode_settings': {'OTHER_LDFLAGS': ['-fsanitize=address']}, + }], + ], + }], ['OS == "win"', { 'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin 'defines': [ @@ -199,11 +220,11 @@ 'BUILDING_UV_SHARED=1', ], }], - [ 'OS in "linux freebsd openbsd solaris"', { + [ 'OS in "linux freebsd openbsd solaris aix"', { 'cflags': [ '-pthread', ], 'ldflags': [ '-pthread' ], }], - [ 'OS in "linux freebsd openbsd solaris android"', { + [ 'OS in "linux freebsd openbsd solaris android aix"', { 'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions', '-std=gnu++0x' ], 'ldflags': [ '-rdynamic' ], @@ -225,11 +246,11 @@ 'cflags': [ '-m64' ], 'ldflags': [ '-m64' ], }], - [ 'target_arch=="ppc"', { + [ 'target_arch=="ppc" and OS!="aix"', { 'cflags': [ '-m32' ], 'ldflags': [ '-m32' ], }], - [ 'target_arch=="ppc64"', { + [ 'target_arch=="ppc64" and OS!="aix"', { 'cflags': [ '-m64', '-mminimal-toc' ], 'ldflags': [ '-m64' ], }], @@ -239,6 +260,18 @@ 'cflags!': [ '-pthread' ], 'ldflags!': [ '-pthread' ], }], + [ 'OS=="aix"', { + 'conditions': [ + [ 'target_arch=="ppc"', { + 'ldflags': [ '-Wl,-bmaxdata:0x60000000/dsa' ], + }], + [ 'target_arch=="ppc64"', { + 'cflags': [ '-maix64' ], + 'ldflags': [ '-maix64' ], + }], + ], + 'ldflags!': [ '-rdynamic' ], + }], ], }], [ 'OS=="android"', { diff --git a/configure b/configure index 42817c21eb7872..dc0129e512593c 100755 --- a/configure +++ b/configure @@ -25,10 +25,12 @@ import nodedownload # parse our options parser = optparse.OptionParser() -valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', 'android') +valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux', + 'android', 'aix') valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 'x32', 'x64', 'x86') valid_arm_float_abi = ('soft', 'softfp', 'hard') +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') @@ -82,13 +84,20 @@ 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("--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", @@ -187,12 +196,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', @@ -204,7 +211,7 @@ parser.add_option('--release-urlbase', dest='release_urlbase', help='Provide a custom URL prefix for the `process.release` properties ' '`sourceUrl` and `headersUrl`. When compiling a release build, this ' - 'will default to https://iojs.org/download/release/') + 'will default to https://nodejs.org/download/release/') parser.add_option('--v8-options', action='store', @@ -218,6 +225,13 @@ parser.add_option('--with-arm-float-abi', help='specifies which floating-point ABI to use ({0}).'.format( ', '.join(valid_arm_float_abi))) +parser.add_option('--with-arm-fpu', + action='store', + dest='arm_fpu', + choices=valid_arm_fpu, + help='ARM FPU mode ({0}) [default: %default]'.format( + ', '.join(valid_arm_fpu))) + parser.add_option('--with-mips-arch-variant', action='store', dest='mips_arch_variant', @@ -287,6 +301,12 @@ intl_optgroup.add_option('--download', dest='download_list', help=nodedownload.help()) +intl_optgroup.add_option('--download-path', + action='store', + dest='download_path', + default=os.path.join(root_dir, 'deps'), + help='Download directory [default: %default]') + parser.add_option_group(intl_optgroup) parser.add_option('--with-perfctr', @@ -335,6 +355,11 @@ parser.add_option('--xcode', dest='use_xcode', help='generate build files for use with xcode') +parser.add_option('--enable-asan', + action='store_true', + dest='enable_asan', + help='build with asan') + parser.add_option('--enable-static', action='store_true', dest='enable_static', @@ -405,7 +430,7 @@ def try_check_compiler(cc, lang): # # The version of asm compiler is needed for building openssl asm files. # See deps/openssl/openssl.gypi for detail. -# Commands and reglar expressions to obtain its version number is taken from +# 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): @@ -477,7 +502,7 @@ def check_compiler(o): # to a version that is not completely ancient. warn('C compiler too old, need gcc 4.2 or clang 3.2 (CC=%s)' % CC) - # Need llvm_version or gas_version when openssl asm files are compiled + # Need llvm_version or gas_version when openssl asm files are compiled if options.without_ssl or options.openssl_no_asm or options.shared_openssl: return @@ -487,11 +512,11 @@ def check_compiler(o): o['variables']['gas_version'] = get_gas_version(CC) -def cc_macros(): - """Checks predefined macros using the CC command.""" +def cc_macros(cc=None): + """Checks predefined macros using the C compiler command.""" try: - p = subprocess.Popen(shlex.split(CC) + ['-dM', '-E', '-'], + p = subprocess.Popen(shlex.split(cc or CC) + ['-dM', '-E', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -522,18 +547,13 @@ def cc_macros(): 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(): @@ -549,12 +569,18 @@ def is_arm_hard_float_abi(): def host_arch_cc(): """Host architecture check using the CC command.""" - k = cc_macros() + if sys.platform.startswith('aix'): + # we only support gcc at this point and the default on AIX + # would be xlc so hard code gcc + k = cc_macros('gcc') + else: + k = cc_macros(os.environ.get('CC_host')) matchup = { '__aarch64__' : 'arm64', '__arm__' : 'arm', '__i386__' : 'ia32', + '__MIPSEL__' : 'mipsel', '__mips__' : 'mips', '__PPC64__' : 'ppc64', '__PPC__' : 'ppc', @@ -595,20 +621,23 @@ def configure_arm(o): else: arm_float_abi = 'default' + arm_fpu = 'vfp' + if is_arch_armv7(): - o['variables']['arm_fpu'] = 'vfpv3' + arm_fpu = 'vfpv3' o['variables']['arm_version'] = '7' else: - o['variables']['arm_fpu'] = 'vfpv2' o['variables']['arm_version'] = '6' if is_arch_armv6() else 'default' o['variables']['arm_thumb'] = 0 # -marm o['variables']['arm_float_abi'] = arm_float_abi if options.dest_os == 'android': - o['variables']['arm_fpu'] = 'vfpv3' + arm_fpu = 'vfpv3' o['variables']['arm_version'] = '7' + o['variables']['arm_fpu'] = options.arm_fpu or arm_fpu + def configure_mips(o): can_use_fpu_instructions = (options.mips_float_abi != 'soft') @@ -645,6 +674,10 @@ 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 flavor in ('solaris', 'mac', 'linux', 'freebsd'): use_dtrace = not options.without_dtrace # Don't enable by default on linux and freebsd @@ -707,6 +740,7 @@ def configure_node(o): if options.linked_module: o['variables']['library_files'] = options.linked_module + o['variables']['asan'] = int(options.enable_asan or 0) def configure_library(lib, output): shared_lib = 'shared_' + lib @@ -718,11 +752,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(',')) @@ -738,7 +776,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) @@ -748,7 +786,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: @@ -760,12 +798,19 @@ 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): @@ -813,18 +858,21 @@ def glob_to_var(dir_base, dir_sub, patch_dir): def configure_intl(o): icus = [ { - 'url': 'http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-src.zip', - # from https://ssl.icu-project.org/files/icu4c/55.1/icu4c-src-55_1.md5: - 'md5': '4cddf1e1d47622fdd9de2cd7bb5001fd', + 'url': 'https://ssl.icu-project.org/files/icu4c/56.1/icu4c-56_1-src.zip', + 'md5': '61d71888f14bf00cc3e8a6f2c087d367', }, ] def icu_download(path): # download ICU, if needed + if not os.access(options.download_path, os.W_OK): + print 'Error: cannot write to desired download path. ' \ + 'Either create it or verify permissions.' + sys.exit(1) for icu in icus: url = icu['url'] md5 = icu['md5'] local = url.split('/')[-1] - targetfile = os.path.join(root_dir, 'deps', local) + targetfile = os.path.join(options.download_path, local) if not os.path.isfile(targetfile): if nodedownload.candownload(auto_downloads, "icu"): nodedownload.retrievefile(url, targetfile) @@ -983,7 +1031,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') @@ -1035,7 +1083,7 @@ def configure_intl(o): return # end of configure_intl output = { - 'variables': { 'python': sys.executable }, + 'variables': {}, 'include_dirs': [], 'libraries': [], 'defines': [], @@ -1060,13 +1108,22 @@ 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/cares.gyp b/deps/cares/cares.gyp index 8fd8662e1bdf6f..8a5239b4129623 100644 --- a/deps/cares/cares.gyp +++ b/deps/cares/cares.gyp @@ -9,6 +9,10 @@ '_GNU_SOURCE' ] }], + [ 'OS=="aix"', { + 'include_dirs': [ 'config/aix' ], + 'sources': [ 'config/aix/ares_config.h' ], + }], ['OS=="solaris"', { 'defines': [ '__EXTENSIONS__', diff --git a/deps/cares/common.gypi b/deps/cares/common.gypi index 8c10d5b06d3c04..609ad62a3965d0 100644 --- a/deps/cares/common.gypi +++ b/deps/cares/common.gypi @@ -137,7 +137,7 @@ ], }], - [ 'OS in "linux freebsd openbsd solaris android"', { + [ 'OS in "linux freebsd openbsd solaris android aix"', { 'variables': { 'gcc_version%': ')' }, diff --git a/deps/cares/config/aix/ares_config.h b/deps/cares/config/aix/ares_config.h new file mode 100644 index 00000000000000..9e61d37bd84fe5 --- /dev/null +++ b/deps/cares/config/aix/ares_config.h @@ -0,0 +1,515 @@ +/* ares_config.h. Generated from ares_config.h.in by configure. */ +/* ares_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +/* #undef AC_APPLE_UNIVERSAL_BUILD */ + +/* define this if ares is built for a big endian system */ +#define ARES_BIG_ENDIAN 1 + +/* when building as static part of libcurl */ +/* #undef BUILDING_LIBCURL */ + +/* when building c-ares library */ +/* #undef CARES_BUILDING_LIBRARY */ + +/* when not building a shared library */ +/* #undef CARES_STATICLIB */ + +/* Define to 1 to enable hiding of library internal symbols. */ +#define CARES_SYMBOL_HIDING 1 + +/* Definition to make a library symbol externally visible. */ +#define CARES_SYMBOL_SCOPE_EXTERN __attribute__ ((visibility ("default"))) + +/* if a /etc/inet dir is being used */ +/* #undef ETC_INET */ + +/* Define to the type qualifier of arg 1 for getnameinfo. */ +#define GETNAMEINFO_QUAL_ARG1 const + +/* Define to the type of arg 1 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG1 struct sockaddr * + +/* Define to the type of arg 2 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG2 socklen_t + +/* Define to the type of args 4 and 6 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG46 size_t + +/* Define to the type of arg 7 for getnameinfo. */ +#define GETNAMEINFO_TYPE_ARG7 int + +/* Specifies the number of arguments to getservbyport_r */ +#define GETSERVBYPORT_R_ARGS 4 + +/* Specifies the size of the buffer to pass to getservbyport_r */ +#define GETSERVBYPORT_R_BUFSIZE sizeof(struct servent_data) + +/* Define to 1 if you have AF_INET6. */ +#define HAVE_AF_INET6 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_INET_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_NAMESER_COMPAT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_ARPA_NAMESER_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ASSERT_H 1 + +/* Define to 1 if you have the `bitncmp' function. */ +/* #undef HAVE_BITNCMP */ + +/* Define to 1 if bool is an available type. */ +#define HAVE_BOOL_T 1 + +/* Define to 1 if you have the clock_gettime function and monotonic timer. */ +#define HAVE_CLOCK_GETTIME_MONOTONIC 1 + +/* Define to 1 if you have the closesocket function. */ +/* #undef HAVE_CLOSESOCKET */ + +/* Define to 1 if you have the CloseSocket camel case function. */ +/* #undef HAVE_CLOSESOCKET_CAMEL */ + +/* Define to 1 if you have the connect function. */ +#define HAVE_CONNECT 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the fcntl function. */ +#define HAVE_FCNTL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have a working fcntl O_NONBLOCK function. */ +#define HAVE_FCNTL_O_NONBLOCK 1 + +/* Define to 1 if you have the freeaddrinfo function. */ +#define HAVE_FREEADDRINFO 1 + +/* Define to 1 if you have a working getaddrinfo function. */ +#define HAVE_GETADDRINFO 1 + +/* Define to 1 if the getaddrinfo function is threadsafe. */ +#define HAVE_GETADDRINFO_THREADSAFE 1 + +/* Define to 1 if you have the gethostbyaddr function. */ +#define HAVE_GETHOSTBYADDR 1 + +/* Define to 1 if you have the gethostbyname function. */ +#define HAVE_GETHOSTBYNAME 1 + +/* Define to 1 if you have the gethostname function. */ +#define HAVE_GETHOSTNAME 1 + +/* Define to 1 if you have the getnameinfo function. */ +#define HAVE_GETNAMEINFO 1 + +/* Define to 1 if you have the getservbyport_r function. */ +#define HAVE_GETSERVBYPORT_R 1 + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* Define to 1 if you have the `if_indextoname' function. */ +#define HAVE_IF_INDEXTONAME 1 + +/* Define to 1 if you have the `inet_net_pton' function. */ +#define HAVE_INET_NET_PTON 1 + +/* Define to 1 if inet_net_pton supports IPv6. */ +/* #undef HAVE_INET_NET_PTON_IPV6 */ + +/* Define to 1 if you have a IPv6 capable working inet_ntop function. */ +#define HAVE_INET_NTOP 1 + +/* Define to 1 if you have a IPv6 capable working inet_pton function. */ +#define HAVE_INET_PTON 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the ioctl function. */ +#define HAVE_IOCTL 1 + +/* Define to 1 if you have the ioctlsocket function. */ +/* #undef HAVE_IOCTLSOCKET */ + +/* Define to 1 if you have the IoctlSocket camel case function. */ +/* #undef HAVE_IOCTLSOCKET_CAMEL */ + +/* Define to 1 if you have a working IoctlSocket camel case FIONBIO function. + */ +/* #undef HAVE_IOCTLSOCKET_CAMEL_FIONBIO */ + +/* Define to 1 if you have a working ioctlsocket FIONBIO function. */ +/* #undef HAVE_IOCTLSOCKET_FIONBIO */ + +/* Define to 1 if you have a working ioctl FIONBIO function. */ +#define HAVE_IOCTL_FIONBIO 1 + +/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */ +#define HAVE_IOCTL_SIOCGIFADDR 1 + +/* Define to 1 if you have the `resolve' library (-lresolve). */ +/* #undef HAVE_LIBRESOLVE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* if your compiler supports LL */ +#define HAVE_LL 1 + +/* Define to 1 if the compiler supports the 'long long' data type. */ +#define HAVE_LONGLONG 1 + +/* Define to 1 if you have the malloc.h header file. */ +#define HAVE_MALLOC_H 1 + +/* Define to 1 if you have the memory.h header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the MSG_NOSIGNAL flag. */ +#define HAVE_MSG_NOSIGNAL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETDB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_IN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NETINET_TCP_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_NET_IF_H 1 + +/* Define to 1 if you have PF_INET6. */ +#define HAVE_PF_INET6 1 + +/* Define to 1 if you have the recv function. */ +#define HAVE_RECV 1 + +/* Define to 1 if you have the recvfrom function. */ +#define HAVE_RECVFROM 1 + +/* Define to 1 if you have the send function. */ +#define HAVE_SEND 1 + +/* Define to 1 if you have the setsockopt function. */ +#define HAVE_SETSOCKOPT 1 + +/* Define to 1 if you have a working setsockopt SO_NONBLOCK function. */ +/* #undef HAVE_SETSOCKOPT_SO_NONBLOCK */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SIGNAL_H 1 + +/* Define to 1 if sig_atomic_t is an available typedef. */ +#define HAVE_SIG_ATOMIC_T 1 + +/* Define to 1 if sig_atomic_t is already defined as volatile. */ +/* #undef HAVE_SIG_ATOMIC_T_VOLATILE */ + +/* Define to 1 if your struct sockaddr_in6 has sin6_scope_id. */ +#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1 + +/* Define to 1 if you have the socket function. */ +#define HAVE_SOCKET 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDBOOL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define to 1 if you have the strcmpi function. */ +/* #undef HAVE_STRCMPI */ + +/* Define to 1 if you have the strdup function. */ +#define HAVE_STRDUP 1 + +/* Define to 1 if you have the stricmp function. */ +/* #undef HAVE_STRICMP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the strncasecmp function. */ +#define HAVE_STRNCASECMP 1 + +/* Define to 1 if you have the strncmpi function. */ +/* #undef HAVE_STRNCMPI */ + +/* Define to 1 if you have the strnicmp function. */ +/* #undef HAVE_STRNICMP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STROPTS_H 1 + +/* Define to 1 if you have struct addrinfo. */ +#define HAVE_STRUCT_ADDRINFO 1 + +/* Define to 1 if you have struct in6_addr. */ +#define HAVE_STRUCT_IN6_ADDR 1 + +/* Define to 1 if you have struct sockaddr_in6. */ +#define HAVE_STRUCT_SOCKADDR_IN6 1 + +/* if struct sockaddr_storage is defined */ +#define HAVE_STRUCT_SOCKADDR_STORAGE 1 + +/* Define to 1 if you have the timeval struct. */ +#define HAVE_STRUCT_TIMEVAL 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_IOCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SELECT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SOCKET_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_UIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the windows.h header file. */ +/* #undef HAVE_WINDOWS_H */ + +/* Define to 1 if you have the winsock2.h header file. */ +/* #undef HAVE_WINSOCK2_H */ + +/* Define to 1 if you have the winsock.h header file. */ +/* #undef HAVE_WINSOCK_H */ + +/* Define to 1 if you have the writev function. */ +#define HAVE_WRITEV 1 + +/* Define to 1 if you have the ws2tcpip.h header file. */ +/* #undef HAVE_WS2TCPIP_H */ + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define to 1 if you are building a native Windows target. */ +/* #undef NATIVE_WINDOWS */ + +/* Define to 1 if you need the malloc.h header file even with stdlib.h */ +/* #undef NEED_MALLOC_H */ + +/* Define to 1 if you need the memory.h header file even with stdlib.h */ +/* #undef NEED_MEMORY_H */ + +/* Define to 1 if _REENTRANT preprocessor symbol must be defined. */ +/* #undef NEED_REENTRANT */ + +/* Define to 1 if _THREAD_SAFE preprocessor symbol must be defined. */ +#define NEED_THREAD_SAFE 1 + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +/* #undef NO_MINUS_C_MINUS_O */ + +/* cpu-machine-OS */ +#define OS "rs6000-ibm-aix" + +/* Name of package */ +#define PACKAGE "c-ares" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "c-ares" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "c-ares 1.7.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "c-ares" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.7.1" + +/* a suitable file/device to read random data from */ +#define RANDOM_FILE "/dev/urandom" + +/* Define to the type of arg 1 for recvfrom. */ +#define RECVFROM_TYPE_ARG1 int + +/* Define to the type pointed by arg 2 for recvfrom. */ +#define RECVFROM_TYPE_ARG2 void + +/* Define to 1 if the type pointed by arg 2 for recvfrom is void. */ +#define RECVFROM_TYPE_ARG2_IS_VOID 1 + +/* Define to the type of arg 3 for recvfrom. */ +#define RECVFROM_TYPE_ARG3 size_t + +/* Define to the type of arg 4 for recvfrom. */ +#define RECVFROM_TYPE_ARG4 int + +/* Define to the type pointed by arg 5 for recvfrom. */ +#define RECVFROM_TYPE_ARG5 struct sockaddr + +/* Define to 1 if the type pointed by arg 5 for recvfrom is void. */ +/* #undef RECVFROM_TYPE_ARG5_IS_VOID */ + +/* Define to the type pointed by arg 6 for recvfrom. */ +#define RECVFROM_TYPE_ARG6 socklen_t + +/* Define to 1 if the type pointed by arg 6 for recvfrom is void. */ +/* #undef RECVFROM_TYPE_ARG6_IS_VOID */ + +/* Define to the function return type for recvfrom. */ +#define RECVFROM_TYPE_RETV ssize_t + +/* Define to the type of arg 1 for recv. */ +#define RECV_TYPE_ARG1 int + +/* Define to the type of arg 2 for recv. */ +#define RECV_TYPE_ARG2 void * + +/* Define to the type of arg 3 for recv. */ +#define RECV_TYPE_ARG3 size_t + +/* Define to the type of arg 4 for recv. */ +#define RECV_TYPE_ARG4 int + +/* Define to the function return type for recv. */ +#define RECV_TYPE_RETV ssize_t + +/* Define as the return type of signal handlers (`int' or `void'). */ +#define RETSIGTYPE void + +/* Define to the type qualifier of arg 2 for send. */ +#define SEND_QUAL_ARG2 const + +/* Define to the type of arg 1 for send. */ +#define SEND_TYPE_ARG1 int + +/* Define to the type of arg 2 for send. */ +#define SEND_TYPE_ARG2 void * + +/* Define to the type of arg 3 for send. */ +#define SEND_TYPE_ARG3 size_t + +/* Define to the type of arg 4 for send. */ +#define SEND_TYPE_ARG4 int + +/* Define to the function return type for send. */ +#define SEND_TYPE_RETV ssize_t + +/* The size of `int', as computed by sizeof. */ +#define SIZEOF_INT 4 + +/* The size of `long', as computed by sizeof. */ +#define SIZEOF_LONG 4 + +/* The size of `size_t', as computed by sizeof. */ +#define SIZEOF_SIZE_T 4 + +/* The size of `struct in6_addr', as computed by sizeof. */ +#define SIZEOF_STRUCT_IN6_ADDR 16 + +/* The size of `struct in_addr', as computed by sizeof. */ +#define SIZEOF_STRUCT_IN_ADDR 4 + +/* The size of `time_t', as computed by sizeof. */ +#define SIZEOF_TIME_T 4 + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define to 1 if you can safely include both and . */ +#define TIME_WITH_SYS_TIME 1 + +/* Define to disable non-blocking sockets. */ +/* #undef USE_BLOCKING_SOCKETS */ + +/* Version number of package */ +#define VERSION "1.7.1" + +/* Define to avoid automatic inclusion of winsock.h */ +/* #undef WIN32_LEAN_AND_MEAN */ + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +/* # undef WORDS_BIGENDIAN */ +# endif +#endif + +/* Define to 1 if OS is AIX. */ +#ifndef _ALL_SOURCE +# define _ALL_SOURCE 1 +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +/* #undef _FILE_OFFSET_BITS */ + +/* Define for large files, on AIX-style hosts. */ +#define _LARGE_FILES 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Type to use in place of in_addr_t when system does not provide it. */ +/* #undef in_addr_t */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ + +/* the signed version of size_t */ +/* #undef ssize_t */ + +#define HAVE_GETENV 1 diff --git a/deps/http_parser/Makefile b/deps/http_parser/Makefile index 373709c6672e31..b96b3e266bcf5f 100644 --- a/deps/http_parser/Makefile +++ b/deps/http_parser/Makefile @@ -19,7 +19,7 @@ # IN THE SOFTWARE. PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') -SONAME ?= libhttp_parser.so.2.5.0 +SONAME ?= libhttp_parser.so.2.5.2 CC?=gcc AR?=ar diff --git a/deps/http_parser/http_parser.c b/deps/http_parser/http_parser.c index 0fa1c362729c4f..228d130cb5e30f 100644 --- a/deps/http_parser/http_parser.c +++ b/deps/http_parser/http_parser.c @@ -433,6 +433,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) @@ -638,6 +644,8 @@ size_t http_parser_execute (http_parser *parser, 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) { return 0; @@ -1384,7 +1392,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 +1549,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 +1721,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 +1808,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 */ diff --git a/deps/http_parser/http_parser.h b/deps/http_parser/http_parser.h index eb71bf99219315..39b3f23c5a13f5 100644 --- a/deps/http_parser/http_parser.h +++ b/deps/http_parser/http_parser.h @@ -27,7 +27,7 @@ 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_PATCH 0 +#define HTTP_PARSER_VERSION_PATCH 2 #include #if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) @@ -140,6 +140,7 @@ enum flags , F_TRAILING = 1 << 4 , F_UPGRADE = 1 << 5 , F_SKIPBODY = 1 << 6 + , F_CONTENTLENGTH = 1 << 7 }; @@ -182,6 +183,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 +209,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) */ diff --git a/deps/http_parser/test.c b/deps/http_parser/test.c index 4c00571eba60bc..5f754d83c6ac6a 100644 --- a/deps/http_parser/test.c +++ b/deps/http_parser/test.c @@ -3165,6 +3165,155 @@ test_simple (const char *buf, enum http_errno err_expected) } } +void +test_invalid_header_content (int req, const char* str) +{ + http_parser parser; + http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE); + size_t parsed; + const char *buf; + buf = req ? + "GET / HTTP/1.1\r\n" : + "HTTP/1.1 200 OK\r\n"; + parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf)); + assert(parsed == strlen(buf)); + + buf = str; + size_t buflen = strlen(buf); + + parsed = http_parser_execute(&parser, &settings_null, buf, buflen); + if (parsed != buflen) { + assert(HTTP_PARSER_ERRNO(&parser) == HPE_INVALID_HEADER_TOKEN); + return; + } + + fprintf(stderr, + "\n*** Error expected but none in invalid header content test ***\n"); + abort(); +} + +void +test_invalid_header_field_content_error (int req) +{ + test_invalid_header_content(req, "Foo: F\01ailure"); + test_invalid_header_content(req, "Foo: B\02ar"); +} + +void +test_invalid_header_field (int req, const char* str) +{ + http_parser parser; + http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE); + size_t parsed; + const char *buf; + buf = req ? + "GET / HTTP/1.1\r\n" : + "HTTP/1.1 200 OK\r\n"; + parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf)); + assert(parsed == strlen(buf)); + + buf = str; + size_t buflen = strlen(buf); + + parsed = http_parser_execute(&parser, &settings_null, buf, buflen); + if (parsed != buflen) { + assert(HTTP_PARSER_ERRNO(&parser) == HPE_INVALID_HEADER_TOKEN); + return; + } + + fprintf(stderr, + "\n*** Error expected but none in invalid header token test ***\n"); + abort(); +} + +void +test_invalid_header_field_token_error (int req) +{ + test_invalid_header_field(req, "Fo@: Failure"); + test_invalid_header_field(req, "Foo\01\test: Bar"); +} + +void +test_double_content_length_error (int req) +{ + http_parser parser; + http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE); + size_t parsed; + const char *buf; + buf = req ? + "GET / HTTP/1.1\r\n" : + "HTTP/1.1 200 OK\r\n"; + parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf)); + assert(parsed == strlen(buf)); + + buf = "Content-Length: 0\r\nContent-Length: 1\r\n\r\n"; + size_t buflen = strlen(buf); + + parsed = http_parser_execute(&parser, &settings_null, buf, buflen); + if (parsed != buflen) { + assert(HTTP_PARSER_ERRNO(&parser) == HPE_UNEXPECTED_CONTENT_LENGTH); + return; + } + + fprintf(stderr, + "\n*** Error expected but none in double content-length test ***\n"); + abort(); +} + +void +test_chunked_content_length_error (int req) +{ + http_parser parser; + http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE); + size_t parsed; + const char *buf; + buf = req ? + "GET / HTTP/1.1\r\n" : + "HTTP/1.1 200 OK\r\n"; + parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf)); + assert(parsed == strlen(buf)); + + buf = "Transfer-Encoding: chunked\r\nContent-Length: 1\r\n\r\n"; + size_t buflen = strlen(buf); + + parsed = http_parser_execute(&parser, &settings_null, buf, buflen); + if (parsed != buflen) { + assert(HTTP_PARSER_ERRNO(&parser) == HPE_CHUNKED_WITH_CONTENT_LENGTH); + return; + } + + fprintf(stderr, + "\n*** Error expected but none in chunked content-length test ***\n"); + abort(); +} + +void +test_header_cr_no_lf_error (int req) +{ + http_parser parser; + http_parser_init(&parser, req ? HTTP_REQUEST : HTTP_RESPONSE); + size_t parsed; + const char *buf; + buf = req ? + "GET / HTTP/1.1\r\n" : + "HTTP/1.1 200 OK\r\n"; + parsed = http_parser_execute(&parser, &settings_null, buf, strlen(buf)); + assert(parsed == strlen(buf)); + + buf = "Foo: 1\rBar: 1\r\n\r\n"; + size_t buflen = strlen(buf); + + parsed = http_parser_execute(&parser, &settings_null, buf, buflen); + if (parsed != buflen) { + assert(HTTP_PARSER_ERRNO(&parser) == HPE_LF_EXPECTED); + return; + } + + fprintf(stderr, + "\n*** Error expected but none in header whitespace test ***\n"); + abort(); +} + void test_header_overflow_error (int req) { @@ -3591,6 +3740,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++) { diff --git a/deps/npm/.npmrc b/deps/npm/.npmrc deleted file mode 100644 index ca0bc48dd5524f..00000000000000 --- a/deps/npm/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -save-prefix = ~ -proprietary-attribs = false diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index d555682984faf5..eff4750f3efb95 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -1,5 +1,8 @@ language: node_js +sudo: false node_js: + - "5" + - "4" - iojs - "0.12" - "0.10" @@ -9,7 +12,7 @@ env: before_install: - "npm config set spin false" - "npm install -g npm/npm#2.x" - - "sudo mkdir -p /var/run/couchdb" + - "mkdir -p /var/run/couchdb" script: "npm run-script test-all" notifications: slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 9f48c3b5fbd4bf..fcfe1b696a4420 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -301,3 +301,46 @@ Thaddee Tyl Steve Klabnik Andrew Murray Stephan Bönnemann +Kyle M. Tarplee +Derek Peterson +Greg Whiteley +murgatroid99 +Marcin Cieslak +João Reis +Matthew Hasbach +Anna Henningsen +Jon Hall +James Hartig +snopeks +Jason Kurian +Juan Caicedo +Ashley Williams +Andrew Marcinkevičius +Jorrit Schippers +Alex Lukin +Aria Stewart +Tim +Nick Williams +Louis Larry +Jakub Gieryluk +Martin von Gagern +Eymen Gunay +ekmartin +Rafał Pocztarski +Ashley Williams +Mark Reeder +Tiago Rodrigues +Chris Rebert +Jeff McMahan +Scott Addie +Julian Simioni +Jimb Esser +Hal Henke +Alexis Campailla +Beau Gunderson +s100 +Jonathan Persson +Vedat Mahir YILMAZ +Jan Schär +Xcat Liu +Neil Kistner diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 3db382ca343e48..f09094b85584d1 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,1282 @@ +### v2.14.20 (2016-02-18): + +Hope y'all are having a nice week! As usual, it's a fairly limited release. The +most notable thing is some dependency updates that might help the Node.js CI +setup for Windows run a little better, even if we have some work to do on that +path length things, still. + +#### 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 issue, of course, is largely not a problem as of `npm@3`, with its flat +trees, but it still occasionally and viciously bites LTS. + +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. + +* [`4199551`](https://github.com/npm/npm/commit/41995517e617674710748ab6d262670c96124393) + [#11528](https://github.com/npm/npm/pull/11528) + `npm-install-checks@1.0.7`: Just updates the version of npmlog so we can + dedupe it better. + ([@zkat](https://github.com/zkat)) +* [`14d72c7`](https://github.com/npm/npm/commit/14d72c756b89e2d167eb52c1849263dbddcb9f35) + [#11552](https://github.com/npm/npm/pull/11552) + [#11528](https://github.com/npm/npm/pull/11528) + `node-gyp@3.3.0`: AIX support, new `gyp`, update `npmlog` (for the dedupe), + adds `--cafile` command line option, and allows configuration of Node.js and + io.js mirrors. + ([@rvagg](https://github.com/rvagg)) +* [`0453cb9`](https://github.com/npm/npm/commit/0453cb94b33520eb723b7072cd2654b1d0142533) + [#11528](https://github.com/npm/npm/pull/11528) + Do a `dedupe` on `gauge` to flatten our dependencies a bit more. + ([@zkat](https://github.com/zkat)) + +#### OTHER DEP STUFF + +* [`686c0b3`](https://github.com/npm/npm/commit/686c0b37ec3a7b65f9b3849e1099805e5221c408) + `rimraf@2.5.2`: Just updates to glob@7. + ([@isaacs](https://github.com/isaacs)) + +#### @wyze, DOCUMENTATION HERO OF THE PEOPLE, GETS THEIR OWN HEADER + +* [`7232948`](https://github.com/npm/npm/commit/72329484c775376cb40d5b348f453eaaf2f0b821) + [#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)) +* [`922b33a`](https://github.com/npm/npm/commit/922b33aba4362e1e90f42e9348f061a1cc73eafb) + [#11414](https://github.com/npm/npm/pull/11414) + Add colon for consistency. + ([@wyze](https://github.com/wyze)) + +### v2.14.19 (2016-02-11): + +Really tiny micro-release this week! The main thing to note is a dependency +update that means we no longer have `graceful-fs@3` in our dependency tree. This +has some implications for being able to run on future Node.js releases, so +better to get this out the door. 😁 + +#### DEPS + +* [`a556e0f`](https://github.com/npm/npm/commit/a556e0f9dcb5d7b44224ba9c16c9d0dc6c8d2532) + `cmd-shim@2.0.2`: Final straggler using `graceful-fs@<4`. + ([@ForbesLindesay](https://github.com/ForbesLindesay)) + +#### DOCS + +* [`69a2d59`](https://github.com/npm/npm/commit/69a2d599bf0cba674ee268483e9bd5c14333b89f) + [#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)) + +### v2.14.18 (2016-02-04): + +Clearly our docs are perfect after all those wonderful PRs, 'cause this week's +gonna be all about dependency updates. Note: There is a small security-related +fix included here! + +#### SECURITY-RELATED DEPENDENCY UPDATE + +* [`5c095ef`](https://github.com/npm/npm/commit/5c095eff8dc006980d4d083f2007e4dacff23be3) + [#11341](https://github.com/npm/npm/pull/11341) + `request@2.69.0`: Includes security-related dependency updates involving + `hawk` and `is-my-json-valid` + ([@remy](https://github.com/remy) and [@simov](https://github.com/simov)) + +#### OTHER DEPENDENCY UPDATES + +* [`f9c2668`](https://github.com/npm/npm/commit/f9c2668ca3e6e2602d91250ce61280e5e12d0a00) + `which@1.2.4` + ([@isaacs](https://github.com/isaacs)) +* [`2907c43`](https://github.com/npm/npm/commit/2907c43ad4ef87e5f730c2576f680d6837fcbad0) + `spdx-license-ids@1.2.0` + ([@shinnn](https://github.com/shinnn)) +* [`7734069`](https://github.com/npm/npm/commit/773406960bf7f4a87b2ecb6ebf593c62d0e9f95d) + `rimraf@2.5.1` + ([@isaacs](https://github.com/isaacs)) +* [`f4b39a7`](https://github.com/npm/npm/commit/f4b39a7dd5e1335d92aa22c46d99abb33f271b8b) + `retry@0.9.0` + ([@tim-kos](https://github.com/tim-kos)) +* [`ded1e7a`](https://github.com/npm/npm/commit/ded1e7a1c9c7bec29bb7c30a8f85546670e75b56) + Nest `retry@0.8.0` inside `npm-registry-client` to prevent invalid + dependency issue until the latter gets a dependency update. + ([@zkat](https://github.com/zkat)) +* [`ab9f867`](https://github.com/npm/npm/commit/ab9f8679f9687f91ad03adaab6211a897aeebbae) + `read-package-json@2.0.3` + ([@iarna](https://github.com/iarna)) +* [`b638c41`](https://github.com/npm/npm/commit/b638c41607bb936b9eaaceba2aeeda1d34e3a9b2) + `npmlog@2.0.2` + ([@iarna](https://github.com/iarna)) +* [`49f34af`](https://github.com/npm/npm/commit/49f34af463a674359269025d8438feb6a7c69960) + `init-package-json@1.9.3` + ([@iarna](https://github.com/iarna)) +* [`2305dab`](https://github.com/npm/npm/commit/2305dab4e7bff09bb7686cec653cf1e663dbf15d) + `graceful-fs@4.1.3`: Fixed `.close()` not being patched. + ([@isaacs](https://github.com/isaacs)) +* [`18496d9`](https://github.com/npm/npm/commit/18496d9a0fff94e3652655998e8333056aa52b15) + `fs-write-stream-atomic@1.0.8` + ([@iarna](https://github.com/iarna)) +* [`6637bc7`](https://github.com/npm/npm/commit/6637bc7a0e194d82554cd7c91e1794018fef5943) + `config-chain@1.1.10` + ([@dominictarr](https://github.com/dominictarr)) +* [`4222bad`](https://github.com/npm/npm/commit/4222badffed9e9edacea6a8a96a99a164d376158) + `columnify@1.5.4` + ([@timoxley](https://github.com/timoxley)) +* [`df9016f`](https://github.com/npm/npm/commit/df9016f327a2a9ce492ebc75b882b03069438e13) + `ansi@0.3.1`: Added a license file. + ([@TooTallNate](https://github.com/TooTallNate)) + +### v2.14.17 (2016-01-28): + +Another week, another small LTS release! + +#### BETTER ERROR REPORTING YAY + +So as it turns out, when stuff goes wrong, it's actually nice to give people a +better clue rather than just say "oh well 😏". + +* [`5b8ccb9`](https://github.com/npm/npm/commit/5b8ccb91cf11b4edb463609cd4ed1dee84ed4db0) + [#11289](https://github.com/npm/npm/pull/11289) + 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 previous just + make npm error out– this reduces that to a warning. + ([@evanlucas](https://github.com/evanlucas)) +* [`556e42a`](https://github.com/npm/npm/commit/556e42ac6bab078722ddc1dc6cce4428d001133b) + [#11300](https://github.com/npm/npm/pull/11300) + Report symlinked packages as 'linked' in the output for `npm outdated`. + ([@halhenke](https://github.com/halhenke)) +* [`3842317`](https://github.com/npm/npm/commit/3842317583e0ea2eca78e39aa03f5bc06ba21de7) + [#11290](https://github.com/npm/npm/pull/11290) + Suppress warnings about pre-release node versions. This should get node's CI + passing on non-Windows platforms without needing to modify the node version to + get rid of the pre-release suffix. + ([@iarna](https://github.com/iarna)) + +#### EVERYONE WANTS THOSE NPM SOCKS, GEEZE + +Did you know that you can get npm socks for contributing to our docs? I bet +these people do, and now so do you! + +* [`dcde451`](https://github.com/npm/npm/commit/dcde451cb85a6ca08acc6ef45782c652f1d8fc89) + [#11232](https://github.com/npm/npm/pull/11232) + Update automatically included/excluded packages in `package.json`. + ([@jscissr](https://github.com/jscissr)) +* [`e3f8d5b`](https://github.com/npm/npm/commit/e3f8d5be5ac5ec1d72db42f7abf50cc4a8c5935c) + [#11273](https://github.com/npm/npm/pull/11273) + Add an example for `npm view versions`. + ([@vedatmahir](https://github.com/vedatmahir)) +* [`6a06ef2`](https://github.com/npm/npm/commit/6a06ef2252748089f0013de951f2d06160b90306) + [#11272](https://github.com/npm/npm/pull/11272) + Fix a typo in `npm-update.md`. + ([@jonathanp](https://github.com/jonathanp)) +* [`2515ff1`](https://github.com/npm/npm/commit/2515ff1de28f0b261fb25c79a66bd762a65961c4) + [#11215](https://github.com/npm/npm/pull/11215) + Correct small thinko in docs for SPDX expressions. + ([@kemitchell](https://github.com/kemitchell)) +* [`70f897b`](https://github.com/npm/npm/commit/70f897b03da9a5d5d4fd34614e9ee40e6f9e9653) + [#11196](https://github.com/npm/npm/pull/11196) + Make JSON snippets valid JSON in `npm update` docs. + ([@s100](https://github.com/s100)) + +### v2.14.16 (2016-01-21): + +Good to see you all again! It's been a while since we had an LTS release, and +the team continues to work hard to both get the issue tracker under control, and +get our test suite to be awesome and reliable. + +This is also the first LTS release of this year. + +We're gonna have an interesting time -- most of our focus this year will be +around stability and maintainability of the CLI, so you might actually end up +seeing a number of updates even over here, just for the sake of making sure +we're stable, that bugs get fixed, and tests have proper coverage. + +What better way to start this effort, then, than getting Travis tests green, fix +a few things here and there, and tweak a bunch of documentation? 😁 + +#### FIX ALL THE BUGS AND TWEAK ALL THE THINGS + +* [`24b13fb`](https://github.com/npm/npm/commit/24b13fbc57d34db1d5b0a37bcca122c00deba978) + [#11158](https://github.com/npm/npm/pull/11158) + Fix custom node-gyp env var quoting on Windows. + ([@orangemocha](https://github.com/orangemocha)) +* [`e2503f2`](https://github.com/npm/npm/commit/e2503f2be40157b05a9c500ec3b5d16090ffee50) + [#11142](https://github.com/npm/npm/pull/11142) + Fix race condition with `correctMkdir` in the cache directory. + ([@Jimbly](https://github.com/Jimbly)) + +* [`5c0e4c4`](https://github.com/npm/npm/commit/5c0e4c45a29d774ab729e86044377d4e5e424252) + [#10940](https://github.com/npm/npm/pull/10940) + Ignore failures replacing `package.json`. writeFileAtomic is not atomic in + Windows, it fails if the file is being accessed concurrently. + ([@orangemocha](https://github.com/orangemocha)) +* [`2c44d8d`](https://github.com/npm/npm/commit/2c44d8dc8c267d5e054d0175ce2f4750f0986463) + [#10903](https://github.com/npm/npm/pull/10903) + Add tests for `npm adduser --scope`. + ([@ekmartin](https://github.com/ekmartin)) +* [`4cb25d0`](https://github.com/npm/npm/commit/4cb25d0fed5c7792dfd1aec891380ecc1f8a5761) + [#10903](https://github.com/npm/npm/pull/10903) + Add a message informing users when they have been successfully logged in. + ([@ekmartin](https://github.com/ekmartin)) +* [`fe3ec6d`](https://github.com/npm/npm/commit/fe3ec6d6658262054c0c19c55373c21e84ab9f17) + [#10628](https://github.com/npm/npm/pull/10628) + Tell users how to open an issue with a package that has errored. + ([@trodrigues](https://github.com/trodrigues)) + +#### DOCS DOCS DOCS + +We got a TON of lovely documentation patches, too! Thanks all for submitting! + +* [`22482a1`](https://github.com/npm/npm/commit/22482a1f22079d72c3f8ca55c2f0c153bdd024c0) + [#11188](https://github.com/npm/npm/pull/11188) + Briefly explain what's included when you publish. + ([@beaugunderson](https://github.com/beaugunderson)) +* [`fa47724`](https://github.com/npm/npm/commit/fa4772438df0c66a19309dd1c1a3ce43cbee5461) + [#11150](https://github.com/npm/npm/pull/11150) + Advise use of `--depth Infinity` instead of `--depth 9999` in `npm update`. + ([@halhenke](https://github.com/halhenke)) +* [`248ddfe`](https://github.com/npm/npm/commit/248ddfe8f7ddd3318e14bf61de41cab4a638c8a3) + [#11130](https://github.com/npm/npm/pull/11130) + Nuke "using npm programmatically" section from README. The programmatic npm + API is unsupported, and is not guaranteed not to break in non-major versions. + Removing this section so newcomers aren't encouraged to discover or use it. + ([@ljharb](https://github.com/ljharb)) +* [`ae9c452`](https://github.com/npm/npm/commit/ae9c4521222d60ab4a69c19fee5e361c62f41fae) + [#11128](https://github.com/npm/npm/pull/11128) + Add link to local paths section indocs for `package.json`. + ([@orangejulius](https://github.com/orangejulius)) +* [`663a8c6`](https://github.com/npm/npm/commit/663a8c6b4b1647f9b86c15ef32e30023edc8c060) + [#11044](https://github.com/npm/npm/pull/11044) + Update default value documentation for the color option in npm's config. + ([@scottaddie](https://github.com/scottaddie)) +* [`5c1dda0`](https://github.com/npm/npm/commit/5c1dda0d3a18b2954872dba33fbc696ff0700ffe) + [#11037](https://github.com/npm/npm/pull/11037) + Correct the name property max length constraint verbiage. + ([@scottaddie](https://github.com/scottaddie)) +* [`8288365`](https://github.com/npm/npm/commit/8288365d08e97fa3a5b0d31703c015a8be49e07f) + [#10990](https://github.com/npm/npm/pull/10990) + Update folder docs to reflect that process.installPrefix was removed as of + 0.8.x. + ([@jeffmcmahan](https://github.com/jeffmcmahan)) +* [`61d63fa`](https://github.com/npm/npm/commit/61d63fa22c4f09742180c2de460a4ffb6c32738e) + [#10790](https://github.com/npm/npm/pull/10790) + Clarify that `npm install foo` is the same as `npm install foo@latest` now. + ([@cvrebert](https://github.com/cvrebert)) +* [`442c920`](https://github.com/npm/npm/commit/442c9207f375354c91d36df8711ba2d33e1c97f3) + [#10789](https://github.com/npm/npm/pull/10789) + Link over to `npm-dist-tag(1)` in `npm install` docs when they talk about the + `pkg@` syntax. + ([@cvrebert](https://github.com/cvrebert)) +* [`dca7a5e`](https://github.com/npm/npm/commit/dca7a5e2be3bfa306a870a123707d35c732406c0) + [#10788](https://github.com/npm/npm/pull/10788) + Link to tag docs in docs for `npm publish --tag`. + ([@cvrebert](https://github.com/cvrebert)) +* [`a72904e`](https://github.com/npm/npm/commit/a72904e8d4ab1d43ae8150fbe3f6468b0cbb1efd) + [#10787](https://github.com/npm/npm/pull/10787) + Explain why the `latest` tag matters. + ([@cvrebert](https://github.com/cvrebert)) +* [`9d0697a`](https://github.com/npm/npm/commit/9d0697a534046df7efda32170014041bbc1f4e7d) + [#10785](https://github.com/npm/npm/pull/10785) + Replace some quite marks in `npm dist-tag` docs for the sake of consistency. + ([@cvrebert](https://github.com/cvrebert)) + +#### I REALLY LIKE GREEN. CAN YOU TELL? + +So Travis is all green now on `npm@2`, thanks to the removal of nock and a few +other test suite tweaks. This is a fantastic step towards making sure we can all +have confidence in our test suite! 🎉 + +* [`64995be`](https://github.com/npm/npm/commit/64995be6d874356b15c136f9867302d805dfe1e9) [`75ab216`](https://github.com/npm/npm/commit/75ab2164cf79e28ac7f7ebe714f3c5aee99c6626) [`a9f6fe9`](https://github.com/npm/npm/commit/a9f6fe9dc558f17c4a7b9eb83329ac080f7df4b7) [`649c193`](https://github.com/npm/npm/commit/649c193adadf714c2819837f9372a29d724a5ec0) [`94cb05e`](https://github.com/npm/npm/commit/94cb05eaa9e5ad6675cf15c4ac0a44fbdde05900) [`6541690`](https://github.com/npm/npm/commit/65416907008061ac5a5f66b1630a57776803b526) [`255be6f`](https://github.com/npm/npm/commit/255be6f5bca9e3d216f3a5cbdf6714c6c9fcf132) [`9e84fa4`](https://github.com/npm/npm/commit/9e84fa43c49d04cf86ca1678e2a61412f5559cb9) [`8a587b0`](https://github.com/npm/npm/commit/8a587b0c1696ae7302891fa6355fc3e8670e00d3) [`bf812a5`](https://github.com/npm/npm/commit/bf812a54e497a573493346399798aa0b9373ac24) + [#10903](https://github.com/npm/npm/pull/10903) + Get rid of nock from tests, and get Travis green. + ([@zkat](https://github.com/zkat) and [@iarna](https://github.com/iarna)) +* [`70a5310`](https://github.com/npm/npm/commit/70a5310712c6666e753ca8f3bfff4a780ec6292d) + `npm-registry-couchapp@2.6.12`: + Better 0.8 compatibility, and ability to run in travis docker stuff. This + means the test suite should run a lot faster, too! + ([@iarna](https://github.com/iarna)) +* [`28fae39`](https://github.com/npm/npm/commit/28fae399212eda5554e6c0ffd8c9591144ab7b9d) + Get rid of sudo, for Travis! + ([@zkat](https://github.com/zkat)) + +### v2.14.15 (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 + +* [`f482664`](https://github.com/npm/npm/commit/f4826645dc6b5c0f05c5f9187efb28c1a293554f) + [#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)) +* [`529fa1f`](https://github.com/npm/npm/commit/529fa1ff2c6432a773af99a1c5209c0865f7a19c) + [#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 + +* [`1fc7f2b`](https://github.com/npm/npm/commit/1fc7f2b523ea760e08adb9b861b28e3ba450e565) + [#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)) +* [`7fe6950`](https://github.com/npm/npm/commit/7fe6950b44d241bb4d90857a44d89d750af1e2b3) + [#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)) +* [`96ebb90`](https://github.com/npm/npm/commit/96ebb902439e4f6f37f8beffb589769146fecf24) + [#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)) +* [`5196893`](https://github.com/npm/npm/commit/5196893a7496f68a514b83641ff6b72f14d664dd) + [#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)) +* [`8e6712d`](https://github.com/npm/npm/commit/8e6712d4ee128858cab36c77723e35bddbb977ba) + [#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)) +* [`27d2612`](https://github.com/npm/npm/commit/27d2612b3f5aa88b12c943d04e162ce4c3a350ae) + `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 + +* [`fc6c3c5`](https://github.com/npm/npm/commit/fc6c3c53a31e9e11c2616fcd378202e5b80bf286) + `request@2.67.0` ([@simov](https://github.com/simov)) +* [`07013fd`](https://github.com/npm/npm/commit/07013fd0fd55a2eb31fb9334631ee5d0dd5c41bb) + [isaacs/rimraf#89](https://github.com/isaacs/rimraf/pull/89) `rimraf@2.4.4` + ([@zerok](https://github.com/zerok)) +* [`bc149be`](https://github.com/npm/npm/commit/bc149bef871f0f00639509898cece531af3aa8b3) + [isaacs/once#7](https://github.com/isaacs/once/pull/7) `once@1.3.3` + ([@floatdrop](https://github.com/floatdrop)) +* [`ac598d3`](https://github.com/npm/npm/commit/ac598d36e1ad207bc0d8a7eadfd84b26146aec1f) + `lru-cache@3.2.0` ([@isaacs](https://github.com/isaacs)) +* [`1b915ce`](https://github.com/npm/npm/commit/1b915ce1e0787ccb6d8aa235d002d66565f2175d) + `npm-registry-client@7.0.9` ([@othiym23](https://github.com/othiym23)) +* [`df7dd78`](https://github.com/npm/npm/commit/df7dd78b8fe3cc58202996fa6c994fc55419bfa5) + `tap@2.3.1` ([@isaacs](https://github.com/isaacs)) + +### v2.14.14 (2015-12-03): + +#### FIX URL IN LICENSE + +The license incorrectly identified the registry URL as `registry.npmjs.com` and +this has been corrected to `registry.npmjs.org`. + +* [`6051a69`](https://github.com/npm/npm/commit/6051a69b1adc80f5f200077067e831643f655bd4) + [#10685](https://github.com/npm/npm/pull/10685) + Fix npm public registry URL in notices. + ([@kemitchell](https://github.com/kemitchell)) + +#### NO MORE MD5 + +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. + +* [`30b5994`](https://github.com/npm/npm/commit/30b599496a9762482e1cef945a378e3a534fd366) + [#10629](https://github.com/npm/npm/issues/10629) + `write-file-atomic@1.1.4` + ([@othiym23](https://github.com/othiym23)) +* [`68c63ff`](https://github.com/npm/npm/commit/68c63ff1279d3d5ea7b2c970ab5562a8e0536f27) + [#10629](https://github.com/npm/npm/issues/10629) + `fs-write-stream-atomic@1.0.5` + ([@othiym23](https://github.com/othiym23)) + +#### DEPENDENCY UPDATES + +* [`e48e5a9`](https://github.com/npm/npm/commit/e48e5a90b4dcf76124b7e9ea3b295c1383e7f0c8) + [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)) + +### v2.14.13 (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@2.14.11`](https://github.com/npm/npm/releases/tag/v2.14.11), which is where +the split between the CLI's code and the terms of use for the registry was +first made more clear. + +* [`1f3e936`](https://github.com/npm/npm/commit/1f3e936aab6840667948ef281e0c3621df365131) + [#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)) +* [`6733539`](https://github.com/npm/npm/commit/6733539eeb9b32a5f2d1a6aa797987e2252fa760) + [#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! + +* [`460cc09`](https://github.com/npm/npm/commit/460cc0950fd6a005c4e5c4f85af807814209b2bb) + [#10156](https://github.com/npm/npm/issues/10156) completion: enable on + Windows in git bash ([@jakub-g](https://github.com/jakub-g)) + +#### MAKE NODE-GYP A LITTLE BLUER + +* [`333e118`](https://github.com/npm/npm/commit/333e1181082842c21edc62f0ce515928424dff1f) + `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)) + +#### WE LIKE SPDX AND ALL BUT IT'S NOT ACTUALLY A DIRECT DEP, SORRY + +* [`1f4b4bb`](https://github.com/npm/npm/commit/1f4b4bbdf8758281beecb7eaf75d05a6c4a77c15) + Removed `spdx` as a direct npm dependency, since we don't actually need it at + that level, and updated subdeps for `validate-npm-package-license` + ([@othiym23](https://github.com/othiym23)) + +#### 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. + +* [`6101f44`](https://github.com/npm/npm/commit/6101f44737645d9379c3396fae81bbc4d94e1f7e) + [#10250](https://github.com/npm/npm/issues/10250) Correct order of `org:team` + in `npm team` documentation. ([@louislarry](https://github.com/louislarry)) +* [`e8769f9`](https://github.com/npm/npm/commit/e8769f9807b91582c15ef130733e2e72b6c7bda4) + [#10371](https://github.com/npm/npm/issues/10371) Remove broken / duplicate + link to tag. ([@WickyNilliams](https://github.com/WickyNilliams)) +* [`1ae2dbe`](https://github.com/npm/npm/commit/1ae2dbe759feb80d8634569221ec6ee2c6d1d1ff) + [#10419](https://github.com/npm/npm/issues/10419) Remove references to + nonexistent `npm-rm(1)` documentation. ([@KenanY](https://github.com/KenanY)) +* [`777a271`](https://github.com/npm/npm/commit/777a271830a42d4ee62540a89f764a6e7d62de19) + [#10474](https://github.com/npm/npm/issues/10474) Clarify that install finds + dependencies in `package.json`. ([@sleekweasel](https://github.com/sleekweasel)) +* [`dcf4b5c`](https://github.com/npm/npm/commit/dcf4b5cbece1b0ef55ab7665d9acacc0b6b7cd6e) + [#10497](https://github.com/npm/npm/issues/10497) Clarify what a package is + slightly. ([@aredridel](https://github.com/aredridel)) +* [`447b3d6`](https://github.com/npm/npm/commit/447b3d669b2b6c483b8203754ac0a002c67bf015) + [#10539](https://github.com/npm/npm/issues/10539) Remove an extra, spuriously + capitalized letter. ([@alexlukin-softgrad](https://github.com/alexlukin-softgrad)) + +### v2.14.12 (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. + +* [`0e8b15e`](https://github.com/npm/npm/commit/0e8b15e9fbc89e31bd00e573b648846beddfb835) + [#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)) +* [`c4e939c`](https://github.com/npm/npm/commit/c4e939c1d493601d25dcb88e6ffcca73076fd3fd) + [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)) + +#### 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. + +* [`d743620`](https://github.com/npm/npm/commit/d743620a0005213a65d25de771661b4d48a09717) + [#10233](https://github.com/npm/npm/issues/10233) Update Node.js versions + that Travis uses to test npm. ([@iarna](https://github.com/iarna)) + +#### TYPOS IN THE LICENSE, OH MY + +* [`58ac241`](https://github.com/npm/npm/commit/58ac241f556b2c202a8ee33321965e2540361ca7) + [#10478](https://github.com/npm/npm/issues/10478) Correct two typos in npm's + LICENSE. ([@jorrit](https://github.com/jorrit)) + +### v2.14.11 (2015-11-12): + +#### ASK FOR NOTHING, GET LATEST + +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. + +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`). + +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. + +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. + +* [`6f0a646`](https://github.com/npm/npm/commit/6f0a646cd865b24fe3ff25365bf5421780e63e01) + [#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)) + +#### LICENSE CLARIFICATION + +* [`54a9046`](https://github.com/npm/npm/commit/54a90461f068ea89baa5d70248cdf1581897936d) + [#10326](https://github.com/npm/npm/issues/10326) Clarify what-all is covered + by npm's license and point to the registry's terms of use. + ([@kemitchell](https://github.com/kemitchell)) + +#### CLOSER TO GREEN TRAVIS + +* [`28efd3d`](https://github.com/npm/npm/commit/28efd3d7dfb2fa3755076ae706ea4d38c6ee6900) + [#10232](https://github.com/npm/npm/issues/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)) + +#### A BUG FIX + +* [`eacac8f`](https://github.com/npm/npm/commit/eacac8f05014d15217c3d8264d0b00a72eafe2d2) + [#9965](https://github.com/npm/npm/issues/9965) Fix a corrupt `package.json` + file introduced by a merge conflict in + [`022691a`](https://github.com/npm/npm/commit/022691a). + ([@waynebloss](https://github.com/waynebloss)) + +#### A DEPENDENCY UPGRADE + +* [`ea7d8e0`](https://github.com/npm/npm/commit/ea7d8e00a67a3d5877ed72c9728909c848468a9b) + [npm/nopt#51](https://github.com/npm/nopt/pull/51) `nopt@3.0.6`: Allow + types checked to be validated by passed-in name in addition to the JS name of + the type / class. ([@wbecker](https://github.com/wbecker)) + +### v2.14.10 (2015-11-05): + +There's nothing in here that that isn't in the `npm@3.4.0` release notes, but +all of the commit shasums have been adjusted to be correct. Enjoy! + +#### BUG FIXES VIA DEPENDENCY UPDATES + +* [`204c558`](https://github.com/npm/npm/commit/204c558c06637a753c0b41d0cf19f564a1ac3715) + [#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)) +* [`bbdf4ee`](https://github.com/npm/npm/commit/bbdf4ee0a3cd12be6a2ace255b67d573a72f1f8f) + [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)) +* [`d82ff81`](https://github.com/npm/npm/commit/d82ff81403e906931fac701775723626dcb443b3) + [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)) + +#### DOCUMENTATION FIXES + +* [`16361d1`](https://github.com/npm/npm/commit/16361d122f2ff6d1a4729c66153b7c24c698fd19) + [#10036](https://github.com/npm/npm/pull/10036) Fix typo / over-abbreviation. + ([@ifdattic](https://github.com/ifdattic)) +* [`d1343dd`](https://github.com/npm/npm/commit/d1343dda42f113dc322f95687f5a8c7d71a97c35) + [#10176](https://github.com/npm/npm/pull/10176) Fix broken link, scopes => + scope. ([@ashleygwilliams](https://github.com/ashleygwilliams)) +* [`110663d`](https://github.com/npm/npm/commit/110663d000a3908a4853393d9abae481700cf4dc) + [#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 + +* [`7476d2d`](https://github.com/npm/npm/commit/7476d2d31552a41671c425aa7fcc2844e0381008) + [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)) +* [`6ca7888`](https://github.com/npm/npm/commit/6ca7888862cfe8bf802dc7c66632c102acd94cf5) + `read-package-json@2.0.2`: Minor cleanups. + ([@KenanY](https://github.com/KenanY)) + +### v2.14.9 (2015-10-29): + +There's still life in `npm@2`, but for now, enjoy these dependency upgrades! +Also, [@othiym23](https://github.com/othiym23) says hi! _waves_ +[@zkat](https://github.com/zkat) has her hands full, and +[@iarna](https://github.com/iarna)'s handling `npm@3`, so I'm dealing with +`npm@2` and the totally nonexistent weird bridge `npm@1.4` LTS release that may +or may not be happening this week. + +#### CAN'T STOP WON'T STOP UPDATING THOSE DEPENDENCIES + +* [`f52f0cb`](https://github.com/npm/npm/commit/f52f0cb51526314197e9d67619feebbd82a397b7) + [#10150](https://github.com/npm/npm/issues/10150) `chmodr@1.0.2`: Use + `fs.lstat()` to check if an entry is a directory, making `chmodr()` work + properly with NFS mounts on Windows. ([@sheerun](https://github.com/sheerun)) +* [`f7011d7`](https://github.com/npm/npm/commit/f7011d7b3b1d9148a6cd8f7b8359d6fe3269a912) + [#10150](https://github.com/npm/npm/issues/10150) `which@1.2.0`: Additional + command-line parameters, which is nice but not used by npm. + ([@isaacs](https://github.com/isaacs)) +* [`ebcc0d8`](https://github.com/npm/npm/commit/ebcc0d8629388da0b849bbbad590382cd7268f51) + [#10150](https://github.com/npm/npm/issues/10150) `minimatch@3.0.0`: Don't + package browser version. ([@isaacs](https://github.com/isaacs)) +* [`8c98dce`](https://github.com/npm/npm/commit/8c98dce5ffe242bafbe92b849e73e8de1803e256) + [#10150](https://github.com/npm/npm/issues/10150) `fstream-ignore@1.0.3`: + Upgrade to use `minimatch@3` (for deduping purposes). + ([@othiym23](https://github.com/othiym23)) +* [`db9ef33`](https://github.com/npm/npm/commit/db9ef337c253ecf21c921055bf8742e10d1cb3bb) + [#10150](https://github.com/npm/npm/issues/10150) `request@2.65.0`: + Dependency upgrades and a few bug fixes, mostly related to cookie handling. + ([@simov](https://github.com/simov)) + +#### DEVDEPENDENCIES TOO, I GUESS, IT'S COOL + +* [`dfbf621`](https://github.com/npm/npm/commit/dfbf621afa09c46991249b4f9a995d1823ea7ede) + [#10150](https://github.com/npm/npm/issues/10150) `tap@2.2.0`: Better + handling of test order handling (including some test fixes for npm). + ([@isaacs](https://github.com/isaacs)) +* [`cf5ad5a`](https://github.com/npm/npm/commit/cf5ad5a8c88bfd72e30ef8a8d1d3c5508e0b3c23) + [#10150](https://github.com/npm/npm/issues/10150) `nock@2.16.0`: More + expectations, documentation, and bug fixes. + ([@pgte](https://github.com/pgte)) + +### v2.14.8 (2015-10-08): + +#### SLOWLY RECOVERING FROM FEELINGS + +OS&F is definitely my favorite convention I've gone to. Y'all should check it +out next year! Rebecca and Kat are back, although Forrest is out at +[&yet conf](http://andyetconf.com/). + +This week sees another tiny LTS release with non-code-related patches -- just +CI/release things. + +Meanwhile, have you heard? `npm@3` is much faster now! Go upgrade with `npm +install -g npm@latest` and give it a whirl if you haven't already! + +#### IF YOU CHANGE CASING ON A FILE, YOU ARE NOT MY FRIEND + +Seriously. I love me some case-sensitive filesystems, but a lot of us have to +deal with `git` and its funky support for case normalizing systems. Have mercy +and just don't bother if all you're changing is casing, please? Otherwise, I +have to do this little dance to prevent horrible conflicts. + +* [`c3a7b61`](https://github.com/npm/npm/commit/c3a7b619786650a45653c8b55b8741fc7bb5cfda) + [#9804](https://github.com/npm/npm/pulls/9804) Remove the readme file with + weird casing. + ([@zkat](https://github.com/zkat)) +* [`f3f619e`](https://github.com/npm/npm/commit/f3f619e06e4be1378dbf286f897b50e9c69c9557) + [#9804](https://github.com/npm/npm/pulls/9804) Add the readme file back in, + with desired casing. + ([@zkat](https://github.com/zkat)) + +#### IDK. OUR CI DOESN'T EVEN FULLY WORK YET BUT SURE + +Either way, it's nice to make sure we're running stuff on the latest Node. `4.2` +is getting released very soon, though (this week?), and that'll be the first +official LTS release! + +* [`bd0b9ab`](https://github.com/npm/npm/commit/bd0b9ab6e60a31448794bbd88f94672572c3cb55) + [#9827](https://github.com/npm/npm/pulls/9827) Add node `4.0` and `4.1` to + TravisCI + ([@JaKXz](https://github.com/JaKXz)) + +### 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! + +#### TOTALLY FOLLOWING THE RULES ALREADY + +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! + +* [`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)) + +#### JUST. ONE. MORE. + +* [`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)) + +#### OKAY ACTUALLY THE THING I WAS SUPPOSED TO DO + +Anyway -- here's your version bump! :) + +* [`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)) +* [`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)) + +### v2.14.6 (2015-09-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. + +Still, we're bringing you a couple of tiny little changes this week! + +* [`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)) + +### v2.14.5 (2015-09-17): + +#### NPM IS DEAD. LONG LIVE NPM + +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. + +Many kudos to [@iarna](https://github.com/iarna) for her hard work on `npm@3`! + +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. + +#### OKAY THAT'S FINE CAN I DEPRECATE THINGS NOW? + +Yes! Specially if you're using scoped packages. Apparently, deprecating them +never worked, but that should be better now. :) + +* [`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)) + +#### WTF IS `node-waf` + +idk. Some old thing. We don't talk about it anymore. + +* [`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)) + +#### THE `graceful-fs` AND `node-gyp` SAGA CONTINUES + +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. + +* [`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)) + +#### DEPS! DEPS! MORE DEPS! OK STOP DEPS + +* [`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)) + +### v2.14.4 (2015-09-10): + +#### THE GREAT NODEv4 SAGA + +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! + +#### NODE IS DEAD. LONG LIVE NODE! + +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: + +* [`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)) + +[@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: + +* [`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` + ([@thefourtheye](https://github.com/thefourtheye)) + +#### OTHER PATCHES + +* [`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! + +* [`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)) + +#### DOC UPDATES + +* [`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)) + +### v2.14.3 (2015-09-03): + +#### TEAMS AND ORGS STILL BETA. CLI CODE STILL SOLID. + +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™. + +#### OH GOOD, I CAN ACTUALLY UPSTREAM NOW + +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. + +* [`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)) + +#### TALKING ABOUT THE CHANGELOG IN THE CHANGELOG IS LIKE, POMO OR SOMETHING + +* [`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)) + +#### devDependencies UPDATED + +No actual dep updates this week, but we're bumping a couple of devDeps: + +* [`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)) + +### 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)) + +#### BUMP +1 + +* [`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`. + ([@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)) + +#### IT SEEMED LIKE AN IDEA AT THE TIME + +* [`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)) + +#### A SINGLE LONELY DEPENDENCY UPGRADE + +* [`b343b95`](https://github.com/npm/npm/commit/b343b956ef777e321e4251ddc96ec6d80827d9e2) + `request@2.61.0`: Bug fixes and keep-alive tweaks. + ([@simov](https://github.com/simov)) + +### v2.14.0 (2015-08-13): + +#### IT'S HERE! KINDA! + +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. + +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! + +All of these changes were done under [`#9011`](https://github.com/npm/npm/pull/9011): + +* [`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)) + +#### A FEW EXTRA VERSION BUMPS + +* [`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)) + +#### ALSO A DOC FIX + +* [`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)) + +### v2.13.5 (2015-08-07): + +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. + +[@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! + +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! + +#### 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)) + +#### NOPE, NOT DONE WITH DEPENDENCY UPDATES + +* [`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)) + +### v2.13.4 (2015-07-30): + +#### JULY ENDS ON A FAIRLY QUIET NOTE + +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_). + +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. :) + +#### THE PATCH!!! + +So here it is. The patch. Hope it helps. (Thanks, +[@ktarplee](https://github.com/ktarplee)!) + +* [`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)) + +#### OH AND THERE'S A DEV DEPENDENCIES UPDATE + +Hooray. + +* [`d204683`](https://github.com/npm/npm/commit/d2046839d471322e61e3ceb0f00e78e5c481f967) + nock@2.9.1 + ([@pgte](https://github.com/pgte)) + ### v2.13.3 (2015-07-23): #### I'M SAVING THE GOOD JOKES FOR MORE INTERESTING RELEASES @@ -29,12 +1308,10 @@ There's a couple of doc updates! The last one might be interesting. 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 diff --git a/deps/npm/LICENSE b/deps/npm/LICENSE index b6e3548d19ccc9..25f3a7c1f91127 100644 --- a/deps/npm/LICENSE +++ b/deps/npm/LICENSE @@ -1,11 +1,29 @@ +The npm application Copyright (c) npm, Inc. and Contributors -All rights reserved. +Licensed on the terms of The Artistic License 2.0 -npm is released under the Artistic License 2.0, subject to additional terms -that are listed below. +Node package dependencies of the npm application +Copyright (c) their respective copyright owners +Licensed on their respective license terms -The text of the npm License follows and the text of the additional terms -follows the Artistic License 2.0 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 -------- @@ -251,11 +269,11 @@ details. 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. -"npm Logo" created by Mathias Pettersson and Brian Hammond, -used with permission. +"npm Logo" contributed by Mathias Pettersson and Brian Hammond, +use is subject to https://www.npmjs.com/policies/trademark "Gubblebum Blocky" font -Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com +Copyright (c) by Tjarda Koster, https://jelloween.deviantart.com included for use in the npm website and documentation, used with permission. diff --git a/deps/npm/Makefile b/deps/npm/Makefile index d935edfefe6d9c..34e40624b5aee6 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -31,28 +31,6 @@ misc_mandocs = $(shell find doc/misc -name '*.md' \ |sed 's|doc/misc/|man/man7/|g' ) \ man/man7/npm-index.7 - -cli_partdocs = $(shell find doc/cli -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/cli/|html/partial/doc/cli/|g' ) \ - html/partial/doc/README.html - -api_partdocs = $(shell find doc/api -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/api/|html/partial/doc/api/|g' ) - -files_partdocs = $(shell find doc/files -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/files/|html/partial/doc/files/|g' ) \ - html/partial/doc/files/npm-json.html \ - html/partial/doc/files/npm-global.html - -misc_partdocs = $(shell find doc/misc -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/misc/|html/partial/doc/misc/|g' ) \ - html/partial/doc/index.html - - cli_htmldocs = $(shell find doc/cli -name '*.md' \ |sed 's|.md|.html|g' \ |sed 's|doc/cli/|html/doc/cli/|g' ) \ @@ -75,8 +53,6 @@ misc_htmldocs = $(shell find doc/misc -name '*.md' \ mandocs = $(api_mandocs) $(cli_mandocs) $(files_mandocs) $(misc_mandocs) -partdocs = $(api_partdocs) $(cli_partdocs) $(files_partdocs) $(misc_partdocs) - htmldocs = $(api_htmldocs) $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs) all: doc @@ -103,7 +79,7 @@ clean: markedclean marked-manclean doc-clean uninstall uninstall: node cli.js rm npm -g -f -doc: $(mandocs) $(htmldocs) $(partdocs) +doc: $(mandocs) $(htmldocs) markedclean: rm -rf node_modules/marked node_modules/.bin/marked .building_marked @@ -143,73 +119,43 @@ man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json @[ -d man/man5 ] || mkdir -p man/man5 scripts/doc-build.sh $< $@ -man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json - @[ -d man/man7 ] || mkdir -p man/man7 - scripts/doc-build.sh $< $@ - - doc/misc/npm-index.md: scripts/index-build.js package.json node scripts/index-build.js > $@ - -# html/doc depends on html/partial/doc -html/doc/%.html: html/partial/doc/%.html - @[ -d html/doc ] || mkdir -p html/doc - scripts/doc-build.sh $< $@ - -html/doc/README.html: html/partial/doc/README.html +html/doc/index.html: doc/misc/npm-index.md $(html_docdeps) @[ -d html/doc ] || mkdir -p html/doc scripts/doc-build.sh $< $@ -html/doc/cli/%.html: html/partial/doc/cli/%.html - @[ -d html/doc/cli ] || mkdir -p html/doc/cli +man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json + @[ -d man/man7 ] || mkdir -p man/man7 scripts/doc-build.sh $< $@ -html/doc/misc/%.html: html/partial/doc/misc/%.html - @[ -d html/doc/misc ] || mkdir -p html/doc/misc +html/doc/README.html: README.md $(html_docdeps) + @[ -d html/doc ] || mkdir -p html/doc scripts/doc-build.sh $< $@ -html/doc/files/%.html: html/partial/doc/files/%.html - @[ -d html/doc/files ] || mkdir -p html/doc/files +html/doc/cli/%.html: doc/cli/%.md $(html_docdeps) + @[ -d html/doc/cli ] || mkdir -p html/doc/cli scripts/doc-build.sh $< $@ -html/doc/api/%.html: html/partial/doc/api/%.html +html/doc/api/%.html: doc/api/%.md $(html_docdeps) @[ -d html/doc/api ] || mkdir -p html/doc/api scripts/doc-build.sh $< $@ - -html/partial/doc/index.html: doc/misc/npm-index.md $(html_docdeps) - @[ -d html/partial/doc ] || mkdir -p html/partial/doc - scripts/doc-build.sh $< $@ - -html/partial/doc/README.html: README.md $(html_docdeps) - @[ -d html/partial/doc ] || mkdir -p html/partial/doc - scripts/doc-build.sh $< $@ - -html/partial/doc/cli/%.html: doc/cli/%.md $(html_docdeps) - @[ -d html/partial/doc/cli ] || mkdir -p html/partial/doc/cli - scripts/doc-build.sh $< $@ - -html/partial/doc/api/%.html: doc/api/%.md $(html_docdeps) - @[ -d html/partial/doc/api ] || mkdir -p html/partial/doc/api - scripts/doc-build.sh $< $@ - -html/partial/doc/files/npm-json.html: html/partial/doc/files/package.json.html +html/doc/files/npm-json.html: html/doc/files/package.json.html cp $< $@ -html/partial/doc/files/npm-global.html: html/partial/doc/files/npm-folders.html +html/doc/files/npm-global.html: html/doc/files/npm-folders.html cp $< $@ -html/partial/doc/files/%.html: doc/files/%.md $(html_docdeps) - @[ -d html/partial/doc/files ] || mkdir -p html/partial/doc/files +html/doc/files/%.html: doc/files/%.md $(html_docdeps) + @[ -d html/doc/files ] || mkdir -p html/doc/files scripts/doc-build.sh $< $@ -html/partial/doc/misc/%.html: doc/misc/%.md $(html_docdeps) - @[ -d html/partial/doc/misc ] || mkdir -p html/partial/doc/misc +html/doc/misc/%.html: doc/misc/%.md $(html_docdeps) + @[ -d html/doc/misc ] || mkdir -p html/doc/misc scripts/doc-build.sh $< $@ - - marked: node_modules/.bin/marked node_modules/.bin/marked: diff --git a/deps/npm/README.md b/deps/npm/README.md index dcd06b50dbc566..5e907a6b4b7658 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -14,9 +14,20 @@ Much more info available via `npm help` once it's installed. To install an old **and unsupported** version of npm that works on node 0.3 and prior, clone the git repo and dig through the old tags and branches. +**npm is configured to use npm, Inc.'s public package registry at + by default.** + +You can configure npm to use any compatible registry you +like, and even run your own registry. Check out the [doc on +registries](https://docs.npmjs.com/misc/registry). + +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 +. + ## Super Easy Install -npm comes with [node](http://nodejs.org/download/) now. +npm is bundled with [node](http://nodejs.org/download/). ### Windows Computers @@ -127,52 +138,6 @@ 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. -## Using npm Programmatically - -Although npm can be used programmatically, its API is meant for use by the CLI -*only*, 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 `npm` command with appropriate arguments. - -The semantic version of npm refers to the CLI itself, rather than the -underlying API. _The internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver._ - -If you _still_ would like to use npm programmatically, it's _possible_. The API -isn't very well documented, but it _is_ rather simple. - -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. - -```javascript -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) { .... }) -}) -``` - -The `load` function takes an object hash of the command-line configs. -The various `npm.commands.` functions take an **array** of -positional argument **strings**. The last argument to any -`npm.commands.` function is a callback. Some commands take other -optional arguments. Read the source. - -You cannot set configs individually for any single npm function at this -time. Since `npm` is a singleton, any call to `npm.config.set` will -change the value for *all* npm commands in that process. - -See `./bin/npm-cli.js` for an example of pulling config values off of the -command line arguments using nopt. You may also want to check out `npm -help config` to learn about all the options you can set there. - ## More Docs Check out the [docs](https://docs.npmjs.com/), @@ -183,47 +148,6 @@ You can use the `npm help` command to read any of them. If you're a developer, and you want to use npm to publish your program, you should [read this](https://docs.npmjs.com/misc/developers) -## Legal Stuff - -"npm" and "The npm Registry" are owned by npm, Inc. -All rights reserved. See the included LICENSE file for more details. - -"Node.js" and "node" are trademarks owned by Joyent, Inc. - -Modules published on the npm registry are not officially endorsed by -npm, Inc. or the Node.js project. - -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. - -If you have a complaint about a package in the public npm registry, -and cannot [resolve it with the package -owner](https://docs.npmjs.com/misc/disputes), please email - and explain the situation. - -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. - -### In plainer english - -npm is the property of npm, Inc. - -If you publish something, it's yours, and you are solely accountable -for it. - -If other people publish something, it's theirs. - -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. - -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. - ## BUGS When you find issues, please report them: diff --git a/deps/npm/bin/node-gyp-bin/node-gyp.cmd b/deps/npm/bin/node-gyp-bin/node-gyp.cmd index 83ea8f59247858..083c9c58a502a1 100755 --- a/deps/npm/bin/node-gyp-bin/node-gyp.cmd +++ b/deps/npm/bin/node-gyp-bin/node-gyp.cmd @@ -1,5 +1,5 @@ -if not defined npm_config_node_gyp ( - node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* -) else ( - node %npm_config_node_gyp% %* -) +if not defined npm_config_node_gyp ( + node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* +) else ( + node "%npm_config_node_gyp%" %* +) diff --git a/deps/npm/bin/npm b/deps/npm/bin/npm index d020ccfe7cba75..45e8e41031cd27 100755 --- a/deps/npm/bin/npm +++ b/deps/npm/bin/npm @@ -7,8 +7,21 @@ case `uname` in *CYGWIN*) basedir=`cygpath -w "$basedir"`;; esac -if [ -x "$basedir/node.exe" ]; then - "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@" -else - node "$basedir/node_modules/npm/bin/npm-cli.js" "$@" +NODE_EXE="$basedir/node.exe" +if ! [ -x "$NODE_EXE" ]; then + NODE_EXE=node fi + +NPM_CLI_JS="$basedir/node_modules/npm/bin/npm-cli.js" + +case `uname` in + *CYGWIN*) + NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` + NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" + if [ -f "$NPM_PREFIX_NPM_CLI_JS" ]; then + NPM_CLI_JS="$NPM_PREFIX_NPM_CLI_JS" + fi + ;; +esac + +"$NODE_EXE" "$NPM_CLI_JS" "$@" diff --git a/deps/npm/bin/npm.cmd b/deps/npm/bin/npm.cmd index 7720e20529ccb6..880554dcdd686e 100644 --- a/deps/npm/bin/npm.cmd +++ b/deps/npm/bin/npm.cmd @@ -1,6 +1,19 @@ -:: Created by npm, please don't edit manually. -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* -) ELSE ( - node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %* -) +:: Created by npm, please don't edit manually. +@ECHO OFF + +SETLOCAL + +SET "NODE_EXE=%~dp0\node.exe" +IF NOT EXIST "%NODE_EXE%" ( + SET "NODE_EXE=node" +) + +SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" +FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( + SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js" +) +IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" ( + SET "NPM_CLI_JS=%NPM_PREFIX_NPM_CLI_JS%" +) + +"%NODE_EXE%" "%NPM_CLI_JS%" %* diff --git a/deps/npm/doc/api/npm-view.md b/deps/npm/doc/api/npm-view.md index fd0076c9674864..0c110f52ed1c59 100644 --- a/deps/npm/doc/api/npm-view.md +++ b/deps/npm/doc/api/npm-view.md @@ -65,7 +65,7 @@ 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) + npm.commands.view(["yui3@>0.5.4", "dependencies.jsdom"], callback) ## OUTPUT diff --git a/deps/npm/doc/cli/npm-access.md b/deps/npm/doc/cli/npm-access.md index 85db7e654186dc..aabdbe03ca0169 100644 --- a/deps/npm/doc/cli/npm-access.md +++ b/deps/npm/doc/cli/npm-access.md @@ -6,10 +6,11 @@ npm-access(1) -- Set access level on published packages npm access public [] npm access restricted [] - npm access add [] - npm access rm [] + npm access grant [] + npm access revoke [] - npm access ls [] + npm access ls-packages [||] + npm access ls-collaborators [ []] npm access edit [] ## DESCRIPTION @@ -23,13 +24,20 @@ subcommand. * public / restricted: Set a package to be either publicly accessible or restricted. -* add / rm: +* grant / revoke: Add or remove the ability of users and teams to have read-only or read-write access to a package. -* ls: +* ls-packages: + + Show all of the packages a user or a team is able to access, along with the + access level, except for read-only public packages (it won't print the whole + registry listing) + +* ls-collaborators: Show all of the access privileges for a package. Will only show permissions - for packages to which you have at least read access. + for packages to which you have at least read access. If `` is passed in, + the list is filtered only to teams _that_ user happens to belong to. * edit: Set the access privileges for a package at once using `$EDITOR`. @@ -56,8 +64,11 @@ If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use `--access=public`. +Management of teams and team memberships is done with the `npm team` command. + ## SEE ALSO +* npm-team(1) * npm-publish(1) * npm-config(7) * npm-registry(7) diff --git a/deps/npm/doc/cli/npm-adduser.md b/deps/npm/doc/cli/npm-adduser.md index 80d0f9855b2a87..24d3611e61c604 100644 --- a/deps/npm/doc/cli/npm-adduser.md +++ b/deps/npm/doc/cli/npm-adduser.md @@ -28,7 +28,7 @@ your existing record. ### 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)`. diff --git a/deps/npm/doc/cli/npm-dist-tag.md b/deps/npm/doc/cli/npm-dist-tag.md index ce4f7ed4d58f0e..06721bbae6ab3b 100644 --- a/deps/npm/doc/cli/npm-dist-tag.md +++ b/deps/npm/doc/cli/npm-dist-tag.md @@ -33,17 +33,30 @@ When installing dependencies, a preferred tagged version may be specified: 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 ` (without any `@` or `@` +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. +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 ` (without any `@` or `@` +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. -A project might choose to have multiple streams of development, e.g., -"stable", "canary". +By default, other than `latest`, no tag has any special significance to npm +itself. ## CAVEATS @@ -69,5 +82,4 @@ begin with a number or the letter `v`. * npm-registry(7) * npm-config(1) * npm-config(7) -* npm-tag(3) * npmrc(5) diff --git a/deps/npm/doc/cli/npm-help-search.md b/deps/npm/doc/cli/npm-help-search.md index 7bf7401ba0cb49..092562d7d8e461 100644 --- a/deps/npm/doc/cli/npm-help-search.md +++ b/deps/npm/doc/cli/npm-help-search.md @@ -21,7 +21,7 @@ command directly. ### 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. diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md index be32f7b296ef01..3ae1f0aae381ed 100644 --- a/deps/npm/doc/cli/npm-install.md +++ b/deps/npm/doc/cli/npm-install.md @@ -21,11 +21,11 @@ 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 `@` that is published on the registry (see `npm-registry(7)`) with (c) -* e) a `@` that points to (d) +* e) a `@` (see `npm-dist-tag(1)`) that points to (d) * f) a `` that has a "latest" tag satisfying (e) * g) a `` that resolves to (b) @@ -43,7 +43,9 @@ after packing it up into a tarball (b). 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. + 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`. @@ -74,7 +76,7 @@ after packing it up into a tarball (b). * `npm install [@/] [--save|--save-dev|--save-optional]`: Do a `@` install, where `` 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. @@ -329,5 +331,6 @@ affects a real use-case, it will be investigated. * npmrc(5) * npm-registry(7) * npm-tag(1) -* npm-rm(1) +* npm-uninstall(1) * npm-shrinkwrap(1) +* package.json(5) diff --git a/deps/npm/doc/cli/npm-logout.md b/deps/npm/doc/cli/npm-logout.md index 867953c02449bc..9d692f4288b3ee 100644 --- a/deps/npm/doc/cli/npm-logout.md +++ b/deps/npm/doc/cli/npm-logout.md @@ -22,7 +22,7 @@ connected to that scope, if set. ### 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. @@ -31,14 +31,9 @@ it takes precedence. 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. +If specified, you will be logged out of the specified scope. See `npm-scope(7)`. - 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. + npm logout --scope=@myco ## SEE ALSO diff --git a/deps/npm/doc/cli/npm-outdated.md b/deps/npm/doc/cli/npm-outdated.md index aa2a7d5dd16e02..076d213d09ef65 100644 --- a/deps/npm/doc/cli/npm-outdated.md +++ b/deps/npm/doc/cli/npm-outdated.md @@ -10,9 +10,61 @@ npm-outdated(1) -- Check for outdated packages 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`: +```json +{ + "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 @@ -47,6 +99,7 @@ project. ### depth +* Default: 0 * Type: Int Max depth for checking dependency tree. @@ -54,5 +107,6 @@ Max depth for checking dependency tree. ## SEE ALSO * npm-update(1) +* npm-dist-tag(1) * npm-registry(7) * npm-folders(5) diff --git a/deps/npm/doc/cli/npm-prune.md b/deps/npm/doc/cli/npm-prune.md index 846a04240e598d..f52a911582d442 100644 --- a/deps/npm/doc/cli/npm-prune.md +++ b/deps/npm/doc/cli/npm-prune.md @@ -22,6 +22,6 @@ negate `NODE_ENV` being set to `production`. ## SEE ALSO -* npm-rm(1) +* npm-uninstall(1) * npm-folders(5) * npm-ls(1) diff --git a/deps/npm/doc/cli/npm-publish.md b/deps/npm/doc/cli/npm-publish.md index 8c447d0df9c4d5..cf2f4feb5370f5 100644 --- a/deps/npm/doc/cli/npm-publish.md +++ b/deps/npm/doc/cli/npm-publish.md @@ -9,9 +9,11 @@ npm-publish(1) -- Publish a package ## 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 is present. 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 @@ -27,7 +29,8 @@ specifying a different default registry or using a `npm-scope(7)` in the name * `[--tag ]` Registers the published package with the given tag, such that `npm install @` 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 ]` Tells the registry whether this package should be published as public or diff --git a/deps/npm/doc/cli/npm-shrinkwrap.md b/deps/npm/doc/cli/npm-shrinkwrap.md index ca9cb257b9d351..ac6bdef776a972 100644 --- a/deps/npm/doc/cli/npm-shrinkwrap.md +++ b/deps/npm/doc/cli/npm-shrinkwrap.md @@ -86,9 +86,13 @@ This generates `npm-shrinkwrap.json`, 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" } } } diff --git a/deps/npm/doc/cli/npm-start.md b/deps/npm/doc/cli/npm-start.md index 759de221f3857b..94c468c296dfda 100644 --- a/deps/npm/doc/cli/npm-start.md +++ b/deps/npm/doc/cli/npm-start.md @@ -7,7 +7,13 @@ npm-start(1) -- Start a package ## 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`](http://blog.npmjs.org/post/98131109725/npm-2-0-0), you can +use custom arguments when executing scripts. Refer to npm-run-script(1) for +more details. ## SEE ALSO diff --git a/deps/npm/doc/cli/npm-team.md b/deps/npm/doc/cli/npm-team.md new file mode 100644 index 00000000000000..031dba095c3951 --- /dev/null +++ b/deps/npm/doc/cli/npm-team.md @@ -0,0 +1,55 @@ +npm-team(1) -- Manage organization teams and team memberships +============================================================= + +## SYNOPSIS + + npm team create + npm team destroy + + npm team add + npm team rm + + npm team ls | + + npm team edit + +## 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 +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 +`foo:developers` in these commands. + +* create / destroy: + Create a new team, or destroy an existing one. + +* add / rm: + Add a user to an existing team, or remove a user from a team they belong to. + +* ls: + If performed on an organization name, will return a list of existing teams + under that organization. If performed on a team, it will instead return a list + of all users belonging to that particular team. + +## DETAILS + +`npm team` always operates directly on the current registry, configurable from +the command line using `--registry=`. + +In order to create teams and manage team membership, you must be a *team admin* +under the given organization. Listing teams and team memberships may be done by +any member of the organizations. + +Organization creation and management of team admins and *organization* members +is done through the website, not the npm CLI. + +To use teams to manage permissions on packages belonging to your organization, +use the `npm access` command to grant or revoke the appropriate permissions. + +## SEE ALSO + +* npm-access(1) +* npm-registr(7) diff --git a/deps/npm/doc/cli/npm-uninstall.md b/deps/npm/doc/cli/npm-uninstall.md index bfa667c3e26eab..43fd65ea2ac75a 100644 --- a/deps/npm/doc/cli/npm-uninstall.md +++ b/deps/npm/doc/cli/npm-uninstall.md @@ -1,4 +1,4 @@ -npm-rm(1) -- Remove a package +npm-uninstall(1) -- Remove a package ============================= ## SYNOPSIS diff --git a/deps/npm/doc/cli/npm-update.md b/deps/npm/doc/cli/npm-update.md index ce31c28910ff08..035cbff2939d05 100644 --- a/deps/npm/doc/cli/npm-update.md +++ b/deps/npm/doc/cli/npm-update.md @@ -22,7 +22,7 @@ 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 +To get the old behavior, use `npm --depth Infinity 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. @@ -44,16 +44,17 @@ 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" } } ``` @@ -63,8 +64,8 @@ on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1` are If `app`'s `package.json` contains: ``` -dependencies: { - dep1: "^1.1.1" +"dependencies": { + "dep1": "^1.1.1" } ``` @@ -76,8 +77,8 @@ Then `npm update` will install `dep1@1.2.2`, because `1.2.2` is `latest` and However, if `app`'s `package.json` contains: ``` -dependencies: { - dep1: "~1.1.1" +"dependencies": { + "dep1": "~1.1.1" } ``` @@ -91,8 +92,8 @@ which is `1.1.2`. 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" } ``` @@ -102,8 +103,8 @@ versions which satisfy `^0.2.0`. If the dependence were on `^0.4.0`: ``` -dependencies: { - dep1: "^0.4.0" +"dependencies": { + "dep1": "^0.4.0" } ``` @@ -117,8 +118,8 @@ the minimum required dependency in `package.json`, you can use `npm update --save`. For example if `package.json` contains ``` -dependencies: { - dep1: "^1.1.1" +"dependencies": { + "dep1": "^1.1.1" } ``` @@ -126,8 +127,8 @@ 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" } ``` @@ -136,7 +137,7 @@ 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`. diff --git a/deps/npm/doc/cli/npm-view.md b/deps/npm/doc/cli/npm-view.md index 683ed09f46f651..0e3df33d66867b 100644 --- a/deps/npm/doc/cli/npm-view.md +++ b/deps/npm/doc/cli/npm-view.md @@ -66,6 +66,11 @@ 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 diff --git a/deps/npm/doc/cli/npm.md b/deps/npm/doc/cli/npm.md index 331a03577b20d0..ae3a41d84bb3de 100644 --- a/deps/npm/doc/cli/npm.md +++ b/deps/npm/doc/cli/npm.md @@ -130,7 +130,7 @@ 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. -* +* * ## BUGS @@ -138,7 +138,7 @@ the issues list or ask on the mailing list. When you find issues, please report them: * web: - + * email: diff --git a/deps/npm/doc/files/npm-folders.md b/deps/npm/doc/files/npm-folders.md index 1fb21b1a310e53..6846b1fce8f713 100644 --- a/deps/npm/doc/files/npm-folders.md +++ b/deps/npm/doc/files/npm-folders.md @@ -20,12 +20,10 @@ This document will tell you what it puts where. ### 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 @@ -45,7 +43,7 @@ Global installs on Windows go to `{prefix}/node_modules` (that is, no 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. diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index b0d86d9492f0d0..ccbc6715acb7ed 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -21,7 +21,7 @@ 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. @@ -105,15 +105,15 @@ current SPDX license identifier for the license you're using, like this: You can check [the full list of SPDX license IDs](https://spdx.org/licenses/). Ideally you should pick one that is -[OSI](http://opensource.org/licenses/alphabetical) approved. +[OSI](https://opensource.org/licenses/alphabetical) approved. If your package is licensed under multiple common licenses, use an [SPDX license -expression syntax version 2.0 string](http://npmjs.com/package/spdx), like this: +expression syntax version 2.0 string](https://npmjs.com/package/spdx), 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 " } @@ -178,17 +178,18 @@ The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. (Unless they would be ignored by another rule.) -You can also provide a ".npmignore" file in the root of your package, -which will keep files from being included, even if they would be picked -up by the files array. The ".npmignore" file works just like a -".gitignore". +You can also provide a ".npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array. The `.npmignore` file +works just like a `.gitignore`. Certain files are always included, regardless of settings: * `package.json` -* `README` (and its variants) -* `CHANGELOG` (and its variants) +* `README` +* `CHANGES` / `CHANGELOG` / `HISTORY` (any casing and file extension) * `LICENSE` / `LICENCE` +* The file in the "main" field Conversely, some files are always ignored: @@ -198,10 +199,11 @@ Conversely, some files are always ignored: * `.hg` * `.lock-wscript` * `.wafpickle-N` -* `*.swp` +* `.*.swp` * `.DS_Store` * `._*` * `npm-debug.log` +* `.npmrc` ## main @@ -410,7 +412,7 @@ See semver(7) for more details about specifying version ranges. * `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](#local-paths) below For example, these are all valid: @@ -571,7 +573,7 @@ this. If you depend on features introduced in 1.5.2, use `">= 1.5.2 < 2"`. Array of package names that will be bundled when publishing the package. -If this is spelled `"bundleDependencies"`, then that is also honorable. +If this is spelled `"bundleDependencies"`, then that is also honored. ## optionalDependencies @@ -733,4 +735,4 @@ npm will default some values based on package contents. * npm-faq(7) * npm-install(1) * npm-publish(1) -* npm-rm(1) +* npm-uninstall(1) diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 4b9d32ba3338cc..76471601c162d9 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -232,7 +232,7 @@ 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. diff --git a/deps/npm/doc/misc/npm-developers.md b/deps/npm/doc/misc/npm-developers.md index 2b025034f85188..25957f11ecbf07 100644 --- a/deps/npm/doc/misc/npm-developers.md +++ b/deps/npm/doc/misc/npm-developers.md @@ -100,9 +100,11 @@ Use a `.npmignore` file to keep stuff out of your package. If there's no `.npmignore` file, but there *is* a `.gitignore` file, then npm will ignore the stuff matched by the `.gitignore` file. If you *want* to include something that is excluded by your `.gitignore` file, you can -create an empty `.npmignore` file to override it. +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](http://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files) +`.npmignore` files follow the [same pattern rules](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files) as `.gitignore` files: * Blank lines or lines starting with `#` are ignored. @@ -118,9 +120,11 @@ need to add them to `.npmignore` explicitly: * `.DS_Store` * `.git` * `.hg` +* `.npmrc` * `.lock-wscript` * `.svn` * `.wafpickle-*` +* `config.gypi` * `CVS` * `npm-debug.log` @@ -132,7 +136,9 @@ The following paths and files are never ignored, so adding them to `.npmignore` is pointless: * `package.json` -* `README.*` +* `README` (and its variants) +* `CHANGELOG` (and its variants) +* `LICENSE` / `LICENCE` ## Link Packages @@ -185,7 +191,7 @@ 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 diff --git a/deps/npm/doc/misc/npm-faq.md b/deps/npm/doc/misc/npm-faq.md deleted file mode 100644 index 557ec1a9c6c27a..00000000000000 --- a/deps/npm/doc/misc/npm-faq.md +++ /dev/null @@ -1,392 +0,0 @@ -npm-faq(7) -- Frequently Asked Questions -======================================== - -## Where can I find these docs in HTML? - -, 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: - - - -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 . - -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 . - -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 `@` that is published on the registry with (c) -* e) a `@` that points to (d) -* f) a `` 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.) - -## How do I symlink to a dev folder so I don't have to keep re-installing? - -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 . - -## 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 - 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 -or posting an issue at . 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 - - -References: - -1. For the reasoning behind the "one global namespace", please see this - discussion: (TL;DR: It doesn't - actually make things better, and can make them worse.) - -2. For the pre-implementation discussion of the scoped package feature, see - this discussion: - -## 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](https://www.npmjs.com) are maintained and operated by the -good folks at [npm, Inc.](http://www.npmjs.com) - -## 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 - -* npm(1) -* npm-developers(7) -* package.json(5) -* npm-config(1) -* npm-config(7) -* npmrc(5) -* npm-config(7) -* npm-folders(5) diff --git a/deps/npm/doc/misc/npm-index.md b/deps/npm/doc/misc/npm-index.md index 837ef26ba0180d..3cbdff65eb3f39 100644 --- a/deps/npm/doc/misc/npm-index.md +++ b/deps/npm/doc/misc/npm-index.md @@ -181,6 +181,10 @@ Stop a package Tag a published version +### npm-team(1) + +Manage organization teams and team memberships + ### npm-test(1) Test a package @@ -409,14 +413,14 @@ Developer Guide Handling Module Name Disputes -### npm-faq(7) - -Frequently Asked Questions - ### npm-index(7) Index of all npm documentation +### npm-orgs(7) + +Working with Teams & Orgs + ### npm-registry(7) The JavaScript Package Registry diff --git a/deps/npm/doc/misc/npm-orgs.md b/deps/npm/doc/misc/npm-orgs.md new file mode 100644 index 00000000000000..1f9977eaddf4be --- /dev/null +++ b/deps/npm/doc/misc/npm-orgs.md @@ -0,0 +1,90 @@ +npm-orgs(7) -- Working with Teams & Orgs +======================================== + +## DESCRIPTION + +There are three levels of org users: + +1. Super admin, controls billing & adding people to the org. +2. Team admin, manages team membership & package access. +3. Developer, works on packages they are given access to. + +The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a `developers` team that all users are automatically added to. + +The team admin is the person who manages team creation, team membership, and package access for teams. The team admin grants package access to teams, not individuals. + +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. `npm access` see npm-team(1) for more details + +## Team Admins create teams + +* Check who you’ve added to your org: + +``` +npm team ls :developers +``` + +* Each org is automatically given a `developers` team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the `access` command. + +* Create a new team: + +``` +npm team create +``` + +* Add members to that team: + +``` +npm team add +``` + +## Publish a package and adjust package access + +* In package directory, run + +``` +npm init --scope= +``` +to scope it for your org & publish as usual + +* Grant access: + +``` +npm access grant [] +``` + +* Revoke access: + +``` +npm access revoke [] +``` + +## Monitor your package access + +* See what org packages a team member can access: + +``` +npm access ls-packages +``` + +* See packages available to a specific team: + +``` +npm access ls-packages +``` + +* Check which teams are collaborating on a package: + +``` +npm access ls-collaborators +``` + +## SEE ALSO + +* npm-team(1) +* npm-access(1) +* npm-scope(7) diff --git a/deps/npm/doc/misc/npm-registry.md b/deps/npm/doc/misc/npm-registry.md index bfc978faab992c..cc1a1b299c25e0 100644 --- a/deps/npm/doc/misc/npm-registry.md +++ b/deps/npm/doc/misc/npm-registry.md @@ -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. -The official public npm registry is at . It +The official public npm registry is at . It is powered by a CouchDB database, of which there is a public mirror at -. The code for the couchapp is -available at . +. The code for the couchapp is +available at . 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 diff --git a/deps/npm/doc/misc/npm-scripts.md b/deps/npm/doc/misc/npm-scripts.md index 1594d3c4132250..10d82bec076e87 100644 --- a/deps/npm/doc/misc/npm-scripts.md +++ b/deps/npm/doc/misc/npm-scripts.md @@ -69,10 +69,10 @@ npm will default some script values based on package contents. If there is a `server.js` file in the root of your package, then npm will default the `start` command to `node server.js`. -* `"preinstall": "node-waf clean || true; node-waf configure build"`: +* `"install": "node-gyp rebuild"`: - If there is a `wscript` file in the root of your package, npm will - default the `preinstall` command to compile using node-waf. + If there is a `bindings.gyp` file in the root of your package, npm will + default the `install` command to compile using node-gyp. ## USER @@ -157,10 +157,10 @@ For example, if your package.json contains this: } } -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. @@ -210,7 +210,7 @@ above. 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 diff --git a/deps/npm/doc/misc/removing-npm.md b/deps/npm/doc/misc/removing-npm.md index bedd28a2faca3e..84274522c22fef 100644 --- a/deps/npm/doc/misc/removing-npm.md +++ b/deps/npm/doc/misc/removing-npm.md @@ -50,5 +50,5 @@ modules. To track those down, you can do the following: ## SEE ALSO * README -* npm-rm(1) +* npm-uninstall(1) * npm-prune(1) diff --git a/deps/npm/doc/misc/semver.md b/deps/npm/doc/misc/semver.md index 2bd5acc29bb0b3..97a50cdf0c500d 100644 --- a/deps/npm/doc/misc/semver.md +++ b/deps/npm/doc/misc/semver.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/html/doc/README.html b/deps/npm/html/doc/README.html index 0ad6f04cf5558a..288ea802b45263 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -18,8 +18,16 @@

IMPORTANT

You need node v0.8 or higher to run this program.

To install an old and unsupported version of npm that works on node 0.3 and prior, clone the git repo and dig through the old tags and branches.

+

npm is configured to use npm, Inc.'s public package registry at +https://registry.npmjs.org by default.

+

You can configure npm to use any compatible registry you +like, and even run your own registry. Check out the doc on +registries.

+

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.

Super Easy Install

-

npm comes with node now.

+

npm is bundled with node.

Windows Computers

Get the MSI. npm is in it.

Apple Macintosh Computers

@@ -84,76 +92,12 @@

More Severe Uninstalling

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.

-

Using npm Programmatically

-

Although npm can be used programmatically, its API is meant for use by the CLI -only, 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 npm command with appropriate arguments.

-

The semantic version of npm refers to the CLI itself, rather than the -underlying API. The internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver.

-

If you still would like to use npm programmatically, it's possible. The API -isn't very well documented, but it is rather simple.

-

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.

-
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) { .... })
-})
-
-

The load function takes an object hash of the command-line configs. -The various npm.commands.<cmd> functions take an array of -positional argument strings. The last argument to any -npm.commands.<cmd> function is a callback. Some commands take other -optional arguments. Read the source.

-

You cannot set configs individually for any single npm function at this -time. Since npm is a singleton, any call to npm.config.set will -change the value for all npm commands in that process.

-

See ./bin/npm-cli.js for an example of pulling config values off of the -command line arguments using nopt. You may also want to check out npm -help config to learn about all the options you can set there.

More Docs

Check out the docs, especially the faq.

You can use the npm help command to read any of them.

If you're a developer, and you want to use npm to publish your program, you should read this

- -

"npm" and "The npm Registry" are owned by npm, Inc. -All rights reserved. See the included LICENSE file for more details.

-

"Node.js" and "node" are trademarks owned by Joyent, Inc.

-

Modules published on the npm registry are not officially endorsed by -npm, Inc. or the Node.js project.

-

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.

-

If you have a complaint about a package in the public npm registry, -and cannot resolve it with the package -owner, please email -support@npmjs.com and explain the situation.

-

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.

-

In plainer english

-

npm is the property of npm, Inc.

-

If you publish something, it's yours, and you are solely accountable -for it.

-

If other people publish something, it's theirs.

-

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.

-

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.

BUGS

When you find issues, please report them:

    @@ -166,10 +110,10 @@

    BUGS

    will no doubt tell you to put the output in a gist or email.

    SEE ALSO

    @@ -183,5 +127,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html index 5dbec20a88b4f4..94b82c9188a680 100644 --- a/deps/npm/html/doc/api/npm-bin.html +++ b/deps/npm/html/doc/api/npm-bin.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html index e86f3841929a4d..62242b26af58f6 100644 --- a/deps/npm/html/doc/api/npm-bugs.html +++ b/deps/npm/html/doc/api/npm-bugs.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html index 5419551c0a2c2c..785a1aa043c540 100644 --- a/deps/npm/html/doc/api/npm-cache.html +++ b/deps/npm/html/doc/api/npm-cache.html @@ -18,7 +18,7 @@

    SYNOPSIS

    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 +

    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.

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

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html index bdff581012b193..9979e3df71d406 100644 --- a/deps/npm/html/doc/api/npm-commands.html +++ b/deps/npm/html/doc/api/npm-commands.html @@ -22,7 +22,7 @@

    SYNOPSIS

    usage, or man 3 npm-<command> for programmatic usage.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html index 5185aa8a64d475..b4a6763674ec18 100644 --- a/deps/npm/html/doc/api/npm-config.html +++ b/deps/npm/html/doc/api/npm-config.html @@ -43,7 +43,7 @@

    SYNOPSIS

    functions instead.

    SEE ALSO

    @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html index 965d4689958a25..54aadac5f1cce4 100644 --- a/deps/npm/html/doc/api/npm-deprecate.html +++ b/deps/npm/html/doc/api/npm-deprecate.html @@ -31,9 +31,9 @@

    SYNOPSIS

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

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html index b3d061aad497e2..1142796c3104d9 100644 --- a/deps/npm/html/doc/api/npm-docs.html +++ b/deps/npm/html/doc/api/npm-docs.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html index 7de618518791c1..679de772dfdede 100644 --- a/deps/npm/html/doc/api/npm-edit.html +++ b/deps/npm/html/doc/api/npm-edit.html @@ -36,5 +36,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html index a7645373cef744..bd655478058b9c 100644 --- a/deps/npm/html/doc/api/npm-explore.html +++ b/deps/npm/html/doc/api/npm-explore.html @@ -31,5 +31,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html index 550240f942c78e..bc0075f8f4db32 100644 --- a/deps/npm/html/doc/api/npm-help-search.html +++ b/deps/npm/html/doc/api/npm-help-search.html @@ -44,5 +44,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html index 899e8776e763d7..35ad354f0c35db 100644 --- a/deps/npm/html/doc/api/npm-init.html +++ b/deps/npm/html/doc/api/npm-init.html @@ -26,7 +26,7 @@

    SYNOPSIS

    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)

    +

    package.json(5)

    @@ -39,5 +39,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html index 1bb1043c3f1efb..eca8b80cf2a65c 100644 --- a/deps/npm/html/doc/api/npm-install.html +++ b/deps/npm/html/doc/api/npm-install.html @@ -32,5 +32,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html index 7eac566fd2d80a..dc764f89244c94 100644 --- a/deps/npm/html/doc/api/npm-link.html +++ b/deps/npm/html/doc/api/npm-link.html @@ -42,5 +42,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html index 320d1d3fd0f11f..30a2036bd7ca15 100644 --- a/deps/npm/html/doc/api/npm-load.html +++ b/deps/npm/html/doc/api/npm-load.html @@ -37,5 +37,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html index e65c1925746c3b..fd75ccac3d6403 100644 --- a/deps/npm/html/doc/api/npm-ls.html +++ b/deps/npm/html/doc/api/npm-ls.html @@ -63,5 +63,5 @@

    global

           - + diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html index 3327649c261d14..aaa194ed35deed 100644 --- a/deps/npm/html/doc/api/npm-outdated.html +++ b/deps/npm/html/doc/api/npm-outdated.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html index aeea03091dff55..5d925969733a57 100644 --- a/deps/npm/html/doc/api/npm-owner.html +++ b/deps/npm/html/doc/api/npm-owner.html @@ -32,8 +32,8 @@

    SYNOPSIS

    that is not implemented at this time.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html index 4518abfac0a244..14c367a89e4e8d 100644 --- a/deps/npm/html/doc/api/npm-pack.html +++ b/deps/npm/html/doc/api/npm-pack.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-ping.html b/deps/npm/html/doc/api/npm-ping.html index f3a4e7a775cd83..4dabc345acafde 100644 --- a/deps/npm/html/doc/api/npm-ping.html +++ b/deps/npm/html/doc/api/npm-ping.html @@ -29,4 +29,4 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html index 45f4bdb6efac6e..0921bed4b1f691 100644 --- a/deps/npm/html/doc/api/npm-prefix.html +++ b/deps/npm/html/doc/api/npm-prefix.html @@ -29,5 +29,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html index 9a240664b84a5a..6ff302c3c87645 100644 --- a/deps/npm/html/doc/api/npm-prune.html +++ b/deps/npm/html/doc/api/npm-prune.html @@ -30,5 +30,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html index 92302a1ecdb0d5..9d0b68b5759f13 100644 --- a/deps/npm/html/doc/api/npm-publish.html +++ b/deps/npm/html/doc/api/npm-publish.html @@ -30,9 +30,9 @@

    SYNOPSIS

    the registry. Overwrites when the "force" environment variable is set.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html index 65d10c50ba4055..bc3e98e646f066 100644 --- a/deps/npm/html/doc/api/npm-rebuild.html +++ b/deps/npm/html/doc/api/npm-rebuild.html @@ -30,5 +30,5 @@

    CONFIGURATION

           - + diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html index 84956f12a662de..e9146d84af2c37 100644 --- a/deps/npm/html/doc/api/npm-repo.html +++ b/deps/npm/html/doc/api/npm-repo.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html index fdbcdfa57ff90d..bf019a5011d4b4 100644 --- a/deps/npm/html/doc/api/npm-restart.html +++ b/deps/npm/html/doc/api/npm-restart.html @@ -37,8 +37,8 @@

    NOTE

    behavior will be accompanied by an increase in major version number

    SEE ALSO

    @@ -52,5 +52,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html index 7c6223fa707733..c835d4e6b6af9e 100644 --- a/deps/npm/html/doc/api/npm-root.html +++ b/deps/npm/html/doc/api/npm-root.html @@ -29,5 +29,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html index fdd705d444b086..f694dcc645d21d 100644 --- a/deps/npm/html/doc/api/npm-run-script.html +++ b/deps/npm/html/doc/api/npm-run-script.html @@ -23,11 +23,11 @@

    SYNOPSIS

    assumed to be the command to run. All other elements are ignored.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html index 55b50b974b447f..3292d838a4c458 100644 --- a/deps/npm/html/doc/api/npm-search.html +++ b/deps/npm/html/doc/api/npm-search.html @@ -53,5 +53,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html index eb115481c77b25..75d51dd630943a 100644 --- a/deps/npm/html/doc/api/npm-shrinkwrap.html +++ b/deps/npm/html/doc/api/npm-shrinkwrap.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html index e885248d20207f..715a7bba82f85c 100644 --- a/deps/npm/html/doc/api/npm-start.html +++ b/deps/npm/html/doc/api/npm-start.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html index 222c23b88758de..eca26362b4d90a 100644 --- a/deps/npm/html/doc/api/npm-stop.html +++ b/deps/npm/html/doc/api/npm-stop.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html index 6d2e6571c1b6be..ddb92596c9170f 100644 --- a/deps/npm/html/doc/api/npm-tag.html +++ b/deps/npm/html/doc/api/npm-tag.html @@ -36,5 +36,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html index a41cf64cb38de2..830585438a452b 100644 --- a/deps/npm/html/doc/api/npm-test.html +++ b/deps/npm/html/doc/api/npm-test.html @@ -30,5 +30,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html index 193ba1211d2c5b..7458d7e735c8a4 100644 --- a/deps/npm/html/doc/api/npm-uninstall.html +++ b/deps/npm/html/doc/api/npm-uninstall.html @@ -30,5 +30,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html index 5ee64a910f6e2a..3f7f76c883c491 100644 --- a/deps/npm/html/doc/api/npm-unpublish.html +++ b/deps/npm/html/doc/api/npm-unpublish.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html index 6e964f04456c0f..87455a9ae0aadd 100644 --- a/deps/npm/html/doc/api/npm-update.html +++ b/deps/npm/html/doc/api/npm-update.html @@ -19,7 +19,7 @@

    SYNOPSIS

    parameter will be called when done or when an error occurs.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html index 12e4c941482e16..e0e8b2761def3d 100644 --- a/deps/npm/html/doc/api/npm-version.html +++ b/deps/npm/html/doc/api/npm-version.html @@ -32,5 +32,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html index 4c515ff43772b1..3dd80d9c32730d 100644 --- a/deps/npm/html/doc/api/npm-view.html +++ b/deps/npm/html/doc/api/npm-view.html @@ -52,7 +52,7 @@

    SYNOPSIS

    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)
    +
    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 @@ -81,5 +81,5 @@

    RETURN VALUE

           - + diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html index 5d347fbe7cdc06..55233284d1a39c 100644 --- a/deps/npm/html/doc/api/npm-whoami.html +++ b/deps/npm/html/doc/api/npm-whoami.html @@ -29,5 +29,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html index 1d17da12f437da..df4ce202bb43cc 100644 --- a/deps/npm/html/doc/api/npm.html +++ b/deps/npm/html/doc/api/npm.html @@ -23,19 +23,19 @@

    SYNOPSIS

    npm.commands.install(["package"], cb) })

    VERSION

    -

    2.13.3

    +

    2.14.20

    DESCRIPTION

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

    +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.

    +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 +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 @@ -109,5 +109,5 @@

    ABBREVS

           - + diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index 7588c3113624fb..20f2717c42118d 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -14,10 +14,11 @@

    SYNOPSIS

    npm access public [<package>]
     npm access restricted [<package>]
     
    -npm access add <read-only|read-write> <entity> [<package>]
    -npm access rm <entity> [<package>]
    +npm access grant <read-only|read-write> <scope:team> [<package>]
    +npm access revoke <scope:team> [<package>]
     
    -npm access ls [<package>]
    +npm access ls-packages [<user>|<scope>|<scope:team>]
    +npm access ls-collaborators [<package> [<user>]]
     npm access edit [<package>]
     

    DESCRIPTION

    Used to set access controls on private packages.

    @@ -28,13 +29,19 @@

    SYNOPSIS

  • public / restricted: Set a package to be either publicly accessible or restricted.

  • -
  • add / rm: +

  • grant / revoke: Add or remove the ability of users and teams to have read-only or read-write access to a package.

  • -
  • ls: +

  • ls-packages:

    +

    Show all of the packages a user or a team is able to access, along with the +access level, except for read-only public packages (it won't print the whole +registry listing)

    +
  • +
  • ls-collaborators: Show all of the access privileges for a package. Will only show permissions -for packages to which you have at least read access.

    +for packages to which you have at least read access. If <user> is passed in, +the list is filtered only to teams that user happens to belong to.

  • edit: Set the access privileges for a package at once using $EDITOR.

    @@ -57,11 +64,13 @@

    DETAILS

    If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use --access=public.

    +

    Management of teams and team memberships is done with the npm team command.

    SEE ALSO

    @@ -75,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 1fd0b1ccac9342..2152a6a8cec187 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -15,7 +15,7 @@

    SYNOPSIS

    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, -the default registry will be used (see npm-config(7)).

    +the default registry will be used (see npm-config(7)).

    The username, password, and email are read in from prompts.

    To reset your password, go to https://www.npmjs.com/forgot

    To change your email address, go to https://www.npmjs.com/email-edit

    @@ -26,13 +26,13 @@

    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).

    +this registry will only be used for packages with that scope. See npm-scope(7).

    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, +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 @@ -44,17 +44,17 @@

    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 +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.

    SEE ALSO

    @@ -68,5 +68,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 345188c7f963bf..38226fffabc72b 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -16,12 +16,12 @@

    SYNOPSIS

    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 db8b253800c8ae..99e5c63153d88b 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -33,14 +33,14 @@

    registry

    The base URL of the npm package registry.

    SEE ALSO

    @@ -54,5 +54,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index 03169c7377d8d3..9ed02b341891d1 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -23,10 +23,10 @@

    DESCRIPTION

    npm run-script build
     

    SEE ALSO

    @@ -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 4cbf952f3d60de..7cd12975f82d40 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -17,7 +17,7 @@

    DESCRIPTION

    Just use npm install now to do what npm bundle used to do.

    SEE ALSO

    @@ -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 1bfe9a7f2cf6db..578d3d7afe60a9 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -61,13 +61,13 @@

    cache

    The root cache folder.

    SEE ALSO

    @@ -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 458e2f8dddafba..8ecbe512f17d50 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -26,9 +26,9 @@

    SYNOPSIS

    completions based on the arguments.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index 1a887e2d0c1d21..bce6e121e5f1f7 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -22,8 +22,8 @@

    SYNOPSIS

    DESCRIPTION

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

    -

    See npmrc(5) for more information about the npmrc files.

    -

    See npm-config(7) for a more thorough discussion of the mechanisms +

    See npmrc(5) for more information about the npmrc files.

    +

    See npm-config(7) for a more thorough discussion of the mechanisms involved.

    The npm config command can be used to update and edit the contents of the user and global npmrc files.

    @@ -48,11 +48,11 @@

    edit

    global config.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index 7d1653ed93610e..756959fa7fa141 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -23,7 +23,7 @@

    SYNOPSIS

    | `-- c@1.0.3 `-- d <-- depends on c@~1.0.9 `-- c@1.0.10 -

    In this case, npm-dedupe(1) will transform the tree to:

    +

    In this case, npm-dedupe(1) will transform the tree to:

    a
     +-- b
     +-- d
    @@ -47,9 +47,9 @@ 

    SYNOPSIS

    versions.

    SEE ALSO

    @@ -63,5 +63,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index cd2bc564815fd3..b68571a64eb1dc 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -23,8 +23,8 @@

    SYNOPSIS

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

    SEE ALSO

    @@ -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 c910e081a9a9f5..71354a368c0a0a 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -35,14 +35,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.

    @@ -55,15 +64,14 @@

    CAVEATS

    begin with a number or the letter v.

    SEE ALSO

    @@ -77,5 +85,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index 95fdcd7ad9d039..6e09bf2d9813c4 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -36,13 +36,13 @@

    registry

    The base URL of the npm package registry.

    SEE ALSO

    @@ -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 60622185dae763..cd8c8b68fc8462 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -14,7 +14,7 @@

    SYNOPSIS

    npm edit <name>[@<version>]
     

    DESCRIPTION

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

    +configured as the npm editor config -- see npm-config(7).)

    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 @@ -30,12 +30,12 @@

    editor

    The command to run for npm edit or npm config edit.

    SEE ALSO

    @@ -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 08848c044a31a3..d4f2e44b4a6760 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -31,11 +31,11 @@

    shell

    The shell to run for the npm explore command.

    SEE ALSO

    @@ -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 b50aa666bfc755..857d7e6625eff3 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -23,16 +23,16 @@

    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.

    If false, then help-search will just list out the help topics found.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index a8598ca7e9fad5..aa1a531c1a12bc 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -29,16 +29,16 @@

    viewer

    Set to "browser" to view html help content in the default web browser.

    SEE ALSO

    @@ -52,5 +52,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index 6387d82de4b69a..d99443cc5621c7 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -32,9 +32,9 @@

    scope

    SEE ALSO

    @@ -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..8bc6a2bebab114 --- /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 cb01884a43a359..6ea5f73a8d74da 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -23,14 +23,14 @@

    SYNOPSIS

    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).

    +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)
    • +
    • d) a <name>@<version> that is published on the registry (see npm-registry(7)) with (c)
    • +
    • 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)
    @@ -44,8 +44,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.

  • @@ -67,7 +68,7 @@

    SYNOPSIS

  • npm install [@<scope>/]<name> [--save|--save-dev|--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:

    @@ -88,7 +89,7 @@

    SYNOPSIS

    operator.

    <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).

    +the given scope the default registry is assumed. See npm-scope(7).

    Note: if you do not include the @-symbol on your scope name, npm will interpret this as a GitHub repository instead, see below. Scopes names must also be followed by a slash.

    @@ -124,7 +125,7 @@

    SYNOPSIS

  • 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).

    + 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 treat it as a single argument.

    Example:

    @@ -199,7 +200,7 @@

    SYNOPSIS

    local copy exists on disk.

    npm install sax --force
     

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

    +rather than locally. See npm-folders(5).

    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,7 +211,7 @@

    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.

    -

    See npm-config(7). Many of the configuration params have some +

    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:

    @@ -231,7 +232,7 @@

    ALGORITHM

    `-- 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.

    -

    See npm-folders(5) for a more detailed description of the specific +

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

    Limitations of npm's Install Algorithm

    There are some very rare and pathological edge-cases where a cycle can @@ -251,19 +252,20 @@

    Limitations of npm's Install affects a real use-case, it will be investigated.

    SEE ALSO

    @@ -277,5 +279,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index ca622a583d1672..d57c65f6f19667 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -18,12 +18,12 @@

    SYNOPSIS

    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).

    +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.

    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). +

    The package name can be optionally prefixed with a scope. See npm-scope(7). The scope must be preceded by an @-symbol and followed by a slash.

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

    @@ -46,19 +46,19 @@

    SYNOPSIS

    npm link node-redis

    That is, it first creates a global link, and then links the global installation target into your project's node_modules folder.

    -

    If your linked package is scoped (see npm-scope(7)) your link command must +

    If your linked package is scoped (see npm-scope(7)) your link command must include that scope, e.g.

    npm link @myorg/privatepackage
     

    SEE ALSO

    @@ -72,5 +72,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index d538a93080cce3..ea01bb43aab6e7 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -23,25 +23,21 @@

    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

    @@ -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 399d6a96739c3d..4aafcb8373db3c 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -22,7 +22,7 @@

    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.13.3 /path/to/npm
    +
    npm@2.14.20 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     

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

    @@ -75,15 +75,15 @@

    dev

    Display only the dependency tree for packages in devDependencies.

    SEE ALSO

    @@ -97,5 +97,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index cc4c2392fd1862..adb2d79e2522de 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -15,9 +15,56 @@

    SYNOPSIS

    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,14 +93,16 @@

      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 ab8336925c3be3..e513e85f33f00d 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -32,10 +32,10 @@

      SYNOPSIS

      that is not implemented at this time.

      SEE ALSO

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

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index 2df3394ff31cd9..61d7df6189398a 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -23,11 +23,11 @@

      SYNOPSIS

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

      SEE ALSO

      @@ -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 c4865c01e8a201..72888e9cc31e0f 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -16,9 +16,9 @@

      SYNOPSIS

      Ping the configured or given npm registry and verify authentication.

      SEE ALSO

      @@ -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 c999e7d928b60b..7139defece1220 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -16,15 +16,15 @@

      SYNOPSIS

      Print the local prefix to standard out. This is the closest parent directory to contain a package.json file unless -g is also specified.

      If -g is specified, this will be the value of the global prefix. See -npm-config(7) for more detail.

      +npm-config(7) for more detail.

      SEE ALSO

      @@ -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 9a130e583eb10b..c1843ab2d9574a 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -25,9 +25,9 @@

      SYNOPSIS

      negate NODE_ENV being set to production.

      SEE ALSO

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

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index 61d10cc4f8f711..61b3076d84ace2 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -14,12 +14,14 @@

      SYNOPSIS

      npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
       npm publish <folder> [--tag <tag>] [--access <public|restricted>]
       

      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 is present. 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)).

      +specifying a different default registry or using a npm-scope(7) in the name +(see package.json(5)).

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

        @@ -31,7 +33,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 @@ -44,15 +47,15 @@

        SYNOPSIS

        the specified registry.

        Once a package is published with a given name and version, that specific name and version combination can never be used again, even if -it is removed with npm-unpublish(1).

        +it is removed with npm-unpublish(1).

        SEE ALSO

        @@ -66,5 +69,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index af56a92f2d1ae6..ca28dc0db333f3 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -23,8 +23,8 @@

        DESCRIPTION

        the new binary.

        SEE ALSO

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

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index 39dc1a0af51413..79b35adcfc5754 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -27,8 +27,8 @@

        browser

        The browser that is called by the npm repo command to open websites.

        SEE ALSO

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

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 0ff0f93c2ce495..0fc1103cd4e47f 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -34,12 +34,12 @@

        NOTE

        behavior will be accompanied by an increase in major version number

        SEE ALSO

        @@ -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 index 23bd040c8ea4ec..268fba49b623b9 100644 --- a/deps/npm/html/doc/cli/npm-rm.html +++ b/deps/npm/html/doc/cli/npm-rm.html @@ -20,12 +20,12 @@

        SYNOPSIS

        on its behalf.

        SEE ALSO

        @@ -39,5 +39,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index 34fb1cdb4edc69..67e26743c65254 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -16,12 +16,12 @@

        SYNOPSIS

        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 3503be3d7b3215..bfc11f785013cb 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -39,11 +39,11 @@

        SYNOPSIS

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

        SEE ALSO

        @@ -57,5 +57,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 96ce6d93a543d6..653c605248cef2 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -31,11 +31,11 @@

        long

        fall on multiple lines.

        SEE ALSO

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

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 3a80e8f4573c71..06c944a2eeaf26 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -76,9 +76,13 @@

        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" } } } @@ -120,7 +124,7 @@

        Building shrinkwrapped packages

      • Run npm shrinkwrap, commit the new npm-shrinkwrap.json, and publish your package.
      • -

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

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

        Other Notes

        A shrinkwrap file must be consistent with the package's package.json @@ -148,9 +152,9 @@

        Caveats

        contents rather than versions.

        SEE ALSO

        @@ -164,5 +168,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index 481782e57898ad..ee50f7d7ad358e 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -20,9 +20,9 @@

        SYNOPSIS

        It's a boolean thing. Starring repeatedly has no additional effect.

        SEE ALSO

        @@ -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 51b845889d942f..8cf87457a4137c 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -20,10 +20,10 @@

        SYNOPSIS

        you will most certainly enjoy this command.

        SEE ALSO

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

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index bd6c881d02b638..433b721cef5caa 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -13,14 +13,19 @@

        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

        @@ -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 c2034c6490a7c0..b1b3ec665adb1f 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -16,11 +16,11 @@

        SYNOPSIS

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

        SEE ALSO

        @@ -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 a758ac14f44f00..e8a6594d4a85a9 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -13,7 +13,7 @@

        npm-tag

        Tag a published version

        SYNOPSIS
        npm tag <name>@<version> [<tag>]
         

        DESCRIPTION

        -

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

        +

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

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

        A tag can be used when installing packages as a reference to a version instead @@ -41,14 +41,14 @@

        CAVEATS

        that do not begin with a number or the letter v.

        SEE ALSO

        @@ -62,5 +62,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html new file mode 100644 index 00000000000000..64fbcf0b3a44ff --- /dev/null +++ b/deps/npm/html/doc/cli/npm-team.html @@ -0,0 +1,70 @@ + + + npm-team + + + + + + +
        + +

        npm-team

        Manage organization teams and team memberships

        +

        SYNOPSIS

        +
        npm team create <scope:team>
        +npm team destroy <scope:team>
        +
        +npm team add <scope:team> <user>
        +npm team rm <scope:team> <user>
        +
        +npm team ls <scope>|<scope:team>
        +
        +npm team edit <scope:team>
        +

        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 +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 +foo:developers in these commands.

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

          +
        • +
        • add / rm: +Add a user to an existing team, or remove a user from a team they belong to.

          +
        • +
        • ls: +If performed on an organization name, will return a list of existing teams +under that organization. If performed on a team, it will instead return a list +of all users belonging to that particular team.

          +
        • +
        +

        DETAILS

        +

        npm team always operates directly on the current registry, configurable from +the command line using --registry=<registry url>.

        +

        In order to create teams and manage team membership, you must be a team admin +under the given organization. Listing teams and team memberships may be done by +any member of the organizations.

        +

        Organization creation and management of team admins and organization members +is done through the website, not the npm CLI.

        +

        To use teams to manage permissions on packages belonging to your organization, +use the npm access command to grant or revoke the appropriate permissions.

        +

        SEE ALSO

        + + +
        + + + + + + + + + + + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index 380491a5409c87..42154335910b22 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -19,11 +19,11 @@

        SYNOPSIS

        true.

        SEE ALSO

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

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 6947e65fd3ff5f..f70c5546b0e604 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -9,7 +9,7 @@
        -

        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)
        @@ -30,7 +30,7 @@ 

        SYNOPSIS

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

      -

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

      +

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

      Examples:

      npm uninstall sax --save
       npm uninstall @myorg/privatepackage --save
      @@ -38,12 +38,12 @@ 

      SYNOPSIS

      npm uninstall dtrace-provider --save-optional

      SEE ALSO

      @@ -57,5 +57,5 @@

      SYNOPSIS

             - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index ecf13ea2515f84..a3770b6fd06011 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -26,14 +26,14 @@

      DESCRIPTION

      Even if a package version is unpublished, that specific name and version combination can never be reused. In order to publish the package again, a new version number must be used.

      -

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

      +

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

      SEE ALSO

      @@ -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 3285f6ece507a6..61e356377df4a3 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -24,7 +24,7 @@

      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 +To get the old behavior, use npm --depth Infinity 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.

      @@ -37,29 +37,30 @@

      SYNOPSIS

      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,14 +68,14 @@

      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)

      @@ -82,30 +83,30 @@

      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"
      +
      "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 be downgraded.

      SEE ALSO

      @@ -119,5 +120,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index fbbe2b98299474..f679effa7c9559 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -76,12 +76,12 @@

      git-tag-version

      Commit and tag the version change.

      SEE ALSO

      @@ -95,5 +95,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 8ad404d9d3c635..2fa22d98cb41c6 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -46,12 +46,15 @@

      SYNOPSIS

      npm view express contributors.name contributors.email
       

      "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 package.json(5) for more on this.)

      +the shortened string format. (See package.json(5) for more on this.)

      npm view npm contributors
       

      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 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 @@ -63,12 +66,12 @@

      SYNOPSIS

      the field name.

      SEE ALSO

      @@ -82,5 +85,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index bfb6e8c0552fb9..56dc846bd55d83 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -16,10 +16,10 @@

      SYNOPSIS

      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 5dd95b874fea76..f55051f479b24b 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.13.3

      +

      2.14.20

      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 @@ -25,7 +25,7 @@

      DESCRIPTION

      INTRODUCTION

      You probably got npm because you want to install stuff.

      Use npm install blerg to install the latest version of "blerg". Check out -npm-install(1) for more info. It can do a lot of stuff.

      +npm-install(1) for more info. It can do a lot of stuff.

      Use the npm search command to show everything that's available. Use npm ls to show everything you've installed.

      DEPENDENCIES

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

      DEPENDENCIES

      the node-gyp repository and the node-gyp Wiki.

      DIRECTORIES

      -

      See npm-folders(5) to learn about where npm puts stuff.

      +

      See npm-folders(5) to learn about where npm puts stuff.

      In particular, npm has two modes of operation:

      • global mode:
        npm installs packages into the install prefix at @@ -58,7 +58,7 @@

        DEVELOPER USAGE

        following help topics:

        • json: -Make a package.json file. See package.json(5).
        • +Make a package.json file. See package.json(5).
        • link: For linking your current working code into Node's path, so that you don't have to reinstall every time you make a change. Use @@ -93,12 +93,12 @@

          CONFIGURATION

        • Defaults:
          npm's default configuration options are defined in lib/utils/config-defs.js. These must not be changed.
        -

        See npm-config(7) for much much more information.

        +

        See npm-config(7) for much much more information.

        CONTRIBUTIONS

        Patches welcome!

        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

        @@ -59,7 +58,7 @@

        Man Pages

        When in local mode, man pages are not installed.

        Man pages are not installed on Windows systems.

        Cache

        -

        See npm-cache(1). Cache files are stored in ~/.npm on Posix, or +

        See npm-cache(1). Cache files are stored in ~/.npm on Posix, or ~/npm-cache on Windows.

        This is controlled by the cache configuration param.

        Temp Files

        @@ -159,18 +158,18 @@

        Publishing

        not be included in the package tarball.

        This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that -cannot be found elsewhere. See package.json(5) for more information.

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

        SEE ALSO

        @@ -184,5 +183,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index 7caf28c2fa6d31..cc6c4849d3377c 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -1,9 +1,9 @@ - npm-global + npm-folders - + @@ -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

      @@ -59,7 +58,7 @@

      Man Pages

      When in local mode, man pages are not installed.

      Man pages are not installed on Windows systems.

      Cache

      -

      See npm-cache(1). Cache files are stored in ~/.npm on Posix, or +

      See npm-cache(1). Cache files are stored in ~/.npm on Posix, or ~/npm-cache on Windows.

      This is controlled by the cache configuration param.

      Temp Files

      @@ -159,18 +158,18 @@

      Publishing

      not be included in the package tarball.

      This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re-publish those items that -cannot be found elsewhere. See package.json(5) for more information.

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

      SEE ALSO

      @@ -184,5 +183,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index 2fcc8a78ab771c..18be731280ead6 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -1,9 +1,9 @@ - npm-json + package.json - + @@ -14,7 +14,7 @@

      DESCRIPTION

      This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a JavaScript object literal.

      A lot of the behavior described in this document is affected by the config -settings described in npm-config(7).

      +settings described in npm-config(7).

      name

      The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without @@ -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.
      • @@ -43,7 +43,7 @@

        name

        already, before you get too attached to it. https://www.npmjs.com/

      A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See -npm-scope(7) for more detail.

      +npm-scope(7) for more detail.

      version

      The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without @@ -53,7 +53,7 @@

      version

      Version must be parseable by node-semver, which is bundled with npm as a dependency. (npm install semver to use it yourself.)

      -

      More on version numbers and ranges at semver(7).

      +

      More on version numbers and ranges at semver(7).

      description

      Put a description in it. It's a string. This helps people discover your package, as it's listed in npm search.

      @@ -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 @@ -136,16 +136,17 @@

      files

      The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. (Unless they would be ignored by another rule.)

      -

      You can also provide a ".npmignore" file in the root of your package, -which will keep files from being included, even if they would be picked -up by the files array. The ".npmignore" file works just like a -".gitignore".

      +

      You can also provide a ".npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array. The .npmignore file +works just like a .gitignore.

      Certain files are always included, regardless of settings:

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

      Conversely, some files are always ignored:

        @@ -155,10 +156,11 @@

        files

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

      main

      The main field is a module ID that is the primary entry point to your program. @@ -272,7 +274,7 @@

      repository

      The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.

      -

      See npm-scripts(7) to find out more about writing package scripts.

      +

      See npm-scripts(7) to find out more about writing package scripts.

      config

      A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. For instance, if a package had the @@ -282,7 +284,7 @@

      config

      and then had a "start" command that then referenced the npm_package_config_port environment variable, then the user could override that by doing npm config set foo:port 8001.

      -

      See npm-config(7) and npm-scripts(7) for more on package +

      See npm-config(7) and npm-scripts(7) for more on package configs.

      dependencies

      Dependencies are specified in a simple object that maps a package name to a @@ -291,15 +293,15 @@

      dependencies

      tarball or git URL.

      Please do not put test harnesses or transpilers in your dependencies object. See devDependencies, below.

      -

      See semver(7) for more details about specifying version ranges.

      +

      See semver(7) for more details about specifying version ranges.

      • version Must match version exactly
      • >version Must be greater than version
      • >=version etc
      • <version
      • <=version
      • -
      • ~version "Approximately equivalent to version" See semver(7)
      • -
      • ^version "Compatible with version" See semver(7)
      • +
      • ~version "Approximately equivalent to version" See semver(7)
      • +
      • ^version "Compatible with version" See semver(7)
      • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
      • http://... See 'URLs as Dependencies' below
      • * Matches any version
      • @@ -308,8 +310,8 @@

        dependencies

      • range1 || range2 Passes if either range1 or range2 are satisfied.
      • 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
      • +
      • tag A specific version tagged and published as tag See npm-tag(1)
      • +
      • path/path/path See Local Paths below

      For example, these are all valid:

      { "dependencies" :
      @@ -380,7 +382,7 @@ 

      devDependencies

      object.

      These things will be installed when doing npm link or npm install from the root of a package, and can be managed like any other npm -configuration param. See npm-config(7) for more on the topic.

      +configuration param. See npm-config(7) for more on the topic.

      For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the prepublish script to do this, and make the required package a devDependency.

      @@ -433,7 +435,7 @@

      peerDependencies

      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.

      -

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

      +

      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 found or fails to install, then you may put it in the optionalDependencies @@ -520,7 +522,7 @@

      publishConfig

      to the global public registry or that a scoped module is private by default.

      Any config values can be overridden, but of course only "tag", "registry" and "access" probably matter for the purposes of publishing.

      -

      See npm-config(7) to see the list of config options that can be +

      See npm-config(7) to see the list of config options that can be overridden.

      DEFAULT VALUES

      npm will default some values based on package contents.

      @@ -542,16 +544,16 @@

      DEFAULT VALUES

    SEE ALSO

    @@ -565,5 +567,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index 42e23dce05ecf3..805be3ca4c9140 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -15,7 +15,7 @@

    DESCRIPTION

    variables, and npmrc files.

    The npm config command can be used to update and edit the contents of the user and global npmrc files.

    -

    For a list of available configuration options, see npm-config(7).

    +

    For a list of available configuration options, see npm-config(7).

    FILES

    The four relevant files are:

      @@ -65,11 +65,11 @@

      Built-in config file

      manner.

      SEE ALSO

      @@ -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 6b6d7b10cf4ac1..18be731280ead6 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -14,7 +14,7 @@

      DESCRIPTION

      This document is all you need to know about what's required in your package.json file. It must be actual JSON, not just a JavaScript object literal.

      A lot of the behavior described in this document is affected by the config -settings described in npm-config(7).

      +settings described in npm-config(7).

      name

      The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without @@ -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.
      • @@ -43,7 +43,7 @@

        name

        already, before you get too attached to it. https://www.npmjs.com/

      A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See -npm-scope(7) for more detail.

      +npm-scope(7) for more detail.

      version

      The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without @@ -53,7 +53,7 @@

      version

      Version must be parseable by node-semver, which is bundled with npm as a dependency. (npm install semver to use it yourself.)

      -

      More on version numbers and ranges at semver(7).

      +

      More on version numbers and ranges at semver(7).

      description

      Put a description in it. It's a string. This helps people discover your package, as it's listed in npm search.

      @@ -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 @@ -136,16 +136,17 @@

      files

      The "files" field is an array of files to include in your project. If you name a folder in the array, then it will also include the files inside that folder. (Unless they would be ignored by another rule.)

      -

      You can also provide a ".npmignore" file in the root of your package, -which will keep files from being included, even if they would be picked -up by the files array. The ".npmignore" file works just like a -".gitignore".

      +

      You can also provide a ".npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array. The .npmignore file +works just like a .gitignore.

      Certain files are always included, regardless of settings:

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

      Conversely, some files are always ignored:

        @@ -155,10 +156,11 @@

        files

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

      main

      The main field is a module ID that is the primary entry point to your program. @@ -272,7 +274,7 @@

      repository

      The "scripts" property is a dictionary containing script commands that are run at various times in the lifecycle of your package. The key is the lifecycle event, and the value is the command to run at that point.

      -

      See npm-scripts(7) to find out more about writing package scripts.

      +

      See npm-scripts(7) to find out more about writing package scripts.

      config

      A "config" object can be used to set configuration parameters used in package scripts that persist across upgrades. For instance, if a package had the @@ -282,7 +284,7 @@

      config

      and then had a "start" command that then referenced the npm_package_config_port environment variable, then the user could override that by doing npm config set foo:port 8001.

      -

      See npm-config(7) and npm-scripts(7) for more on package +

      See npm-config(7) and npm-scripts(7) for more on package configs.

      dependencies

      Dependencies are specified in a simple object that maps a package name to a @@ -291,15 +293,15 @@

      dependencies

      tarball or git URL.

      Please do not put test harnesses or transpilers in your dependencies object. See devDependencies, below.

      -

      See semver(7) for more details about specifying version ranges.

      +

      See semver(7) for more details about specifying version ranges.

      • version Must match version exactly
      • >version Must be greater than version
      • >=version etc
      • <version
      • <=version
      • -
      • ~version "Approximately equivalent to version" See semver(7)
      • -
      • ^version "Compatible with version" See semver(7)
      • +
      • ~version "Approximately equivalent to version" See semver(7)
      • +
      • ^version "Compatible with version" See semver(7)
      • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
      • http://... See 'URLs as Dependencies' below
      • * Matches any version
      • @@ -308,8 +310,8 @@

        dependencies

      • range1 || range2 Passes if either range1 or range2 are satisfied.
      • 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
      • +
      • tag A specific version tagged and published as tag See npm-tag(1)
      • +
      • path/path/path See Local Paths below

      For example, these are all valid:

      { "dependencies" :
      @@ -380,7 +382,7 @@ 

      devDependencies

      object.

      These things will be installed when doing npm link or npm install from the root of a package, and can be managed like any other npm -configuration param. See npm-config(7) for more on the topic.

      +configuration param. See npm-config(7) for more on the topic.

      For build steps that are not platform-specific, such as compiling CoffeeScript or other languages to JavaScript, use the prepublish script to do this, and make the required package a devDependency.

      @@ -433,7 +435,7 @@

      peerDependencies

      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.

      -

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

      +

      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 found or fails to install, then you may put it in the optionalDependencies @@ -520,7 +522,7 @@

      publishConfig

      to the global public registry or that a scoped module is private by default.

      Any config values can be overridden, but of course only "tag", "registry" and "access" probably matter for the purposes of publishing.

      -

      See npm-config(7) to see the list of config options that can be +

      See npm-config(7) to see the list of config options that can be overridden.

      DEFAULT VALUES

      npm will default some values based on package contents.

      @@ -542,16 +544,16 @@

      DEFAULT VALUES

    SEE ALSO

    @@ -565,5 +567,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index aec8a7773fb051..72caf441a7d004 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -1,6 +1,6 @@ - index + npm-index @@ -10,223 +10,225 @@

    npm-index

    Index of all npm documentation

    -

    README

    +

    README

    a JavaScript package manager

    Command Line Documentation

    Using npm on the command line

    -

    npm(1)

    +

    npm(1)

    javascript package manager

    -

    npm-access(1)

    +

    npm-access(1)

    Set access level on published packages

    -

    npm-adduser(1)

    +

    npm-adduser(1)

    Add a registry user account

    -

    npm-bin(1)

    +

    npm-bin(1)

    Display npm bin folder

    -

    npm-bugs(1)

    +

    npm-bugs(1)

    Bugs for a package in a web browser maybe

    -

    npm-build(1)

    +

    npm-build(1)

    Build a package

    -

    npm-bundle(1)

    +

    npm-bundle(1)

    REMOVED

    -

    npm-cache(1)

    +

    npm-cache(1)

    Manipulates packages cache

    -

    npm-completion(1)

    +

    npm-completion(1)

    Tab Completion for npm

    -

    npm-config(1)

    +

    npm-config(1)

    Manage the npm configuration files

    -

    npm-dedupe(1)

    +

    npm-dedupe(1)

    Reduce duplication

    -

    npm-deprecate(1)

    +

    npm-deprecate(1)

    Deprecate a version of a package

    -

    npm-dist-tag(1)

    +

    npm-dist-tag(1)

    Modify package distribution tags

    -

    npm-docs(1)

    +

    npm-docs(1)

    Docs for a package in a web browser maybe

    -

    npm-edit(1)

    +

    npm-edit(1)

    Edit an installed package

    -

    npm-explore(1)

    +

    npm-explore(1)

    Browse an installed package

    -

    npm-help-search(1)

    +

    npm-help-search(1)

    Search npm help documentation

    -

    npm-help(1)

    +

    npm-help(1)

    Get help on npm

    -

    npm-init(1)

    +

    npm-init(1)

    Interactively create a package.json file

    -

    npm-install(1)

    +

    npm-install(1)

    Install a package

    - +

    Symlink a package folder

    -

    npm-logout(1)

    +

    npm-logout(1)

    Log out of the registry

    -

    npm-ls(1)

    +

    npm-ls(1)

    List installed packages

    -

    npm-outdated(1)

    +

    npm-outdated(1)

    Check for outdated packages

    -

    npm-owner(1)

    +

    npm-owner(1)

    Manage package owners

    -

    npm-pack(1)

    +

    npm-pack(1)

    Create a tarball from a package

    -

    npm-ping(1)

    +

    npm-ping(1)

    Ping npm registry

    -

    npm-prefix(1)

    +

    npm-prefix(1)

    Display prefix

    -

    npm-prune(1)

    +

    npm-prune(1)

    Remove extraneous packages

    -

    npm-publish(1)

    +

    npm-publish(1)

    Publish a package

    -

    npm-rebuild(1)

    +

    npm-rebuild(1)

    Rebuild a package

    -

    npm-repo(1)

    +

    npm-repo(1)

    Open package repository page in the browser

    -

    npm-restart(1)

    +

    npm-restart(1)

    Restart a package

    -

    npm-rm(1)

    +

    npm-rm(1)

    Remove a package

    -

    npm-root(1)

    +

    npm-root(1)

    Display npm root

    -

    npm-run-script(1)

    +

    npm-run-script(1)

    Run arbitrary package scripts

    -

    npm-search(1)

    +

    npm-search(1)

    Search for packages

    -

    npm-shrinkwrap(1)

    +

    npm-shrinkwrap(1)

    Lock down dependency versions

    -

    npm-star(1)

    +

    npm-star(1)

    Mark your favorite packages

    -

    npm-stars(1)

    +

    npm-stars(1)

    View packages marked as favorites

    -

    npm-start(1)

    +

    npm-start(1)

    Start a package

    -

    npm-stop(1)

    +

    npm-stop(1)

    Stop a package

    -

    npm-tag(1)

    +

    npm-tag(1)

    Tag a published version

    -

    npm-test(1)

    +

    npm-team(1)

    +

    Manage organization teams and team memberships

    +

    npm-test(1)

    Test a package

    -

    npm-uninstall(1)

    +

    npm-uninstall(1)

    Remove a package

    -

    npm-unpublish(1)

    +

    npm-unpublish(1)

    Remove a package from the registry

    -

    npm-update(1)

    +

    npm-update(1)

    Update a package

    -

    npm-version(1)

    +

    npm-version(1)

    Bump a package version

    -

    npm-view(1)

    +

    npm-view(1)

    View registry info

    -

    npm-whoami(1)

    +

    npm-whoami(1)

    Display npm username

    API Documentation

    Using npm in your Node programs

    -

    npm(3)

    +

    npm(3)

    javascript package manager

    -

    npm-bin(3)

    +

    npm-bin(3)

    Display npm bin folder

    -

    npm-bugs(3)

    +

    npm-bugs(3)

    Bugs for a package in a web browser maybe

    -

    npm-cache(3)

    +

    npm-cache(3)

    manage the npm cache programmatically

    -

    npm-commands(3)

    +

    npm-commands(3)

    npm commands

    -

    npm-config(3)

    +

    npm-config(3)

    Manage the npm configuration files

    -

    npm-deprecate(3)

    +

    npm-deprecate(3)

    Deprecate a version of a package

    -

    npm-docs(3)

    +

    npm-docs(3)

    Docs for a package in a web browser maybe

    -

    npm-edit(3)

    +

    npm-edit(3)

    Edit an installed package

    -

    npm-explore(3)

    +

    npm-explore(3)

    Browse an installed package

    -

    npm-help-search(3)

    +

    npm-help-search(3)

    Search the help pages

    -

    npm-init(3)

    +

    npm-init(3)

    Interactively create a package.json file

    -

    npm-install(3)

    +

    npm-install(3)

    install a package programmatically

    - +

    Symlink a package folder

    -

    npm-load(3)

    +

    npm-load(3)

    Load config settings

    -

    npm-ls(3)

    +

    npm-ls(3)

    List installed packages

    -

    npm-outdated(3)

    +

    npm-outdated(3)

    Check for outdated packages

    -

    npm-owner(3)

    +

    npm-owner(3)

    Manage package owners

    -

    npm-pack(3)

    +

    npm-pack(3)

    Create a tarball from a package

    -

    npm-ping(3)

    +

    npm-ping(3)

    Ping npm registry

    -

    npm-prefix(3)

    +

    npm-prefix(3)

    Display prefix

    -

    npm-prune(3)

    +

    npm-prune(3)

    Remove extraneous packages

    -

    npm-publish(3)

    +

    npm-publish(3)

    Publish a package

    -

    npm-rebuild(3)

    +

    npm-rebuild(3)

    Rebuild a package

    -

    npm-repo(3)

    +

    npm-repo(3)

    Open package repository page in the browser

    -

    npm-restart(3)

    +

    npm-restart(3)

    Restart a package

    -

    npm-root(3)

    +

    npm-root(3)

    Display npm root

    -

    npm-run-script(3)

    +

    npm-run-script(3)

    Run arbitrary package scripts

    -

    npm-search(3)

    +

    npm-search(3)

    Search for packages

    -

    npm-shrinkwrap(3)

    +

    npm-shrinkwrap(3)

    programmatically generate package shrinkwrap file

    -

    npm-start(3)

    +

    npm-start(3)

    Start a package

    -

    npm-stop(3)

    +

    npm-stop(3)

    Stop a package

    -

    npm-tag(3)

    +

    npm-tag(3)

    Tag a published version

    -

    npm-test(3)

    +

    npm-test(3)

    Test a package

    -

    npm-uninstall(3)

    +

    npm-uninstall(3)

    uninstall a package programmatically

    -

    npm-unpublish(3)

    +

    npm-unpublish(3)

    Remove a package from the registry

    -

    npm-update(3)

    +

    npm-update(3)

    Update a package

    -

    npm-version(3)

    +

    npm-version(3)

    Bump a package version

    -

    npm-view(3)

    +

    npm-view(3)

    View registry info

    -

    npm-whoami(3)

    +

    npm-whoami(3)

    Display npm username

    Files

    File system structures npm uses

    -

    npm-folders(5)

    +

    npm-folders(5)

    Folder Structures Used by npm

    -

    npmrc(5)

    +

    npmrc(5)

    The npm config files

    -

    package.json(5)

    +

    package.json(5)

    Specifics of npm's package.json handling

    Misc

    Various other bits and bobs

    -

    npm-coding-style(7)

    +

    npm-coding-style(7)

    npm's "funny" coding style

    -

    npm-config(7)

    +

    npm-config(7)

    More than you probably want to know about npm configuration

    -

    npm-developers(7)

    +

    npm-developers(7)

    Developer Guide

    -

    npm-disputes(7)

    +

    npm-disputes(7)

    Handling Module Name Disputes

    -

    npm-faq(7)

    -

    Frequently Asked Questions

    -

    npm-index(7)

    +

    npm-index(7)

    Index of all npm documentation

    -

    npm-registry(7)

    +

    npm-orgs(7)

    +

    Working with Teams & Orgs

    +

    npm-registry(7)

    The JavaScript Package Registry

    -

    npm-scope(7)

    +

    npm-scope(7)

    Scoped packages

    -

    npm-scripts(7)

    +

    npm-scripts(7)

    How npm handles the "scripts" field

    -

    removing-npm(7)

    +

    removing-npm(7)

    Cleaning the Slate

    -

    semver(7)

    +

    semver(7)

    The semantic versioner for npm

    @@ -240,5 +242,5 @@

    semver(        - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index e1fc4ba824769e..d2768eed7ef2c3 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -109,7 +109,7 @@

    Logging

    logging the same object over and over again is not helpful. Logs should report what's happening so that it's easier to track down where a fault occurs.

    -

    Use appropriate log levels. See npm-config(7) and search for +

    Use appropriate log levels. See npm-config(7) and search for "loglevel".

    Case, naming, etc.

    Use lowerCamelCase for multiword identifiers when they refer to objects, @@ -131,9 +131,9 @@

    null, undefined, false, 0

    Boolean objects are verboten.

    SEE ALSO

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

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index abd1fcec9f7858..417a8db9bfd642 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -33,7 +33,7 @@

    npmrc Files

  • global config file ($PREFIX/npmrc)
  • npm builtin config file (/path/to/npm/npmrc)
-

See npmrc(5) for more details.

+

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.

@@ -78,7 +78,7 @@

Shorthands and Other CLI Niceties

Per-Package Config Settings

-

When running scripts (see npm-scripts(7)) the package.json "config" +

When running scripts (see npm-scripts(7)) the package.json "config" keys are overwritten in the environment if there is a config param of <name>[@<version>]:<key>. For example, if the package.json has this:

@@ -89,7 +89,7 @@

Shorthands and Other CLI Niceties

http.createServer(...).listen(process.env.npm_package_config_port)

then the user could change the behavior by doing:

npm config set foo:port 80
-

See package.json(5) for more information.

+

See package.json(5) for more information.

Config Settings

access

    @@ -151,7 +151,7 @@

    cache

  • Default: Windows: %AppData%\npm-cache, Posix: ~/.npm
  • Type: path
-

The location of npm's cache directory. See npm-cache(1)

+

The location of npm's cache directory. See npm-cache(1)

cache-lock-stale

  • Default: 60000 (1 minute)
  • @@ -196,7 +196,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. @@ -302,7 +302,7 @@

    global

Operates in "global" mode, so that packages are installed into the prefix folder instead of the current working directory. See -npm-folders(5) for more on the differences in behavior.

+npm-folders(5) for more on the differences in behavior.

  • packages are installed into the {prefix}/lib/node_modules folder, instead of the current working directory.
  • @@ -360,7 +360,7 @@

    init-module

    A module that will be loaded by the npm init command. See the documentation for the init-package-json module -for more information, or npm-init(1).

    +for more information, or npm-init(1).

    init-author-name

    • Default: ""
    • @@ -500,7 +500,7 @@

      parseable

      standard output.

      prefix

      The location to install global items. If set on the command line, then @@ -728,7 +728,7 @@

      usage

    • Type: Boolean

    Set to show short usage output (like the -H output) -instead of complete help when doing npm-help(1).

    +instead of complete help when doing npm-help(1).

    user

    • Default: "nobody"
    • @@ -781,11 +781,11 @@

      viewer

      Set to "browser" to view html help content in the default web browser.

      SEE ALSO

      @@ -799,5 +799,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 9afdcd91d4da89..01906ac153a8ba 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -45,7 +45,7 @@

      What is a package

      The package.json File

      You need to have a package.json file in the root of your project to do much of anything with npm. That is basically the whole interface.

      -

      See package.json(5) for details about what goes in that file. At the very +

      See package.json(5) for details about what goes in that file. At the very least, you need:

      • name: @@ -72,7 +72,7 @@

        The package.json File

        If you have a special compilation or installation script, then you should put it in the scripts object. You should definitely have at least a basic smoke-test command as the "scripts.test" field. -See npm-scripts(7).

        +See npm-scripts(7).

      • main: If you have a single module that serves as the entry point to your @@ -86,15 +86,17 @@

        The package.json File

      You can use npm init in the root of your package in order to get you -started with a pretty basic package.json file. See npm-init(1) for +started with a pretty basic package.json file. See npm-init(1) for more info.

      Keeping files out of your package

      Use a .npmignore file to keep stuff out of your package. If there's no .npmignore file, but there is a .gitignore file, then npm will ignore the stuff matched by the .gitignore file. If you want to include something that is excluded by your .gitignore file, you can -create an empty .npmignore file to override it.

      -

      .npmignore files follow the same pattern rules +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 as .gitignore files:

      • Blank lines or lines starting with # are ignored.
      • @@ -110,9 +112,11 @@

        Keeping files out of your pa
      • .DS_Store
      • .git
      • .hg
      • +
      • .npmrc
      • .lock-wscript
      • .svn
      • .wafpickle-*
      • +
      • config.gypi
      • CVS
      • npm-debug.log
      @@ -123,14 +127,16 @@

      Keeping files out of your pa .npmignore is pointless:

      • package.json
      • -
      • README.*
      • +
      • README (and its variants)
      • +
      • CHANGELOG (and its variants)
      • +
      • LICENSE / LICENCE

      npm link is designed to install a development package and see the changes in real time without having to keep re-installing it. (You do need to either re-link or npm rebuild -g to update compiled packages, of course.)

      -

      More info at npm-link(1).

      +

      More info at npm-link(1).

      Before Publishing: Make Sure Your Package Installs and Works

      This is important.

      If you can not install it locally, you'll have @@ -153,9 +159,9 @@

      Create a User Account

      Create a user with the adduser command. It works like this:

      npm adduser
       

      and then follow the prompts.

      -

      This is documented better in npm-adduser(1).

      +

      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.

      @@ -168,14 +174,14 @@

      Brag about it

      Tell the world how easy it is to install your program!

      SEE ALSO

      @@ -189,5 +195,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index 1b343d99e120fd..7a8aca3414ecbf 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.)
    • @@ -97,8 +97,8 @@

      EXCEPTIONS

      If you see bad behavior like this, please report it right away.

      SEE ALSO

      @@ -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 ca3d1e1ea00d85..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 6695bab5f37333..3f491423912d99 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -10,223 +10,225 @@

      npm-index

      Index of all npm documentation

      -

      README

      +

      README

      a JavaScript package manager

      Command Line Documentation

      Using npm on the command line

      -

      npm(1)

      +

      npm(1)

      javascript package manager

      -

      npm-access(1)

      +

      npm-access(1)

      Set access level on published packages

      -

      npm-adduser(1)

      +

      npm-adduser(1)

      Add a registry user account

      -

      npm-bin(1)

      +

      npm-bin(1)

      Display npm bin folder

      -

      npm-bugs(1)

      +

      npm-bugs(1)

      Bugs for a package in a web browser maybe

      -

      npm-build(1)

      +

      npm-build(1)

      Build a package

      -

      npm-bundle(1)

      +

      npm-bundle(1)

      REMOVED

      -

      npm-cache(1)

      +

      npm-cache(1)

      Manipulates packages cache

      -

      npm-completion(1)

      +

      npm-completion(1)

      Tab Completion for npm

      -

      npm-config(1)

      +

      npm-config(1)

      Manage the npm configuration files

      -

      npm-dedupe(1)

      +

      npm-dedupe(1)

      Reduce duplication

      -

      npm-deprecate(1)

      +

      npm-deprecate(1)

      Deprecate a version of a package

      -

      npm-dist-tag(1)

      +

      npm-dist-tag(1)

      Modify package distribution tags

      -

      npm-docs(1)

      +

      npm-docs(1)

      Docs for a package in a web browser maybe

      -

      npm-edit(1)

      +

      npm-edit(1)

      Edit an installed package

      -

      npm-explore(1)

      +

      npm-explore(1)

      Browse an installed package

      -

      npm-help-search(1)

      +

      npm-help-search(1)

      Search npm help documentation

      -

      npm-help(1)

      +

      npm-help(1)

      Get help on npm

      -

      npm-init(1)

      +

      npm-init(1)

      Interactively create a package.json file

      -

      npm-install(1)

      +

      npm-install(1)

      Install a package

      - +

      Symlink a package folder

      -

      npm-logout(1)

      +

      npm-logout(1)

      Log out of the registry

      -

      npm-ls(1)

      +

      npm-ls(1)

      List installed packages

      -

      npm-outdated(1)

      +

      npm-outdated(1)

      Check for outdated packages

      -

      npm-owner(1)

      +

      npm-owner(1)

      Manage package owners

      -

      npm-pack(1)

      +

      npm-pack(1)

      Create a tarball from a package

      -

      npm-ping(1)

      +

      npm-ping(1)

      Ping npm registry

      -

      npm-prefix(1)

      +

      npm-prefix(1)

      Display prefix

      -

      npm-prune(1)

      +

      npm-prune(1)

      Remove extraneous packages

      -

      npm-publish(1)

      +

      npm-publish(1)

      Publish a package

      -

      npm-rebuild(1)

      +

      npm-rebuild(1)

      Rebuild a package

      -

      npm-repo(1)

      +

      npm-repo(1)

      Open package repository page in the browser

      -

      npm-restart(1)

      +

      npm-restart(1)

      Restart a package

      -

      npm-rm(1)

      +

      npm-rm(1)

      Remove a package

      -

      npm-root(1)

      +

      npm-root(1)

      Display npm root

      -

      npm-run-script(1)

      +

      npm-run-script(1)

      Run arbitrary package scripts

      -

      npm-search(1)

      +

      npm-search(1)

      Search for packages

      -

      npm-shrinkwrap(1)

      +

      npm-shrinkwrap(1)

      Lock down dependency versions

      -

      npm-star(1)

      +

      npm-star(1)

      Mark your favorite packages

      -

      npm-stars(1)

      +

      npm-stars(1)

      View packages marked as favorites

      -

      npm-start(1)

      +

      npm-start(1)

      Start a package

      -

      npm-stop(1)

      +

      npm-stop(1)

      Stop a package

      -

      npm-tag(1)

      +

      npm-tag(1)

      Tag a published version

      -

      npm-test(1)

      +

      npm-team(1)

      +

      Manage organization teams and team memberships

      +

      npm-test(1)

      Test a package

      -

      npm-uninstall(1)

      +

      npm-uninstall(1)

      Remove a package

      -

      npm-unpublish(1)

      +

      npm-unpublish(1)

      Remove a package from the registry

      -

      npm-update(1)

      +

      npm-update(1)

      Update a package

      -

      npm-version(1)

      +

      npm-version(1)

      Bump a package version

      -

      npm-view(1)

      +

      npm-view(1)

      View registry info

      -

      npm-whoami(1)

      +

      npm-whoami(1)

      Display npm username

      API Documentation

      Using npm in your Node programs

      -

      npm(3)

      +

      npm(3)

      javascript package manager

      -

      npm-bin(3)

      +

      npm-bin(3)

      Display npm bin folder

      -

      npm-bugs(3)

      +

      npm-bugs(3)

      Bugs for a package in a web browser maybe

      -

      npm-cache(3)

      +

      npm-cache(3)

      manage the npm cache programmatically

      -

      npm-commands(3)

      +

      npm-commands(3)

      npm commands

      -

      npm-config(3)

      +

      npm-config(3)

      Manage the npm configuration files

      -

      npm-deprecate(3)

      +

      npm-deprecate(3)

      Deprecate a version of a package

      -

      npm-docs(3)

      +

      npm-docs(3)

      Docs for a package in a web browser maybe

      -

      npm-edit(3)

      +

      npm-edit(3)

      Edit an installed package

      -

      npm-explore(3)

      +

      npm-explore(3)

      Browse an installed package

      -

      npm-help-search(3)

      +

      npm-help-search(3)

      Search the help pages

      -

      npm-init(3)

      +

      npm-init(3)

      Interactively create a package.json file

      -

      npm-install(3)

      +

      npm-install(3)

      install a package programmatically

      - +

      Symlink a package folder

      -

      npm-load(3)

      +

      npm-load(3)

      Load config settings

      -

      npm-ls(3)

      +

      npm-ls(3)

      List installed packages

      -

      npm-outdated(3)

      +

      npm-outdated(3)

      Check for outdated packages

      -

      npm-owner(3)

      +

      npm-owner(3)

      Manage package owners

      -

      npm-pack(3)

      +

      npm-pack(3)

      Create a tarball from a package

      -

      npm-ping(3)

      +

      npm-ping(3)

      Ping npm registry

      -

      npm-prefix(3)

      +

      npm-prefix(3)

      Display prefix

      -

      npm-prune(3)

      +

      npm-prune(3)

      Remove extraneous packages

      -

      npm-publish(3)

      +

      npm-publish(3)

      Publish a package

      -

      npm-rebuild(3)

      +

      npm-rebuild(3)

      Rebuild a package

      -

      npm-repo(3)

      +

      npm-repo(3)

      Open package repository page in the browser

      -

      npm-restart(3)

      +

      npm-restart(3)

      Restart a package

      -

      npm-root(3)

      +

      npm-root(3)

      Display npm root

      -

      npm-run-script(3)

      +

      npm-run-script(3)

      Run arbitrary package scripts

      -

      npm-search(3)

      +

      npm-search(3)

      Search for packages

      -

      npm-shrinkwrap(3)

      +

      npm-shrinkwrap(3)

      programmatically generate package shrinkwrap file

      -

      npm-start(3)

      +

      npm-start(3)

      Start a package

      -

      npm-stop(3)

      +

      npm-stop(3)

      Stop a package

      -

      npm-tag(3)

      +

      npm-tag(3)

      Tag a published version

      -

      npm-test(3)

      +

      npm-test(3)

      Test a package

      -

      npm-uninstall(3)

      +

      npm-uninstall(3)

      uninstall a package programmatically

      -

      npm-unpublish(3)

      +

      npm-unpublish(3)

      Remove a package from the registry

      -

      npm-update(3)

      +

      npm-update(3)

      Update a package

      -

      npm-version(3)

      +

      npm-version(3)

      Bump a package version

      -

      npm-view(3)

      +

      npm-view(3)

      View registry info

      -

      npm-whoami(3)

      +

      npm-whoami(3)

      Display npm username

      Files

      File system structures npm uses

      -

      npm-folders(5)

      +

      npm-folders(5)

      Folder Structures Used by npm

      -

      npmrc(5)

      +

      npmrc(5)

      The npm config files

      -

      package.json(5)

      +

      package.json(5)

      Specifics of npm's package.json handling

      Misc

      Various other bits and bobs

      -

      npm-coding-style(7)

      +

      npm-coding-style(7)

      npm's "funny" coding style

      -

      npm-config(7)

      +

      npm-config(7)

      More than you probably want to know about npm configuration

      -

      npm-developers(7)

      +

      npm-developers(7)

      Developer Guide

      -

      npm-disputes(7)

      +

      npm-disputes(7)

      Handling Module Name Disputes

      -

      npm-faq(7)

      -

      Frequently Asked Questions

      -

      npm-index(7)

      +

      npm-index(7)

      Index of all npm documentation

      -

      npm-registry(7)

      +

      npm-orgs(7)

      +

      Working with Teams & Orgs

      +

      npm-registry(7)

      The JavaScript Package Registry

      -

      npm-scope(7)

      +

      npm-scope(7)

      Scoped packages

      -

      npm-scripts(7)

      +

      npm-scripts(7)

      How npm handles the "scripts" field

      -

      removing-npm(7)

      +

      removing-npm(7)

      Cleaning the Slate

      -

      semver(7)

      +

      semver(7)

      The semantic versioner for npm

      @@ -240,5 +242,5 @@

      s        - + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html new file mode 100644 index 00000000000000..25b626e7dbfcda --- /dev/null +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -0,0 +1,89 @@ + + + npm-orgs + + + + + + +
      + +

      npm-orgs

      Working with Teams & Orgs

      +

      DESCRIPTION

      +

      There are three levels of org users:

      +
        +
      1. Super admin, controls billing & adding people to the org.
      2. +
      3. Team admin, manages team membership & package access.
      4. +
      5. Developer, works on packages they are given access to.
      6. +
      +

      The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a developers team that all users are automatically added to.

      +

      The team admin is the person who manages team creation, team membership, and package access for teams. The team admin grants package access to teams, not individuals.

      +

      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. +
      +

      Team Admins create teams

      +
        +
      • Check who you’ve added to your org:
      • +
      +
      npm team ls <org>:developers
      +
        +
      • Each org is automatically given a developers team, so you can see the whole list of team members in your org. This team automatically gets read-write access to all packages, but you can change that with the access command.

        +
      • +
      • Create a new team:

        +
      • +
      +
      npm team create <org:team>
      +
        +
      • Add members to that team:
      • +
      +
      npm team add <org:team> <user>
      +

      Publish a package and adjust package access

      +
        +
      • In package directory, run
      • +
      +
      npm init --scope=<org>
      +

      to scope it for your org & publish as usual

      +
        +
      • Grant access:
      • +
      +
      npm access grant <read-only|read-write> <org:team> [<package>]
      +
        +
      • Revoke access:
      • +
      +
      npm access revoke <org:team> [<package>]
      +

      Monitor your package access

      +
        +
      • See what org packages a team member can access:
      • +
      +
      npm access ls-packages <org> <user>
      +
        +
      • See packages available to a specific team:
      • +
      +
      npm access ls-packages <org:team>
      +
        +
      • Check which teams are collaborating on a package:
      • +
      +
      npm access ls-collaborators <pkg>
      +

      SEE ALSO

      + + +
      + + + + + + + + + + + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index 1d66dd304b3c41..965cc0878e756f 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -17,14 +17,14 @@

      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), -npmrc(5), and npm-config(7) for more on managing npm's configuration.

      +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), +npmrc(5), and npm-config(7) for more on managing npm's configuration.

      Can I run my own private registry?

      Yes!

      The easiest way is to replicate the couch database, and use the same (or @@ -40,7 +40,7 @@

      package.json(5) for more info on what goes in the package.json file.

      +

      See package.json(5) for more info on what goes in the package.json file.

      Will you replicate from my registry into the public one?

      No. If you want things to be public, then publish them into the public registry using npm. What little security there is would be for nought @@ -52,11 +52,11 @@

      Is there

      Yes, head over to https://npmjs.com/

      SEE ALSO

      @@ -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 3d3cbb6db3d005..7511fcfdb7a851 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -35,7 +35,7 @@

      Installing scoped packages

      "@myorg/mypackage": "^1.3.0" }

      Note that if the @-symbol is omitted in either case npm will instead attempt to -install from GitHub; see npm-install(1).

      +install from GitHub; see npm-install(1).

      Requiring scoped packages

      Because scoped packages are installed into a scope folder, you have to include the name of the scope when requiring them in your code, e.g.

      @@ -75,9 +75,9 @@

      Associating a scope with a registry that registry instead.

      SEE ALSO

      @@ -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 b879065dd367ed..72f8a86bacf63e 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -73,9 +73,9 @@

      DEFAULT VALUES

      If there is a server.js file in the root of your package, then npm will default the start command to node server.js.

      -
    • "preinstall": "node-waf clean || true; node-waf configure build":

      -

      If there is a wscript file in the root of your package, npm will -default the preinstall command to compile using node-waf.

      +
    • "install": "node-gyp rebuild":

      +

      If there is a bindings.gyp file in the root of your package, npm will +default the install command to compile using node-gyp.

    USER

    @@ -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 @@ -172,11 +172,11 @@

    BEST PRACTICES

    only will prevent some optional features, then it's better to just print a warning and exit successfully.
  • Try not to use scripts to do what npm can do for you. Read through -package.json(5) to see all the things that you can specify and enable +package.json(5) to see all the things that you can specify and enable 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 @@ -190,10 +190,10 @@

    BEST PRACTICES

SEE ALSO

@@ -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 64aaefcdfc7ba1..ea35c20539d81d 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -38,12 +38,12 @@

SYNOPSIS

Prior to version 0.3, npm used shim files for executables and node modules. To track those down, you can do the following:

find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
-

(This is also in the README file.)

+

(This is also in the README file.)

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 3dd74b37af3f04..72aaa36aa6ee3f 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..0d3c128b794d0e 100644 --- a/deps/npm/html/index.html +++ b/deps/npm/html/index.html @@ -86,7 +86,7 @@

    Other Cool Stuff

  • README
  • Help Documentation
  • FAQ -
  • Search for Packages +
  • Search for Packages
  • Mailing List
  • Bugs diff --git a/deps/npm/html/partial/doc/README.html b/deps/npm/html/partial/doc/README.html deleted file mode 100644 index 265dc198be38df..00000000000000 --- a/deps/npm/html/partial/doc/README.html +++ /dev/null @@ -1,163 +0,0 @@ -

    npm

    a JavaScript package manager

    -

    Build Status

    -

    SYNOPSIS

    -

    This is just enough info to get you up and running.

    -

    Much more info available via npm help once it's installed.

    -

    IMPORTANT

    -

    You need node v0.8 or higher to run this program.

    -

    To install an old and unsupported version of npm that works on node 0.3 -and prior, clone the git repo and dig through the old tags and branches.

    -

    Super Easy Install

    -

    npm comes with node now.

    -

    Windows Computers

    -

    Get the MSI. npm is in it.

    -

    Apple Macintosh Computers

    -

    Get the pkg. npm is in it.

    -

    Other Sorts of Unices

    -

    Run make install. npm will be installed with node.

    -

    If you want a more fancy pants install (a different version, customized -paths, etc.) then read on.

    -

    Fancy Install (Unix)

    -

    There's a pretty robust install script at -https://www.npmjs.com/install.sh. You can download that and run it.

    -

    Here's an example using curl:

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

    Slightly Fancier

    -

    You can set any npm configuration params with that script:

    -
    npm_config_prefix=/some/path sh install.sh
    -
    -

    Or, you can run it in uber-debuggery mode:

    -
    npm_debug=1 sh install.sh
    -
    -

    Even Fancier

    -

    Get the code with git. Use make to build the docs and do other stuff. -If you plan on hacking on npm, make link is your friend.

    -

    If you've got the npm source code, you can also semi-permanently set -arbitrary config keys using the ./configure --key=val ..., and then -run npm commands by doing node cli.js <cmd> <args>. (This is helpful -for testing, or running stuff without actually installing npm itself.)

    -

    Windows Install or Upgrade

    -

    You can download a zip file from https://github.com/npm/npm/releases, and -unpack it in the node_modules\npm\ folder inside node's installation folder.

    -

    To upgrade to npm 2, follow the Windows upgrade instructions in -the npm Troubleshooting Guide:

    -

    https://github.com/npm/npm/wiki/Troubleshooting#upgrading-on-windows

    -

    If that's not fancy enough for you, then you can fetch the code with -git, and mess with it directly.

    -

    Installing on Cygwin

    -

    No.

    -

    Uninstalling

    -

    So sad to see you go.

    -
    sudo npm uninstall npm -g
    -
    -

    Or, if that fails,

    -
    sudo make uninstall
    -
    -

    More Severe Uninstalling

    -

    Usually, the above instructions are sufficient. That will remove -npm, but leave behind anything you've installed.

    -

    If you would like to remove all the packages that you have installed, -then you can use the npm ls command to find them, and then npm rm to -remove them.

    -

    To remove cruft left behind by npm 0.x, you can use the included -clean-old.sh script file. You can run it conveniently like this:

    -
    npm explore npm -g -- sh scripts/clean-old.sh
    -
    -

    npm uses two configuration files, one for per-user configs, and another -for global (every-user) configs. You can view them by doing:

    -
    npm config get userconfig   # defaults to ~/.npmrc
    -npm config get globalconfig # defaults to /usr/local/etc/npmrc
    -
    -

    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.

    -

    Using npm Programmatically

    -

    Although npm can be used programmatically, its API is meant for use by the CLI -only, 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 npm command with appropriate arguments.

    -

    The semantic version of npm refers to the CLI itself, rather than the -underlying API. The internal API is not guaranteed to remain stable even when -npm's version indicates no breaking changes have been made according to -semver.

    -

    If you still would like to use npm programmatically, it's possible. The API -isn't very well documented, but it is rather simple.

    -

    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.

    -
    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) { .... })
    -})
    -
    -

    The load function takes an object hash of the command-line configs. -The various npm.commands.<cmd> functions take an array of -positional argument strings. The last argument to any -npm.commands.<cmd> function is a callback. Some commands take other -optional arguments. Read the source.

    -

    You cannot set configs individually for any single npm function at this -time. Since npm is a singleton, any call to npm.config.set will -change the value for all npm commands in that process.

    -

    See ./bin/npm-cli.js for an example of pulling config values off of the -command line arguments using nopt. You may also want to check out npm -help config to learn about all the options you can set there.

    -

    More Docs

    -

    Check out the docs, -especially the faq.

    -

    You can use the npm help command to read any of them.

    -

    If you're a developer, and you want to use npm to publish your program, -you should read this

    - -

    "npm" and "The npm Registry" are owned by npm, Inc. -All rights reserved. See the included LICENSE file for more details.

    -

    "Node.js" and "node" are trademarks owned by Joyent, Inc.

    -

    Modules published on the npm registry are not officially endorsed by -npm, Inc. or the Node.js project.

    -

    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.

    -

    If you have a complaint about a package in the public npm registry, -and cannot resolve it with the package -owner, please email -support@npmjs.com and explain the situation.

    -

    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.

    -

    In plainer english

    -

    npm is the property of npm, Inc.

    -

    If you publish something, it's yours, and you are solely accountable -for it.

    -

    If other people publish something, it's theirs.

    -

    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.

    -

    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.

    -

    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.

    -

    You can also look for isaacs in #node.js on irc://irc.freenode.net. He -will no doubt tell you to put the output in a gist or email.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/api/npm-bin.html b/deps/npm/html/partial/doc/api/npm-bin.html deleted file mode 100644 index 54f895518ab132..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-bin.html +++ /dev/null @@ -1,8 +0,0 @@ -

    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/partial/doc/api/npm-bugs.html b/deps/npm/html/partial/doc/api/npm-bugs.html deleted file mode 100644 index e9ff2a58aa5e80..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-bugs.html +++ /dev/null @@ -1,13 +0,0 @@ -

    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/partial/doc/api/npm-cache.html b/deps/npm/html/partial/doc/api/npm-cache.html deleted file mode 100644 index b837a688695402..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-cache.html +++ /dev/null @@ -1,22 +0,0 @@ -

    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/partial/doc/api/npm-commands.html b/deps/npm/html/partial/doc/api/npm-commands.html deleted file mode 100644 index eaf57af4af0395..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-commands.html +++ /dev/null @@ -1,16 +0,0 @@ -

    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/partial/doc/api/npm-config.html b/deps/npm/html/partial/doc/api/npm-config.html deleted file mode 100644 index b34c02182d3e68..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-config.html +++ /dev/null @@ -1,37 +0,0 @@ -

    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/partial/doc/api/npm-deprecate.html b/deps/npm/html/partial/doc/api/npm-deprecate.html deleted file mode 100644 index f0ef298b2a2532..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-deprecate.html +++ /dev/null @@ -1,27 +0,0 @@ -

    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/partial/doc/api/npm-docs.html b/deps/npm/html/partial/doc/api/npm-docs.html deleted file mode 100644 index dde38920fd10d6..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-docs.html +++ /dev/null @@ -1,13 +0,0 @@ -

    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/partial/doc/api/npm-edit.html b/deps/npm/html/partial/doc/api/npm-edit.html deleted file mode 100644 index ef49f94e14ebb7..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-edit.html +++ /dev/null @@ -1,16 +0,0 @@ -

    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/partial/doc/api/npm-explore.html b/deps/npm/html/partial/doc/api/npm-explore.html deleted file mode 100644 index 60f3ac17802768..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-explore.html +++ /dev/null @@ -1,11 +0,0 @@ -

    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/partial/doc/api/npm-help-search.html b/deps/npm/html/partial/doc/api/npm-help-search.html deleted file mode 100644 index 7818b6b1e74cb2..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-help-search.html +++ /dev/null @@ -1,24 +0,0 @@ -

    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/partial/doc/api/npm-init.html b/deps/npm/html/partial/doc/api/npm-init.html deleted file mode 100644 index 723fbdebedb2a7..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-init.html +++ /dev/null @@ -1,19 +0,0 @@ -

    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/partial/doc/api/npm-install.html b/deps/npm/html/partial/doc/api/npm-install.html deleted file mode 100644 index bfbd5668877b24..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-install.html +++ /dev/null @@ -1,12 +0,0 @@ -

    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/partial/doc/api/npm-link.html b/deps/npm/html/partial/doc/api/npm-link.html deleted file mode 100644 index e2efe3ebc1fee0..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-link.html +++ /dev/null @@ -1,22 +0,0 @@ -

    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/partial/doc/api/npm-load.html b/deps/npm/html/partial/doc/api/npm-load.html deleted file mode 100644 index 0796cacdab6c78..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-load.html +++ /dev/null @@ -1,17 +0,0 @@ -

    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/partial/doc/api/npm-ls.html b/deps/npm/html/partial/doc/api/npm-ls.html deleted file mode 100644 index 850955b836120b..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-ls.html +++ /dev/null @@ -1,43 +0,0 @@ -

    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/partial/doc/api/npm-outdated.html b/deps/npm/html/partial/doc/api/npm-outdated.html deleted file mode 100644 index 16d3150d3f7117..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-outdated.html +++ /dev/null @@ -1,8 +0,0 @@ -

    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/partial/doc/api/npm-owner.html b/deps/npm/html/partial/doc/api/npm-owner.html deleted file mode 100644 index 20e8b6840e4eff..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-owner.html +++ /dev/null @@ -1,27 +0,0 @@ -

    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/partial/doc/api/npm-pack.html b/deps/npm/html/partial/doc/api/npm-pack.html deleted file mode 100644 index 6417688673c4aa..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-pack.html +++ /dev/null @@ -1,13 +0,0 @@ -

    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/partial/doc/api/npm-ping.html b/deps/npm/html/partial/doc/api/npm-ping.html deleted file mode 100644 index ac8a29e185c66b..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-ping.html +++ /dev/null @@ -1,8 +0,0 @@ -

    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/partial/doc/api/npm-prefix.html b/deps/npm/html/partial/doc/api/npm-prefix.html deleted file mode 100644 index e9904b18d9f082..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-prefix.html +++ /dev/null @@ -1,9 +0,0 @@ -

    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/partial/doc/api/npm-prune.html b/deps/npm/html/partial/doc/api/npm-prune.html deleted file mode 100644 index 5835a9b6a79270..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-prune.html +++ /dev/null @@ -1,10 +0,0 @@ -

    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/partial/doc/api/npm-publish.html b/deps/npm/html/partial/doc/api/npm-publish.html deleted file mode 100644 index f0e5da91ba3d44..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-publish.html +++ /dev/null @@ -1,26 +0,0 @@ -

    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/partial/doc/api/npm-rebuild.html b/deps/npm/html/partial/doc/api/npm-rebuild.html deleted file mode 100644 index e428728a61775a..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-rebuild.html +++ /dev/null @@ -1,10 +0,0 @@ -

    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/partial/doc/api/npm-repo.html b/deps/npm/html/partial/doc/api/npm-repo.html deleted file mode 100644 index 9a18976cd41632..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-repo.html +++ /dev/null @@ -1,13 +0,0 @@ -

    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/partial/doc/api/npm-restart.html b/deps/npm/html/partial/doc/api/npm-restart.html deleted file mode 100644 index f0de7504a5b925..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-restart.html +++ /dev/null @@ -1,32 +0,0 @@ -

    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/partial/doc/api/npm-root.html b/deps/npm/html/partial/doc/api/npm-root.html deleted file mode 100644 index 1549515122ede3..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-root.html +++ /dev/null @@ -1,9 +0,0 @@ -

    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/partial/doc/api/npm-run-script.html b/deps/npm/html/partial/doc/api/npm-run-script.html deleted file mode 100644 index 7cc42b601adbc9..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-run-script.html +++ /dev/null @@ -1,21 +0,0 @@ -

    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/partial/doc/api/npm-search.html b/deps/npm/html/partial/doc/api/npm-search.html deleted file mode 100644 index 13cceb3d32169c..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-search.html +++ /dev/null @@ -1,33 +0,0 @@ -

    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/partial/doc/api/npm-shrinkwrap.html b/deps/npm/html/partial/doc/api/npm-shrinkwrap.html deleted file mode 100644 index b5f33599989c7a..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-shrinkwrap.html +++ /dev/null @@ -1,13 +0,0 @@ -

    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/partial/doc/api/npm-start.html b/deps/npm/html/partial/doc/api/npm-start.html deleted file mode 100644 index 98bd41f6b24d87..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-start.html +++ /dev/null @@ -1,8 +0,0 @@ -

    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/partial/doc/api/npm-stop.html b/deps/npm/html/partial/doc/api/npm-stop.html deleted file mode 100644 index 5b58289ed840d3..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-stop.html +++ /dev/null @@ -1,8 +0,0 @@ -

    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/partial/doc/api/npm-tag.html b/deps/npm/html/partial/doc/api/npm-tag.html deleted file mode 100644 index 227c91b46ca328..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-tag.html +++ /dev/null @@ -1,16 +0,0 @@ -

    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/partial/doc/api/npm-test.html b/deps/npm/html/partial/doc/api/npm-test.html deleted file mode 100644 index 9c35bdcfdb8050..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-test.html +++ /dev/null @@ -1,10 +0,0 @@ -

    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/partial/doc/api/npm-uninstall.html b/deps/npm/html/partial/doc/api/npm-uninstall.html deleted file mode 100644 index 62369e4c7c66ec..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-uninstall.html +++ /dev/null @@ -1,10 +0,0 @@ -

    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/partial/doc/api/npm-unpublish.html b/deps/npm/html/partial/doc/api/npm-unpublish.html deleted file mode 100644 index ed9948cd849771..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-unpublish.html +++ /dev/null @@ -1,13 +0,0 @@ -

    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/partial/doc/api/npm-update.html b/deps/npm/html/partial/doc/api/npm-update.html deleted file mode 100644 index 5d48bc0d8ec83c..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-update.html +++ /dev/null @@ -1,13 +0,0 @@ -

    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/partial/doc/api/npm-version.html b/deps/npm/html/partial/doc/api/npm-version.html deleted file mode 100644 index c2b8d5eb8b91a1..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-version.html +++ /dev/null @@ -1,12 +0,0 @@ -

    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/partial/doc/api/npm-view.html b/deps/npm/html/partial/doc/api/npm-view.html deleted file mode 100644 index 4f5acf62439424..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-view.html +++ /dev/null @@ -1,61 +0,0 @@ -

    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/partial/doc/api/npm-whoami.html b/deps/npm/html/partial/doc/api/npm-whoami.html deleted file mode 100644 index 3428a9e76777be..00000000000000 --- a/deps/npm/html/partial/doc/api/npm-whoami.html +++ /dev/null @@ -1,9 +0,0 @@ -

    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/partial/doc/api/npm.html b/deps/npm/html/partial/doc/api/npm.html deleted file mode 100644 index 5c57fd4bd7507c..00000000000000 --- a/deps/npm/html/partial/doc/api/npm.html +++ /dev/null @@ -1,89 +0,0 @@ -

    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.13.3

    -

    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/partial/doc/cli/npm-access.html b/deps/npm/html/partial/doc/cli/npm-access.html deleted file mode 100644 index 9d84e6db958ede..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-access.html +++ /dev/null @@ -1,55 +0,0 @@ -

    npm-access

    Set access level on published packages

    -

    SYNOPSIS

    -
    npm access public [<package>]
    -npm access restricted [<package>]
    -
    -npm access add <read-only|read-write> <entity> [<package>]
    -npm access rm <entity> [<package>]
    -
    -npm access ls [<package>]
    -npm access edit [<package>]
    -

    DESCRIPTION

    -

    Used to set access controls on private packages.

    -

    For all of the subcommands, npm access will perform actions on the packages -in the current working directory if no package name is passed to the -subcommand.

    -
      -
    • public / restricted: -Set a package to be either publicly accessible or restricted.

      -
    • -
    • add / rm: -Add or remove the ability of users and teams to have read-only or read-write -access to a package.

      -
    • -
    • ls: -Show all of the access privileges for a package. Will only show permissions -for packages to which you have at least read access.

      -
    • -
    • edit: -Set the access privileges for a package at once using $EDITOR.

      -
    • -
    -

    DETAILS

    -

    npm access always operates directly on the current registry, configurable -from the command line using --registry=<registry url>.

    -

    Unscoped packages are always public.

    -

    Scoped packages default to restricted, but you can either publish them as -public using npm publish --access=public, or set their access as public using -npm access public after the initial publish.

    -

    You must have privileges to set the access of a package:

    -
      -
    • You are an owner of an unscoped or scoped package.
    • -
    • You are a member of the team that owns a scope.
    • -
    • You have been given read-write privileges for a package, either as a member -of a team or directly as an owner.
    • -
    -

    If your account is not paid, then attempts to publish scoped packages will fail -with an HTTP 402 status code (logically enough), unless you use ---access=public.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-adduser.html b/deps/npm/html/partial/doc/cli/npm-adduser.html deleted file mode 100644 index ce2c5dcce6f36b..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-adduser.html +++ /dev/null @@ -1,48 +0,0 @@ -

    npm-adduser

    Add a registry user account

    -

    SYNOPSIS

    -
    npm adduser [--registry=url] [--scope=@orgname] [--always-auth]
    -

    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, -the default registry will be used (see npm-config(7)).

    -

    The username, password, and email are read in from prompts.

    -

    To reset your password, go to https://www.npmjs.com/forgot

    -

    To change your email address, go to https://www.npmjs.com/email-edit

    -

    You may use this command multiple times with the same user account to -authorize on a new machine. When authenticating on a new machine, -the username, password and email address must all match with -your existing record.

    -

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

    -

    CONFIGURATION

    -

    registry

    -

    Default: http://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

    -

    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.

    -

    always-auth

    -

    Default: false

    -

    If specified, save configuration indicating that all requests to the given -registry should include authorization information. Useful for private -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.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-bin.html b/deps/npm/html/partial/doc/cli/npm-bin.html deleted file mode 100644 index 1485681b5f672f..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-bin.html +++ /dev/null @@ -1,15 +0,0 @@ -

    npm-bin

    Display npm bin folder

    -

    SYNOPSIS

    -
    npm bin
    -

    DESCRIPTION

    -

    Print the folder where npm will install executables.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-bugs.html b/deps/npm/html/partial/doc/cli/npm-bugs.html deleted file mode 100644 index d40152e3884057..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-bugs.html +++ /dev/null @@ -1,34 +0,0 @@ -

    npm-bugs

    Bugs for a package in a web browser maybe

    -

    SYNOPSIS

    -
    npm bugs <pkgname>
    -npm bugs (with no args in a package dir)
    -

    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. If no package name is provided, it will search for -a package.json in the current folder and use the name property.

    -

    CONFIGURATION

    -

    browser

    -
      -
    • Default: OS X: "open", Windows: "start", Others: "xdg-open"
    • -
    • Type: String
    • -
    -

    The browser that is called by the npm bugs command to open websites.

    -

    registry

    - -

    The base URL of the npm package registry.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-build.html b/deps/npm/html/partial/doc/cli/npm-build.html deleted file mode 100644 index 11ba89b11f8c0a..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-build.html +++ /dev/null @@ -1,20 +0,0 @@ -

    npm-build

    Build a package

    -

    SYNOPSIS

    -
    npm build <package-folder>
    -
      -
    • <package-folder>: -A folder containing a package.json file in its root.
    • -
    -

    DESCRIPTION

    -

    This is the plumbing command called by npm link and npm install.

    -

    It should generally be called during installation, but if you need to run it -directly, run:

    -
    npm run-script build
    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-bundle.html b/deps/npm/html/partial/doc/cli/npm-bundle.html deleted file mode 100644 index 38bbdd83e38d4a..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-bundle.html +++ /dev/null @@ -1,11 +0,0 @@ -

    npm-bundle

    REMOVED

    -

    DESCRIPTION

    -

    The npm bundle command has been removed in 1.0, for the simple reason -that it is no longer necessary, as the default behavior is now to -install packages into the local space.

    -

    Just use npm install now to do what npm bundle used to do.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-cache.html b/deps/npm/html/partial/doc/cli/npm-cache.html deleted file mode 100644 index f1a3b1896439ea..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-cache.html +++ /dev/null @@ -1,61 +0,0 @@ -

    npm-cache

    Manipulates packages cache

    -

    SYNOPSIS

    -
    npm cache add <tarball file>
    -npm cache add <folder>
    -npm cache add <tarball url>
    -npm cache add <name>@<version>
    -
    -npm cache ls [<path>]
    -
    -npm cache clean [<path>]
    -

    DESCRIPTION

    -

    Used to add, list, or clear the npm cache folder.

    -
      -
    • add: -Add the specified package to the local cache. This command is primarily -intended to be used internally by npm, but it can provide a way to -add data to the local installation cache explicitly.

      -
    • -
    • ls: -Show the data in the cache. Argument is a path to show in the cache -folder. Works a bit like the find program, but limited by the -depth config.

      -
    • -
    • clean: -Delete data out of the cache folder. If an argument is provided, then -it specifies a subpath to delete. If no argument is provided, then -the entire cache is cleared.

      -
    • -
    -

    DETAILS

    -

    npm stores cache data in the directory specified in npm config get cache. -For each package that is added to the cache, three pieces of information are -stored in {cache}/{name}/{version}:

    -
      -
    • .../package/package.json: -The package.json file, as npm sees it.
    • -
    • .../package.tgz: -The tarball for that version.
    • -
    -

    Additionally, whenever a registry request is made, a .cache.json file -is placed at the corresponding URI, to store the ETag and the requested -data. This is stored in {cache}/{hostname}/{path}/.cache.json.

    -

    Commands that make non-essential registry requests (such as search and -view, or the completion scripts) generally specify a minimum timeout. -If the .cache.json file is younger than the specified timeout, then -they do not make an HTTP request to the registry.

    -

    CONFIGURATION

    -

    cache

    -

    Default: ~/.npm on Posix, or %AppData%/npm-cache on Windows.

    -

    The root cache folder.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-completion.html b/deps/npm/html/partial/doc/cli/npm-completion.html deleted file mode 100644 index 1c9879337a5438..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-completion.html +++ /dev/null @@ -1,22 +0,0 @@ -

    npm-completion

    Tab Completion for npm

    -

    SYNOPSIS

    -
    . <(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 -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 -environment, npm completion acts in "plumbing mode", and outputs -completions based on the arguments.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-config.html b/deps/npm/html/partial/doc/cli/npm-config.html deleted file mode 100644 index 3fee266c1c0e28..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-config.html +++ /dev/null @@ -1,46 +0,0 @@ -

    npm-config

    Manage the npm configuration files

    -

    SYNOPSIS

    -
    npm config set <key> <value> [--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]
    -

    DESCRIPTION

    -

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

    -

    See npmrc(5) for more information about the npmrc files.

    -

    See npm-config(7) for a more thorough discussion of the mechanisms -involved.

    -

    The npm config command can be used to update and edit the contents -of the user and global npmrc files.

    -

    Sub-commands

    -

    Config supports the following sub-commands:

    -

    set

    -
    npm config set key value
    -

    Sets the config key to the value.

    -

    If value is omitted, then it sets it to "true".

    -

    get

    -
    npm config get key
    -

    Echo the config value to stdout.

    -

    list

    -
    npm config list
    -

    Show all the config settings.

    -

    delete

    -
    npm config delete key
    -

    Deletes the key from all configuration files.

    -

    edit

    -
    npm config edit
    -

    Opens the config file in an editor. Use the --global flag to edit the -global config.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-dedupe.html b/deps/npm/html/partial/doc/cli/npm-dedupe.html deleted file mode 100644 index 56a37c32db00d9..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-dedupe.html +++ /dev/null @@ -1,43 +0,0 @@ -

    npm-dedupe

    Reduce duplication

    -

    SYNOPSIS

    -
    npm dedupe [package names...]
    -npm ddp [package names...]
    -

    DESCRIPTION

    -

    Searches the local package tree and attempts to simplify the overall -structure by moving dependencies further up the tree, where they can -be more effectively shared by multiple dependent packages.

    -

    For example, consider this dependency graph:

    -
    a
    -+-- b <-- depends on c@1.0.x
    -|   `-- c@1.0.3
    -`-- d <-- depends on c@~1.0.9
    -    `-- c@1.0.10
    -

    In this case, npm-dedupe(1) will transform the tree to:

    -
    a
    -+-- b
    -+-- d
    -`-- c@1.0.10
    -

    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.

    -

    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.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-deprecate.html b/deps/npm/html/partial/doc/cli/npm-deprecate.html deleted file mode 100644 index 0657facd8ef612..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-deprecate.html +++ /dev/null @@ -1,18 +0,0 @@ -

    npm-deprecate

    Deprecate a version of a package

    -

    SYNOPSIS

    -
    npm deprecate <name>[@<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.

    -

    It works on version ranges as well as specific versions, so you can do -something like this:

    -
    npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
    -

    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/partial/doc/cli/npm-dist-tag.html b/deps/npm/html/partial/doc/cli/npm-dist-tag.html deleted file mode 100644 index e99e059aee4382..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-dist-tag.html +++ /dev/null @@ -1,57 +0,0 @@ -

    npm-dist-tag

    Modify package distribution tags

    -

    SYNOPSIS

    -
    npm dist-tag add <pkg>@<version> [<tag>]
    -npm dist-tag rm <pkg> <tag>
    -npm dist-tag ls [<pkg>]
    -

    DESCRIPTION

    -

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

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

      -
    • -
    • rm: -Clear a tag that is no longer in use from the package.

      -
    • -
    • ls: -Show all of the dist-tags for a package, defaulting to the package in -the current prefix.

      -
    • -
    -

    A tag can be used when installing packages as a reference to a version instead -of using a specific version number:

    -
    npm install <name>@<tag>
    -

    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 ---tag option is used. For example, npm publish --tag=beta.

    -

    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".

    -

    CAVEATS

    -

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

    -

    Tags must share a namespace with version numbers, because they are specified in -the same slot: npm install <pkg>@<version> vs npm install <pkg>@<tag>.

    -

    Tags that can be interpreted as valid semver ranges will be rejected. For -example, v1.4 cannot be used as a tag, because it is interpreted by semver as ->=1.4.0 <1.5.0. See https://github.com/npm/npm/issues/6082.

    -

    The simplest way to avoid semver problems with tags is to use tags that do not -begin with a number or the letter v.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-docs.html b/deps/npm/html/partial/doc/cli/npm-docs.html deleted file mode 100644 index 3866ff1a0a4056..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-docs.html +++ /dev/null @@ -1,36 +0,0 @@ -

    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 home [<pkgname> [<pkgname> ...]]
    -npm home (with no args in a package dir)
    -

    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. You can pass multiple package names at once. If no -package name is provided, it will search for a package.json in -the current folder and use the name property.

    -

    CONFIGURATION

    -

    browser

    -
      -
    • Default: OS X: "open", Windows: "start", Others: "xdg-open"
    • -
    • Type: String
    • -
    -

    The browser that is called by the npm docs command to open websites.

    -

    registry

    - -

    The base URL of the npm package registry.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-edit.html b/deps/npm/html/partial/doc/cli/npm-edit.html deleted file mode 100644 index 82b75ad7f3c1cb..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-edit.html +++ /dev/null @@ -1,29 +0,0 @@ -

    npm-edit

    Edit an installed package

    -

    SYNOPSIS

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

    DESCRIPTION

    -

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

    -

    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 edit connect to make a few -changes to your locally installed copy.

    -

    CONFIGURATION

    -

    editor

    -
      -
    • Default: EDITOR environment variable if set, or "vi" on Posix, -or "notepad" on Windows.
    • -
    • Type: path
    • -
    -

    The command to run for npm edit or npm config edit.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-explore.html b/deps/npm/html/partial/doc/cli/npm-explore.html deleted file mode 100644 index fe2fbd494caeaa..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-explore.html +++ /dev/null @@ -1,29 +0,0 @@ -

    npm-explore

    Browse an installed package

    -

    SYNOPSIS

    -
    npm explore <name> [ -- <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 -immediately terminates.

    -

    This is particularly handy in the case of git submodules in the -node_modules folder:

    -
    npm explore some-dependency -- git pull origin master
    -

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

    -

    CONFIGURATION

    -

    shell

    -
      -
    • Default: SHELL environment variable, or "bash" on Posix, or "cmd" on -Windows
    • -
    • Type: path
    • -
    -

    The shell to run for the npm explore command.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-help-search.html b/deps/npm/html/partial/doc/cli/npm-help-search.html deleted file mode 100644 index afd8fb47313740..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-help-search.html +++ /dev/null @@ -1,26 +0,0 @@ -

    npm-help-search

    Search npm help documentation

    -

    SYNOPSIS

    -
    npm help-search some search terms
    -

    DESCRIPTION

    -

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

    -

    If only one result is found, then it will show that help topic.

    -

    If the argument to npm help is not a known help topic, then it will -call help-search. It is rarely if ever necessary to call this -command directly.

    -

    CONFIGURATION

    -

    long

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

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

    -

    If false, then help-search will just list out the help topics found.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-help.html b/deps/npm/html/partial/doc/cli/npm-help.html deleted file mode 100644 index 4217b8447c5065..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-help.html +++ /dev/null @@ -1,32 +0,0 @@ -

    npm-help

    Get help on npm

    -

    SYNOPSIS

    -
    npm help <topic>
    -npm help some search 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 -the help-search command to find a match. Note that, if help-search -finds a single subject, then it will run help on that topic, so unique -matches are equivalent to specifying a topic name.

    -

    CONFIGURATION

    -

    viewer

    -
      -
    • Default: "man" on Posix, "browser" on Windows
    • -
    • Type: path
    • -
    -

    The program to use to view help content.

    -

    Set to "browser" to view html help content in the default web browser.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-init.html b/deps/npm/html/partial/doc/cli/npm-init.html deleted file mode 100644 index ff363fab1a6909..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-init.html +++ /dev/null @@ -1,28 +0,0 @@ -

    npm-init

    Interactively create a package.json file

    -

    SYNOPSIS

    -
    npm init [-f|--force|-y|--yes]
    -

    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.

    -

    If you invoke it with -f, --force, -y, or --yes, it will use only -defaults and not prompt you for any options.

    -

    CONFIGURATION

    -

    scope

    -
      -
    • Default: none
    • -
    • Type: String
    • -
    -

    The scope under which the new module should be created.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-install.html b/deps/npm/html/partial/doc/cli/npm-install.html deleted file mode 100644 index 98dadcc9135b3f..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-install.html +++ /dev/null @@ -1,257 +0,0 @@ -

    npm-install

    Install a package

    -

    SYNOPSIS

    -
    npm install (with no args in a package dir)
    -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)
    -

    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
    • -
    • 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)
    • -
    • f) a <name> that has a "latest" tag satisfying (e)
    • -
    • g) a <git remote url> that resolves to (b)
    • -
    -

    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).

    -
      -
    • npm install (in package directory, no arguments):

      -

      Install the dependencies in the local node_modules folder.

      -

      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 - is set to production), npm will not install modules listed in - devDependencies.

      -
    • -
    • npm install <folder>:

      -

      Install a package that is sitting in a folder on the filesystem.

      -
    • -
    • npm install <tarball file>:

      -

      Install a package that is sitting on the filesystem. Note: if you just want - to link a dev directory into your npm root, you can do this more easily by - using npm link.

      -

      Example:

      -
          npm install ./package.tgz
      -
    • -
    • npm install <tarball url>:

      -

      Fetch the tarball url, and then install it. In order to distinguish between - this and other options, the argument must start with "http://" or "https://"

      -

      Example:

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

      -

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

      -

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

      -

      Example:

      -
          npm install sax
      -

      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.

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

        -
      • -
      • --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:

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

        -

        <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).

        -

        Note: if you do not include the @-symbol on your scope name, npm will -interpret this as a GitHub repository instead, see below. Scopes names -must also be followed by a slash.

        -

        Examples:

        -
        npm install sax --save
        -npm install githubname/reponame
        -npm install @myorg/privatepackage
        -npm install node-tap --save-dev
        -npm install dtrace-provider --save-optional
        -npm install readable-stream --save --save-exact
        -
      • -
      -
    • -
    -
    **Note**: If there is a file or folder named `<name>` in the current
    -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>:

      -

      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.

      -

      Example:

      -
          npm install sax@latest
      -    npm install @myorg/mypackage@latest
      -
    • -
    • 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>:

      -

      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 - treat it as a single argument.

      -

      Example:

      -
          npm install sax@">=0.1.0 <0.2.0"
      -    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.

      -

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

      -
        -
      • GIT_ASKPASS
      • -
      • GIT_PROXY_COMMAND
      • -
      • GIT_SSH
      • -
      • GIT_SSH_COMMAND
      • -
      • GIT_SSL_CAINFO
      • -
      • GIT_SSL_NO_VERIFY

        -

        See the git man page for details.

        -

        Examples:

        -
        npm install git+ssh://git@github.com:npm/npm.git#v1.0.27
        -npm install git+https://isaacs@github.com/npm/npm.git
        -npm install git://github.com/npm/npm.git#v1.0.27
        -GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/npm.git
        -
      • -
      -
    • -
    • npm install <githubname>/<githubrepo>[#<commit-ish>]:

      -
    • -
    • npm install github:<githubname>/<githubrepo>[#<commit-ish>]:

      -

      Install the package at https://github.com/githubname/githubrepo by - attempting to clone it using git.

      -

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

      -

      Examples:

      -
          npm install mygithubuser/myproject
      -    npm install github:mygithubuser/myproject
      -
    • -
    • 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.

      -

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

      -

      Example:

      -
          npm install gist:101a11beef
      -
    • -
    • npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]:

      -

      Install the package at https://bitbucket.org/bitbucketname/bitbucketrepo - by attempting to clone it using git.

      -

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

      -

      Example:

      -
          npm install bitbucket:mybitbucketuser/myproject
      -
    • -
    • npm install gitlab:<gitlabname>/<gitlabrepo>[#<commit-ish>]:

      -

      Install the package at https://gitlab.com/gitlabname/gitlabrepo - by attempting to clone it using git.

      -

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

      -

      Example:

      -
          npm install gitlab:mygitlabuser/myproject
      -
    • -
    -

    You may combine multiple arguments, and even multiple types of arguments. -For example:

    -
    npm install sax@">=0.1.0 <0.2.0" bench supervisor
    -

    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 -local copy exists on disk.

    -
    npm install sax --force
    -

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

    -

    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 -any binaries the package might contain.

    -

    The --no-optional argument will prevent optional dependencies from -being installed.

    -

    The --no-shrinkwrap argument, which will ignore an available -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.

    -

    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)
    -

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

    -
    A
    -+-- B
    -`-- 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.

    -

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

    -

    Limitations of npm's Install Algorithm

    -

    There are some very rare and pathological edge-cases where a cycle can -cause npm to try to install a never-ending tree of packages. Here is -the simplest case:

    -
    A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ...
    -

    where A is some version of a package, and A' is a different version -of the same package. Because B depends on a different version of A -than the one that is already in the tree, it must install a separate -copy. The same is true of A', which must install B'. Because B' -depends on the original version of A, which has been overridden, the -cycle falls into infinite regress.

    -

    To avoid this situation, npm flat-out refuses to install any -name@version that is already present anywhere in the tree of package -folder ancestors. A more correct, but more complex, solution would be -to symlink the existing version into the new location. If this ever -affects a real use-case, it will be investigated.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-link.html b/deps/npm/html/partial/doc/cli/npm-link.html deleted file mode 100644 index d25a64005b1852..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-link.html +++ /dev/null @@ -1,52 +0,0 @@ -

    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)
    -

    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).

    -

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

    -

    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). -The scope must be preceded by an @-symbol and followed by a slash.

    -

    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:

    -
    cd ~/projects/node-redis    # go into the package directory
    -npm link                    # creates global link
    -cd ~/projects/node-bloggy   # go into some other package directory.
    -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.

    -

    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
    -npm link ../node-redis     # link the dir of your dependency
    -

    The second line is the equivalent of doing:

    -
    (cd ../node-redis; npm link)
    -npm link node-redis
    -

    That is, it first creates a global link, and then links the global -installation target into your project's node_modules folder.

    -

    If your linked package is scoped (see npm-scope(7)) your link command must -include that scope, e.g.

    -
    npm link @myorg/privatepackage
    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-logout.html b/deps/npm/html/partial/doc/cli/npm-logout.html deleted file mode 100644 index 63c28a3d7ca7cd..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-logout.html +++ /dev/null @@ -1,35 +0,0 @@ -

    npm-logout

    Log out of the registry

    -

    SYNOPSIS

    -
    npm logout [--registry=url] [--scope=@orgname]
    -

    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 -you're using it, not just for the current environment.

    -

    When logged into a legacy registry that uses username and password authentication, this will -clear the credentials in your user configuration. In this case, it will only affect -the current environment.

    -

    If --scope is provided, this will find the credentials for the registry -connected to that scope, if set.

    -

    CONFIGURATION

    -

    registry

    -

    Default: http://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

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-ls.html b/deps/npm/html/partial/doc/cli/npm-ls.html deleted file mode 100644 index 9674a414fe6a7c..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-ls.html +++ /dev/null @@ -1,77 +0,0 @@ -

    npm-ls

    List installed packages

    -

    SYNOPSIS

    -
    npm list [[@<scope>/]<pkg> ...]
    -npm ls [[@<scope>/]<pkg> ...]
    -npm la [[@<scope>/]<pkg> ...]
    -npm ll [[@<scope>/]<pkg> ...]
    -

    DESCRIPTION

    -

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

    -

    Positional arguments are name@version-range identifiers, which will -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.13.3 /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.

    -

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

    -

    CONFIGURATION

    -

    json

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

    Show information in JSON format.

    -

    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.

    -

    depth

    -
      -
    • Type: Int
    • -
    -

    Max display depth of the dependency tree.

    -

    prod / production

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

    Display only the dependency tree for packages in dependencies.

    -

    dev

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

    Display only the dependency tree for packages in devDependencies.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-outdated.html b/deps/npm/html/partial/doc/cli/npm-outdated.html deleted file mode 100644 index ea07e01c1ce841..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-outdated.html +++ /dev/null @@ -1,47 +0,0 @@ -

    npm-outdated

    Check for outdated packages

    -

    SYNOPSIS

    -
    npm outdated [<name> [<name> ...]]
    -

    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.

    -

    CONFIGURATION

    -

    json

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

    Show information in JSON format.

    -

    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
    • -
    -

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

    -

    depth

    -
      -
    • Type: Int
    • -
    -

    Max depth for checking dependency tree.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-owner.html b/deps/npm/html/partial/doc/cli/npm-owner.html deleted file mode 100644 index 0e0dc92e41684a..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-owner.html +++ /dev/null @@ -1,29 +0,0 @@ -

    npm-owner

    Manage package owners

    -

    SYNOPSIS

    -
    npm owner ls <package name>
    -npm owner add <user> <package name>
    -npm owner rm <user> <package name>
    -

    DESCRIPTION

    -

    Manage ownership of published packages.

    -
      -
    • ls: -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: -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: -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/partial/doc/cli/npm-pack.html b/deps/npm/html/partial/doc/cli/npm-pack.html deleted file mode 100644 index 865f14afd4683f..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-pack.html +++ /dev/null @@ -1,21 +0,0 @@ -

    npm-pack

    Create a tarball from a package

    -

    SYNOPSIS

    -
    npm pack [<pkg> [<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.

    -

    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.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-ping.html b/deps/npm/html/partial/doc/cli/npm-ping.html deleted file mode 100644 index c71423d5eee4fc..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-ping.html +++ /dev/null @@ -1,11 +0,0 @@ -

    npm-ping

    Ping npm registry

    -

    SYNOPSIS

    -
    npm ping [--registry <registry>]
    -

    DESCRIPTION

    -

    Ping the configured or given npm registry and verify authentication.

    -

    SEE ALSO

    - diff --git a/deps/npm/html/partial/doc/cli/npm-prefix.html b/deps/npm/html/partial/doc/cli/npm-prefix.html deleted file mode 100644 index bca3f6689c7b51..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-prefix.html +++ /dev/null @@ -1,18 +0,0 @@ -

    npm-prefix

    Display prefix

    -

    SYNOPSIS

    -
    npm prefix [-g]
    -

    DESCRIPTION

    -

    Print the local prefix to standard out. This is the closest parent directory -to contain a package.json file unless -g is also specified.

    -

    If -g is specified, this will be the value of the global prefix. See -npm-config(7) for more detail.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-prune.html b/deps/npm/html/partial/doc/cli/npm-prune.html deleted file mode 100644 index 8bb16677da18af..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-prune.html +++ /dev/null @@ -1,21 +0,0 @@ -

    npm-prune

    Remove extraneous packages

    -

    SYNOPSIS

    -
    npm prune [<name> [<name ...]]
    -npm prune [<name> [<name ...]] [--production]
    -

    DESCRIPTION

    -

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

    -

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

    -

    If the --production flag is specified or the NODE_ENV environment -variable is set to production, this command will remove the packages -specified in your devDependencies. Setting --production=false will -negate NODE_ENV being set to production.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-publish.html b/deps/npm/html/partial/doc/cli/npm-publish.html deleted file mode 100644 index 8d9321292a431b..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-publish.html +++ /dev/null @@ -1,46 +0,0 @@ -

    npm-publish

    Publish a package

    -

    SYNOPSIS

    -
    npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
    -npm publish <folder> [--tag <tag>] [--access <public|restricted>]
    -

    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.

    -

    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)).

    -
      -
    • <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.

      -
    • -
    • [--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.

      -
    • -
    • [--access <public|restricted>] -Tells the registry whether this package should be published as public or -restricted. Only applies to scoped packages, which default to restricted. -If you don't have a paid account, you must publish with --access public -to publish scoped packages.

      -
    • -
    -

    Fails if the package name and version combination already exists in -the specified registry.

    -

    Once a package is published with a given name and version, that -specific name and version combination can never be used again, even if -it is removed with npm-unpublish(1).

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-rebuild.html b/deps/npm/html/partial/doc/cli/npm-rebuild.html deleted file mode 100644 index b06f0705e3eaa2..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-rebuild.html +++ /dev/null @@ -1,18 +0,0 @@ -

    npm-rebuild

    Rebuild a package

    -

    SYNOPSIS

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

    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.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-repo.html b/deps/npm/html/partial/doc/cli/npm-repo.html deleted file mode 100644 index 55fcb5f4c96586..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-repo.html +++ /dev/null @@ -1,22 +0,0 @@ -

    npm-repo

    Open package repository page in the browser

    -

    SYNOPSIS

    -
    npm repo <pkgname>
    -npm repo (with no args in a package dir)
    -

    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. If no package name is provided, it will search for -a package.json in the current folder and use the name property.

    -

    CONFIGURATION

    -

    browser

    -
      -
    • Default: OS X: "open", Windows: "start", Others: "xdg-open"
    • -
    • Type: String
    • -
    -

    The browser that is called by the npm repo command to open websites.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-restart.html b/deps/npm/html/partial/doc/cli/npm-restart.html deleted file mode 100644 index 2186473373c513..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-restart.html +++ /dev/null @@ -1,33 +0,0 @@ -

    npm-restart

    Restart a package

    -

    SYNOPSIS

    -
    npm restart [-- <args>]
    -

    DESCRIPTION

    -

    This restarts a package.

    -

    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. -
    -

    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/partial/doc/cli/npm-rm.html b/deps/npm/html/partial/doc/cli/npm-rm.html deleted file mode 100644 index 24cd07eeecd8db..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-rm.html +++ /dev/null @@ -1,19 +0,0 @@ -

    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/partial/doc/cli/npm-root.html b/deps/npm/html/partial/doc/cli/npm-root.html deleted file mode 100644 index e9b5ad0df8c298..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-root.html +++ /dev/null @@ -1,15 +0,0 @@ -

    npm-root

    Display npm root

    -

    SYNOPSIS

    -
    npm root
    -

    DESCRIPTION

    -

    Print the effective node_modules folder to standard out.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-run-script.html b/deps/npm/html/partial/doc/cli/npm-run-script.html deleted file mode 100644 index e79376870e69ab..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-run-script.html +++ /dev/null @@ -1,37 +0,0 @@ -

    npm-run-script

    Run arbitrary package scripts

    -

    SYNOPSIS

    -
    npm run-script [command] [-- <args>]
    -npm run [command] [-- <args>]
    -

    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 -used by the test, start, restart, and stop commands, but can be called -directly, as well. When the scripts in the package are printed out, they're -separated into lifecycle (test, start, restart) and directly-run scripts.

    -

    As of npm@2.0.0, you can -use custom arguments when executing scripts. The special option -- is used by -getopt to delimit the end of the options. npm will pass -all the arguments after the -- directly to your script:

    -
    npm run test -- --grep="pattern"
    -

    The arguments will only be passed to the script specified after npm run -and not to any pre or post script.

    -

    The env script is a special built-in command that can be used to list -environment variables that will be available to the script at runtime. If an -"env" command is defined in your package it will take precedence over the -built-in.

    -

    In addition to the shell's pre-existing PATH, npm run adds -node_modules/.bin to the PATH provided to scripts. Any binaries provided by -locally-installed dependencies can be used without the node_modules/.bin -prefix. For example, if there is a devDependency on tap in your package, -you should write:

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

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

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-search.html b/deps/npm/html/partial/doc/cli/npm-search.html deleted file mode 100644 index ae66e47ead1cd3..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-search.html +++ /dev/null @@ -1,29 +0,0 @@ -

    npm-search

    Search for packages

    -

    SYNOPSIS

    -
    npm search [--long] [search terms ...]
    -npm s [search terms ...]
    -npm se [search terms ...]
    -

    DESCRIPTION

    -

    Search the registry for packages matching the search terms.

    -

    If a term starts with /, then it's interpreted as a regular expression. -A trailing / will be ignored in this case. (Note that many regular -expression characters must be escaped or quoted in most shells.)

    -

    CONFIGURATION

    -

    long

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

    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.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-shrinkwrap.html b/deps/npm/html/partial/doc/cli/npm-shrinkwrap.html deleted file mode 100644 index 8ac97fc3eed892..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-shrinkwrap.html +++ /dev/null @@ -1,144 +0,0 @@ -

    npm-shrinkwrap

    Lock down dependency versions

    -

    SYNOPSIS

    -
    npm shrinkwrap
    -

    DESCRIPTION

    -

    This command locks down the versions of a package's dependencies so -that you can control exactly which versions of each dependency will be -used when your package is installed. The package.json file is still -required if you want to use npm install.

    -

    By default, npm install recursively installs the target's -dependencies (as specified in package.json), choosing the latest -available version that satisfies the dependency's semver pattern. In -some situations, particularly when shipping software where each change -is tightly managed, it's desirable to fully specify each version of -each dependency recursively so that subsequent builds and deploys do -not inadvertently pick up newer versions of a dependency that satisfy -the semver pattern. Specifying specific semver patterns in each -dependency's package.json would facilitate this, but that's not always -possible or desirable, as when another author owns the npm package. -It's also possible to check dependencies directly into source control, -but that may be undesirable for other reasons.

    -

    As an example, consider package A:

    -
    {
    -  "name": "A",
    -  "version": "0.1.0",
    -  "dependencies": {
    -    "B": "<0.1.0"
    -  }
    -}
    -

    package B:

    -
    {
    -  "name": "B",
    -  "version": "0.0.1",
    -  "dependencies": {
    -    "C": "<0.1.0"
    -  }
    -}
    -

    and package C:

    -
    {
    -  "name": "C",
    -  "version": "0.0.1"
    -}
    -

    If these are the only versions of A, B, and C available in the -registry, then a normal npm install A will install:

    -
    A@0.1.0
    -`-- B@0.0.1
    -    `-- C@0.0.1
    -

    However, if B@0.0.2 is published, then a fresh npm install A will -install:

    -
    A@0.1.0
    -`-- B@0.0.2
    -    `-- C@0.0.1
    -

    assuming the new version did not modify B's dependencies. Of course, -the new version of B could include a new version of C and any number -of new dependencies. If such changes are undesirable, the author of A -could specify a dependency on B@0.0.1. However, if A's author and B's -author are not the same person, there's no way for A's author to say -that he or she does not want to pull in newly published versions of C -when B hasn't changed at all.

    -

    In this case, A's author can run

    -
    npm shrinkwrap
    -

    This generates npm-shrinkwrap.json, which will look something like this:

    -
    {
    -  "name": "A",
    -  "version": "0.1.0",
    -  "dependencies": {
    -    "B": {
    -      "version": "0.0.1",
    -      "dependencies": {
    -        "C": {
    -          "version": "0.0.1"
    -        }
    -      }
    -    }
    -  }
    -}
    -

    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.

    -

    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 -package.json file and npm install it.

    -

    Building shrinkwrapped packages

    -

    To shrinkwrap an existing package:

    -
      -
    1. Run npm install in the package root to install the current -versions of all dependencies.
    2. -
    3. Validate that the package works as expected with these versions.
    4. -
    5. Run npm shrinkwrap, add npm-shrinkwrap.json to git, and publish -your package.
    6. -
    -

    To add or update a dependency in a shrinkwrapped package:

    -
      -
    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 -shrinkwrap.
    4. -
    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. -
    -

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

    -

    Other Notes

    -

    A shrinkwrap file must be consistent with the package's package.json -file. npm shrinkwrap will fail if required dependencies are not -already installed, since that would result in a shrinkwrap that -wouldn't actually work. Similarly, the command will fail if there are -extraneous packages (not referenced by package.json), since that would -indicate that package.json is not correct.

    -

    Since npm shrinkwrap is intended to lock down your dependencies for -production use, devDependencies will not be included unless you -explicitly set the --dev flag when you run npm shrinkwrap. If -installed devDependencies are excluded, then npm will print a -warning. If you want them to be installed with your module by -default, please consider adding them to dependencies instead.

    -

    If shrinkwrapped package A depends on shrinkwrapped package B, B's -shrinkwrap will not be used as part of the installation of A. However, -because A's shrinkwrap is constructed from a valid installation of B -and recursively specifies all dependencies, the contents of B's -shrinkwrap will implicitly be included in A's shrinkwrap.

    -

    Caveats

    -

    If you wish to lock down the specific bytes included in a package, for -example to have 100% confidence in being able to reproduce a -deployment or build, then you ought to check your dependencies into -source control, or pursue some other mechanism that can verify -contents rather than versions.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-star.html b/deps/npm/html/partial/doc/cli/npm-star.html deleted file mode 100644 index 7377d9bc5ddb1e..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-star.html +++ /dev/null @@ -1,16 +0,0 @@ -

    npm-star

    Mark your favorite packages

    -

    SYNOPSIS

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

    DESCRIPTION

    -

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

    -

    "Unstarring" is the same thing, but in reverse.

    -

    It's a boolean thing. Starring repeatedly has no additional effect.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-stars.html b/deps/npm/html/partial/doc/cli/npm-stars.html deleted file mode 100644 index 6ffda95b83868d..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-stars.html +++ /dev/null @@ -1,17 +0,0 @@ -

    npm-stars

    View packages marked as favorites

    -

    SYNOPSIS

    -
    npm stars
    -npm stars [username]
    -

    DESCRIPTION

    -

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

    -

    You may also want to see your friend's favorite packages, in this case -you will most certainly enjoy this command.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-start.html b/deps/npm/html/partial/doc/cli/npm-start.html deleted file mode 100644 index bfd673ca26b5f4..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-start.html +++ /dev/null @@ -1,14 +0,0 @@ -

    npm-start

    Start a package

    -

    SYNOPSIS

    -
    npm start [-- <args>]
    -

    DESCRIPTION

    -

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

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-stop.html b/deps/npm/html/partial/doc/cli/npm-stop.html deleted file mode 100644 index 3b974c46a1e221..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-stop.html +++ /dev/null @@ -1,14 +0,0 @@ -

    npm-stop

    Stop a package

    -

    SYNOPSIS

    -
    npm stop [-- <args>]
    -

    DESCRIPTION

    -

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

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-tag.html b/deps/npm/html/partial/doc/cli/npm-tag.html deleted file mode 100644 index b12d5de7a4c62f..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-tag.html +++ /dev/null @@ -1,42 +0,0 @@ -

    npm-tag

    Tag a published version

    -

    SYNOPSIS

    -
    npm tag <name>@<version> [<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 ---tag config if not specified.

    -

    A tag can be used when installing packages as a reference to a version instead -of using a specific version number:

    -
    npm install <name>@<tag>
    -

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

    -
    npm install --tag <tag>
    -

    This also applies to npm dedupe.

    -

    Publishing a package always sets the "latest" tag to the published version.

    -

    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".

    -

    CAVEATS

    -

    Tags must share a namespace with version numbers, because they are -specified in the same slot: npm install <pkg>@<version> vs npm -install <pkg>@<tag>.

    -

    Tags that can be interpreted as valid semver ranges will be -rejected. For example, v1.4 cannot be used as a tag, because it is -interpreted by semver as >=1.4.0 <1.5.0. See -https://github.com/npm/npm/issues/6082.

    -

    The simplest way to avoid semver problems with tags is to use tags -that do not begin with a number or the letter v.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-test.html b/deps/npm/html/partial/doc/cli/npm-test.html deleted file mode 100644 index 4a48e657d92246..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-test.html +++ /dev/null @@ -1,17 +0,0 @@ -

    npm-test

    Test a package

    -

    SYNOPSIS

    -
      npm test [-- <args>]
    -  npm tst [-- <args>]
    -

    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.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-uninstall.html b/deps/npm/html/partial/doc/cli/npm-uninstall.html deleted file mode 100644 index 5b247402bdc808..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-uninstall.html +++ /dev/null @@ -1,37 +0,0 @@ -

    npm-rm

    Remove a package

    -

    SYNOPSIS

    -
    npm uninstall [@<scope>/]<package> [--save|--save-dev|--save-optional]
    -npm rm (with any of the previous argument usage)
    -

    DESCRIPTION

    -

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

    -

    Example:

    -
    npm uninstall sax
    -

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

    -

    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.

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

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

      -
    • -
    -

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

    -

    Examples:

    -
    npm uninstall sax --save
    -npm uninstall @myorg/privatepackage --save
    -npm uninstall node-tap --save-dev
    -npm uninstall dtrace-provider --save-optional
    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-unpublish.html b/deps/npm/html/partial/doc/cli/npm-unpublish.html deleted file mode 100644 index 9790cd4327452a..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-unpublish.html +++ /dev/null @@ -1,27 +0,0 @@ -

    npm-unpublish

    Remove a package from the registry

    -

    SYNOPSIS

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

    WARNING

    -

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

    -

    Consider using the deprecate command -instead, if your intent is to encourage users to upgrade.

    -

    There is plenty of room on the registry.

    -

    DESCRIPTION

    -

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

    -

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

    -

    Even if a package version is unpublished, that specific name and -version combination can never be reused. In order to publish the -package again, a new version number must be used.

    -

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

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-update.html b/deps/npm/html/partial/doc/cli/npm-update.html deleted file mode 100644 index ecc6640f21ddcd..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-update.html +++ /dev/null @@ -1,99 +0,0 @@ -

    npm-update

    Update a package

    -

    SYNOPSIS

    -
    npm update [-g] [<name> [<name> ...]]
    -

    DESCRIPTION

    -

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

    -

    It will also install missing packages. As with all commands that install -packages, the --dev flag will cause devDependencies to be processed -as well.

    -

    If the -g flag is specified, this command will update globally installed -packages.

    -

    If no package name is specified, all packages in the specified location (global -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

    -

    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"
    -  }
    -}
    -

    Caret Dependencies

    -

    If app's package.json contains:

    -
    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"
    -}
    -

    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 -to >=1.1.1 <1.2.0. So the highest-sorting version that satisfies ~1.1.1 is used, -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"
    -}
    -

    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"
    -}
    -

    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"
    -}
    -

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

    -
    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 -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 -be downgraded.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-version.html b/deps/npm/html/partial/doc/cli/npm-version.html deleted file mode 100644 index 1beda3d2884aad..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-version.html +++ /dev/null @@ -1,75 +0,0 @@ -

    npm-version

    Bump a package version

    -

    SYNOPSIS

    -
    npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
    -

    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.

    -

    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 -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:

    -
    npm version patch -m "Upgrade to %s for reasons"
    -

    If the sign-git-tag config is set, then the tag will be signed using -the -s flag to git. Note that you must have a default GPG key set up -in your git config for this to work properly. For example:

    -
    $ npm config set sign-git-tag true
    -$ npm version patch
    -
    -You need a passphrase to unlock the secret key for
    -user: "isaacs (http://blog.izs.me/) <i@izs.me>"
    -2048-bit RSA key, ID 6C481CF6, created 2010-08-31
    -
    -Enter passphrase:
    -

    If preversion, version, or postversion are in the scripts property of -the package.json, they will be executed as part of running npm version.

    -

    The exact order of execution is as follows:

    -
      -
    1. Check to make sure the git working directory is clean before we get started. -Your scripts may add files to the commit in future steps. -This step is skipped if the --force flag is set.
    2. -
    3. 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.
    4. -
    5. Bump version in package.json as requested (patch, minor, major, etc).
    6. -
    7. 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.
    8. -
    9. Commit and tag.
    10. -
    11. Run the postversion script. Use it to clean up the file system or automatically push -the commit and/or tag.
    12. -
    -

    Take the following example:

    -
    "scripts": {
    -  "preversion": "npm test",
    -  "version": "npm run build && git add -A dist",
    -  "postversion": "git push && git push --tags && rm -rf build/temp"
    -}
    -

    This runs all your tests, and proceeds only if they pass. Then runs your build script, and -adds everything in the dist directory to the commit. After the commit, it pushes the new commit -and tag up to the server, and deletes the build/temp directory.

    -

    CONFIGURATION

    -

    git-tag-version

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Commit and tag the version change.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-view.html b/deps/npm/html/partial/doc/cli/npm-view.html deleted file mode 100644 index dcd41693e7e49b..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-view.html +++ /dev/null @@ -1,62 +0,0 @@ -

    npm-view

    View registry info

    -

    SYNOPSIS

    -
    npm view [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
    -npm v [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
    -

    DESCRIPTION

    -

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

    -

    To show the package registry entry for the connect package, you can do -this:

    -
    npm view connect
    -

    The default version is "latest" if unspecified.

    -

    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 view ronn@0.3.5 dependencies
    -

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

    -
    npm view npm repository.url
    -

    This makes it easy to view information about a dependency with a bit of -shell scripting. For example, to view all the data about the version of -opts that ronn depends on, you can do this:

    -
    npm view opts@$(npm view ronn dependencies.opts)
    -

    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 view express contributors.email
    -

    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 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 -can do this:

    -
    npm view express contributors.name contributors.email
    -

    "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 package.json(5) for more on this.)

    -
    npm view npm contributors
    -

    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 view yui3@'>0.5.4' dependencies.jsdom
    -

    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 field is an object, it will be output as a JavaScript object literal.

    -

    If the --json flag is given, the outputted fields will be JSON.

    -

    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.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm-whoami.html b/deps/npm/html/partial/doc/cli/npm-whoami.html deleted file mode 100644 index a0c0dd4cd82fa4..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm-whoami.html +++ /dev/null @@ -1,13 +0,0 @@ -

    npm-whoami

    Display npm username

    -

    SYNOPSIS

    -
    npm whoami
    -

    DESCRIPTION

    -

    Print the username config to standard output.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/cli/npm.html b/deps/npm/html/partial/doc/cli/npm.html deleted file mode 100644 index 683606b8387b99..00000000000000 --- a/deps/npm/html/partial/doc/cli/npm.html +++ /dev/null @@ -1,134 +0,0 @@ -

    npm

    javascript package manager

    -

    SYNOPSIS

    -
    npm <command> [args]
    -

    VERSION

    -

    2.13.3

    -

    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 -conflicts intelligently.

    -

    It is extremely configurable to support a wide variety of use cases. -Most commonly, it is used to publish, discover, install, and develop node -programs.

    -

    Run npm help to get a list of available commands.

    -

    INTRODUCTION

    -

    You probably got npm because you want to install stuff.

    -

    Use npm install blerg to install the latest version of "blerg". Check out -npm-install(1) for more info. It can do a lot of stuff.

    -

    Use the npm search command to show everything that's available. -Use npm ls to show everything you've installed.

    -

    DEPENDENCIES

    -

    If a package references to another package with a git URL, npm depends -on a preinstalled git.

    -

    If one of the packages npm tries to install is a native node module and -requires compiling of C++ Code, npm will use -node-gyp for that task. -For a Unix system, node-gyp -needs Python, make and a buildchain like GCC. On Windows, -Python and Microsoft Visual Studio C++ is needed. Python 3 is -not supported by node-gyp. -For more information visit -the node-gyp repository and -the node-gyp Wiki.

    -

    DIRECTORIES

    -

    See npm-folders(5) to learn about where npm puts stuff.

    -

    In particular, npm has two modes of operation:

    -
      -
    • global mode:
      npm installs packages into the install prefix at -prefix/lib/node_modules and bins are installed in prefix/bin.
    • -
    • local mode:
      npm installs packages into the current project directory, which -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 -operate in global mode instead.

    -

    DEVELOPER USAGE

    -

    If you're using npm to develop and publish your code, check out the -following help topics:

    -
      -
    • json: -Make a package.json file. See package.json(5).
    • -
    • link: -For linking your current working code into Node's path, so that you -don't have to reinstall every time you make a change. Use -npm link to do this.
    • -
    • install: -It's a good idea to install things if you don't need the symbolic link. -Especially, installing other peoples code from the registry is done via -npm install
    • -
    • adduser: -Create an account or log in. Credentials are stored in the -user config file.
    • -
    • publish: -Use the npm publish command to upload your code to the registry.
    • -
    -

    CONFIGURATION

    -

    npm is extremely configurable. It reads its configuration options from -5 places.

    -
      -
    • Command line switches:
      Set a config with --key val. All keys take a value, even if they -are booleans (the config parser doesn't know what the options are at -the time of parsing.) If no value is provided, then the option is set -to boolean true.
    • -
    • Environment Variables:
      Set any config by prefixing the name in an environment variable with -npm_config_. For example, export npm_config_key=val.
    • -
    • User Configs:
      The file at $HOME/.npmrc is an ini-formatted list of configs. If -present, it is parsed. If the userconfig option is set in the cli -or env, then that will be used instead.
    • -
    • Global Configs:
      The file found at ../etc/npmrc (from the node executable, by default -this resolves to /usr/local/etc/npmrc) will be parsed if it is found. -If the globalconfig option is set in the cli, env, or user config, -then that file is parsed instead.
    • -
    • Defaults:
      npm's default configuration options are defined in -lib/utils/config-defs.js. These must not be changed.
    • -
    -

    See npm-config(7) for much much more information.

    -

    CONTRIBUTIONS

    -

    Patches welcome!

    -
      -
    • code: -Read through npm-coding-style(7) if you plan to submit code. -You don't have to agree with it, but you do have to follow it.
    • -
    • docs: -If you find an error in the documentation, edit the appropriate markdown -file in the "doc" folder. (Don't worry about generating the man page.)
    • -
    -

    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.

    - -

    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.

    -

    You can also look for isaacs in #node.js on irc://irc.freenode.net. He -will no doubt tell you to put the output in a gist or email.

    -

    AUTHOR

    -

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

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/files/npm-folders.html b/deps/npm/html/partial/doc/files/npm-folders.html deleted file mode 100644 index 08ea7ed13aa9a7..00000000000000 --- a/deps/npm/html/partial/doc/files/npm-folders.html +++ /dev/null @@ -1,164 +0,0 @@ -

    npm-folders

    Folder Structures Used by npm

    -

    DESCRIPTION

    -

    npm puts various things on your computer. That's its job.

    -

    This document will tell you what it puts where.

    -

    tl;dr

    -
      -
    • Local install (default): puts stuff in ./node_modules of the current -package root.
    • -
    • Global install (with -g): puts stuff in /usr/local or wherever node -is installed.
    • -
    • Install it locally if you're going to require() it.
    • -
    • Install it globally if you're going to run it on the command line.
    • -
    • If you need both, then install it in both places, or use npm link.
    • -
    -

    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.

    -

    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.

    -

    Node Modules

    -

    Packages are dropped into the node_modules folder under the prefix. -When installing locally, this means that you can -require("packagename") to load its main module, or -require("packagename/lib/path/to/sub/module") to load other modules.

    -

    Global installs on Unix systems go to {prefix}/lib/node_modules. -Global installs on Windows go to {prefix}/node_modules (that is, no -lib folder.)

    -

    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 -more details.

    -

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

    -

    Executables

    -

    When in global mode, executables are linked into {prefix}/bin on Unix, -or directly into {prefix} on Windows.

    -

    When in local mode, executables are linked into -./node_modules/.bin so that they can be made available to scripts run -through npm. (For example, so that a test runner will be in the path -when you run npm test.)

    -

    Man Pages

    -

    When in global mode, man pages are linked into {prefix}/share/man.

    -

    When in local mode, man pages are not installed.

    -

    Man pages are not installed on Windows systems.

    -

    Cache

    -

    See npm-cache(1). Cache files are stored in ~/.npm on Posix, or -~/npm-cache on Windows.

    -

    This is controlled by the cache configuration param.

    -

    Temp Files

    -

    Temporary files are stored by default in the folder specified by the -tmp config, which defaults to the TMPDIR, TMP, or TEMP environment -variables, or /tmp on Unix and c:\windows\temp on Windows.

    -

    Temp files are given a unique folder under this root for each run of the -program, and are deleted upon successful exit.

    -

    More Information

    -

    When installing locally, npm first tries to find an appropriate -prefix folder. This is so that npm install foo@1.2.3 will install -to the sensible root of your package, even if you happen to have cded -into some other folder.

    -

    Starting at the $PWD, npm will walk up the folder tree checking for a -folder that contains either a package.json file, or a node_modules -folder. If such a thing is found, then that is treated as the effective -"current directory" for the purpose of running npm commands. (This -behavior is inspired by and similar to git's .git-folder seeking -logic when running git commands in a working dir.)

    -

    If no package root is found, then the current folder is used.

    -

    When you run npm install foo@1.2.3, then the package is loaded into -the cache, and then unpacked into ./node_modules/foo. Then, any of -foo's dependencies are similarly unpacked into -./node_modules/foo/node_modules/....

    -

    Any bin files are symlinked to ./node_modules/.bin/, so that they may -be found by npm scripts when necessary.

    -

    Global Installation

    -

    If the global configuration is set to true, then npm will -install packages "globally".

    -

    For global installation, packages are installed roughly the same way, -but using the folders described above.

    -

    Cycles, Conflicts, and Folder Parsimony

    -

    Cycles are handled using the property of node's module system that it -walks up the directories looking for node_modules folders. So, at every -stage, if a package is already installed in an ancestor node_modules -folder, then it is not installed at the current location.

    -

    Consider the case above, where foo -> bar -> baz. Imagine if, in -addition to that, baz depended on bar, so you'd have: -foo -> bar -> baz -> bar -> baz .... However, since the folder -structure is: foo/node_modules/bar/node_modules/baz, there's no need to -put another copy of bar into .../baz/node_modules, since when it calls -require("bar"), it will get the copy that is installed in -foo/node_modules/bar.

    -

    This shortcut is only used if the exact same -version would be installed in multiple nested node_modules folders. It -is still possible to have a/node_modules/b/node_modules/a if the two -"a" packages are different versions. However, without repeating the -exact same package multiple times, an infinite regress will always be -prevented.

    -

    Another optimization can be made by installing dependencies at the -highest level possible, below the localized "target" folder.

    -

    Example

    -

    Consider this dependency graph:

    -
    foo
    -+-- blerg@1.2.5
    -+-- bar@1.2.3
    -|   +-- blerg@1.x (latest=1.3.7)
    -|   +-- baz@2.x
    -|   |   `-- quux@3.x
    -|   |       `-- bar@1.2.3 (cycle)
    -|   `-- asdf@*
    -`-- baz@1.2.3
    -    `-- quux@3.x
    -        `-- bar
    -

    In this case, we might expect a folder structure like this:

    -
    foo
    -+-- node_modules
    -    +-- blerg (1.2.5) <---[A]
    -    +-- bar (1.2.3) <---[B]
    -    |   `-- node_modules
    -    |       +-- baz (2.0.2) <---[C]
    -    |       |   `-- node_modules
    -    |       |       `-- quux (3.2.0)
    -    |       `-- asdf (2.3.4)
    -    `-- baz (1.2.3) <---[D]
    -        `-- node_modules
    -            `-- quux (3.2.0) <---[E]
    -

    Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are -installed in foo's node_modules folder.

    -

    Even though the latest copy of blerg is 1.3.7, foo has a specific -dependency on version 1.2.5. So, that gets installed at [A]. Since the -parent installation of blerg satisfies bar's dependency on blerg@1.x, -it does not install another copy under [B].

    -

    Bar [B] also has dependencies on baz and asdf, so those are installed in -bar's node_modules folder. Because it depends on baz@2.x, it cannot -re-use the baz@1.2.3 installed in the parent node_modules folder [D], -and must install its own copy [C].

    -

    Underneath bar, the baz -> quux -> bar dependency creates a cycle. -However, because bar is already in quux's ancestry [B], it does not -unpack another copy of bar into that folder.

    -

    Underneath foo -> baz [D], quux's [E] folder tree is empty, because its -dependency on bar is satisfied by the parent folder copy installed at [B].

    -

    For a graphical breakdown of what is installed where, use npm ls.

    -

    Publishing

    -

    Upon publishing, npm will look in the node_modules folder. If any of -the items there are not in the bundledDependencies array, then they will -not be included in the package tarball.

    -

    This allows a package maintainer to install all of their dependencies -(and dev dependencies) locally, but only re-publish those items that -cannot be found elsewhere. See package.json(5) for more information.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/files/npm-global.html b/deps/npm/html/partial/doc/files/npm-global.html deleted file mode 100644 index 08ea7ed13aa9a7..00000000000000 --- a/deps/npm/html/partial/doc/files/npm-global.html +++ /dev/null @@ -1,164 +0,0 @@ -

    npm-folders

    Folder Structures Used by npm

    -

    DESCRIPTION

    -

    npm puts various things on your computer. That's its job.

    -

    This document will tell you what it puts where.

    -

    tl;dr

    -
      -
    • Local install (default): puts stuff in ./node_modules of the current -package root.
    • -
    • Global install (with -g): puts stuff in /usr/local or wherever node -is installed.
    • -
    • Install it locally if you're going to require() it.
    • -
    • Install it globally if you're going to run it on the command line.
    • -
    • If you need both, then install it in both places, or use npm link.
    • -
    -

    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.

    -

    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.

    -

    Node Modules

    -

    Packages are dropped into the node_modules folder under the prefix. -When installing locally, this means that you can -require("packagename") to load its main module, or -require("packagename/lib/path/to/sub/module") to load other modules.

    -

    Global installs on Unix systems go to {prefix}/lib/node_modules. -Global installs on Windows go to {prefix}/node_modules (that is, no -lib folder.)

    -

    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 -more details.

    -

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

    -

    Executables

    -

    When in global mode, executables are linked into {prefix}/bin on Unix, -or directly into {prefix} on Windows.

    -

    When in local mode, executables are linked into -./node_modules/.bin so that they can be made available to scripts run -through npm. (For example, so that a test runner will be in the path -when you run npm test.)

    -

    Man Pages

    -

    When in global mode, man pages are linked into {prefix}/share/man.

    -

    When in local mode, man pages are not installed.

    -

    Man pages are not installed on Windows systems.

    -

    Cache

    -

    See npm-cache(1). Cache files are stored in ~/.npm on Posix, or -~/npm-cache on Windows.

    -

    This is controlled by the cache configuration param.

    -

    Temp Files

    -

    Temporary files are stored by default in the folder specified by the -tmp config, which defaults to the TMPDIR, TMP, or TEMP environment -variables, or /tmp on Unix and c:\windows\temp on Windows.

    -

    Temp files are given a unique folder under this root for each run of the -program, and are deleted upon successful exit.

    -

    More Information

    -

    When installing locally, npm first tries to find an appropriate -prefix folder. This is so that npm install foo@1.2.3 will install -to the sensible root of your package, even if you happen to have cded -into some other folder.

    -

    Starting at the $PWD, npm will walk up the folder tree checking for a -folder that contains either a package.json file, or a node_modules -folder. If such a thing is found, then that is treated as the effective -"current directory" for the purpose of running npm commands. (This -behavior is inspired by and similar to git's .git-folder seeking -logic when running git commands in a working dir.)

    -

    If no package root is found, then the current folder is used.

    -

    When you run npm install foo@1.2.3, then the package is loaded into -the cache, and then unpacked into ./node_modules/foo. Then, any of -foo's dependencies are similarly unpacked into -./node_modules/foo/node_modules/....

    -

    Any bin files are symlinked to ./node_modules/.bin/, so that they may -be found by npm scripts when necessary.

    -

    Global Installation

    -

    If the global configuration is set to true, then npm will -install packages "globally".

    -

    For global installation, packages are installed roughly the same way, -but using the folders described above.

    -

    Cycles, Conflicts, and Folder Parsimony

    -

    Cycles are handled using the property of node's module system that it -walks up the directories looking for node_modules folders. So, at every -stage, if a package is already installed in an ancestor node_modules -folder, then it is not installed at the current location.

    -

    Consider the case above, where foo -> bar -> baz. Imagine if, in -addition to that, baz depended on bar, so you'd have: -foo -> bar -> baz -> bar -> baz .... However, since the folder -structure is: foo/node_modules/bar/node_modules/baz, there's no need to -put another copy of bar into .../baz/node_modules, since when it calls -require("bar"), it will get the copy that is installed in -foo/node_modules/bar.

    -

    This shortcut is only used if the exact same -version would be installed in multiple nested node_modules folders. It -is still possible to have a/node_modules/b/node_modules/a if the two -"a" packages are different versions. However, without repeating the -exact same package multiple times, an infinite regress will always be -prevented.

    -

    Another optimization can be made by installing dependencies at the -highest level possible, below the localized "target" folder.

    -

    Example

    -

    Consider this dependency graph:

    -
    foo
    -+-- blerg@1.2.5
    -+-- bar@1.2.3
    -|   +-- blerg@1.x (latest=1.3.7)
    -|   +-- baz@2.x
    -|   |   `-- quux@3.x
    -|   |       `-- bar@1.2.3 (cycle)
    -|   `-- asdf@*
    -`-- baz@1.2.3
    -    `-- quux@3.x
    -        `-- bar
    -

    In this case, we might expect a folder structure like this:

    -
    foo
    -+-- node_modules
    -    +-- blerg (1.2.5) <---[A]
    -    +-- bar (1.2.3) <---[B]
    -    |   `-- node_modules
    -    |       +-- baz (2.0.2) <---[C]
    -    |       |   `-- node_modules
    -    |       |       `-- quux (3.2.0)
    -    |       `-- asdf (2.3.4)
    -    `-- baz (1.2.3) <---[D]
    -        `-- node_modules
    -            `-- quux (3.2.0) <---[E]
    -

    Since foo depends directly on bar@1.2.3 and baz@1.2.3, those are -installed in foo's node_modules folder.

    -

    Even though the latest copy of blerg is 1.3.7, foo has a specific -dependency on version 1.2.5. So, that gets installed at [A]. Since the -parent installation of blerg satisfies bar's dependency on blerg@1.x, -it does not install another copy under [B].

    -

    Bar [B] also has dependencies on baz and asdf, so those are installed in -bar's node_modules folder. Because it depends on baz@2.x, it cannot -re-use the baz@1.2.3 installed in the parent node_modules folder [D], -and must install its own copy [C].

    -

    Underneath bar, the baz -> quux -> bar dependency creates a cycle. -However, because bar is already in quux's ancestry [B], it does not -unpack another copy of bar into that folder.

    -

    Underneath foo -> baz [D], quux's [E] folder tree is empty, because its -dependency on bar is satisfied by the parent folder copy installed at [B].

    -

    For a graphical breakdown of what is installed where, use npm ls.

    -

    Publishing

    -

    Upon publishing, npm will look in the node_modules folder. If any of -the items there are not in the bundledDependencies array, then they will -not be included in the package tarball.

    -

    This allows a package maintainer to install all of their dependencies -(and dev dependencies) locally, but only re-publish those items that -cannot be found elsewhere. See package.json(5) for more information.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/files/npm-json.html b/deps/npm/html/partial/doc/files/npm-json.html deleted file mode 100644 index b2e54ba742ed95..00000000000000 --- a/deps/npm/html/partial/doc/files/npm-json.html +++ /dev/null @@ -1,545 +0,0 @@ -

    package.json

    Specifics of npm's package.json handling

    -

    DESCRIPTION

    -

    This document is all you need to know about what's required in your package.json -file. It must be actual JSON, not just a JavaScript object literal.

    -

    A lot of the behavior described in this document is affected by the config -settings described in npm-config(7).

    -

    name

    -

    The most important things in your package.json are the name and version fields. -Those are actually required, and your package won't install without -them. The name and version together form an identifier that is assumed -to be completely unique. Changes to the package should come along with -changes to the version.

    -

    The name is what your thing is called.

    -

    Some rules:

    -
      -
    • The name must be shorter than 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.
    • -
    • The name ends up being part of a URL, an argument on the command line, and a -folder name. Therefore, the name can't contain any non-URL-safe characters.
    • -
    -

    Some tips:

    -
      -
    • Don't use the same name as a core Node module.
    • -
    • Don't put "js" or "node" in the name. It's assumed that it's js, since you're -writing a package.json file, and you can specify the engine using the "engines" -field. (See below.)
    • -
    • The name will probably be passed as an argument to require(), so it should -be something short, but also reasonably descriptive.
    • -
    • You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it. https://www.npmjs.com/
    • -
    -

    A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See -npm-scope(7) for more detail.

    -

    version

    -

    The most important things in your package.json are the name and version fields. -Those are actually required, and your package won't install without -them. The name and version together form an identifier that is assumed -to be completely unique. Changes to the package should come along with -changes to the version.

    -

    Version must be parseable by -node-semver, which is bundled -with npm as a dependency. (npm install semver to use it yourself.)

    -

    More on version numbers and ranges at semver(7).

    -

    description

    -

    Put a description in it. It's a string. This helps people discover your -package, as it's listed in npm search.

    -

    keywords

    -

    Put keywords in it. It's an array of strings. This helps people -discover your package as it's listed in npm search.

    -

    homepage

    -

    The url to the project homepage.

    -

    NOTE: This is not the same as "url". If you put a "url" field, -then the registry will think it's a redirection to your package that has -been published somewhere else, and spit at you.

    -

    Literally. Spit. I'm so not kidding.

    -

    bugs

    -

    The url to your project's issue tracker and / or the email address to which -issues should be reported. These are helpful for people who encounter issues -with your package.

    -

    It should look like this:

    -
    { "url" : "https://github.com/owner/project/issues"
    -, "email" : "project@hostname.com"
    -}
    -

    You can specify either one or both values. If you want to provide only a url, -you can specify the value for "bugs" as a simple string instead of an object.

    -

    If a url is provided, it will be used by the npm bugs command.

    -

    license

    -

    You should specify a license for your package so that people know how they are -permitted to use it, and any restrictions you're placing on it.

    -

    If you're using a common license such as BSD-2-Clause or MIT, add a -current SPDX license identifier for the license you're using, like this:

    -
    { "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 -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:

    -
    { "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 -array of license objects:

    -
    // Not valid metadata
    -{ "license" :
    -  { "type" : "ISC"
    -  , "url" : "http://opensource.org/licenses/ISC"
    -  }
    -}
    -
    -// Not valid metadata
    -{ "licenses" :
    -  [
    -    { "type": "MIT"
    -    , "url": "http://www.opensource.org/licenses/mit-license.php"
    -    }
    -  , { "type": "Apache-2.0"
    -    , "url": "http://opensource.org/licenses/apache2.0.php"
    -    }
    -  ]
    -}
    -

    Those styles are now deprecated. Instead, use SPDX expressions, like this:

    -
    { "license": "ISC" }
    -
    -{ "license": "(MIT OR Apache-2.0)" }
    -

    Finally, if you do not wish to grant others the right to use a private or -unpublished package under any terms:

    -
    { "license": "UNLICENSED"}
    -

    Consider also setting "private": true to prevent accidental publication.

    -

    people fields: author, contributors

    -

    The "author" is one person. "contributors" is an array of people. A "person" -is an object with a "name" field and optionally "url" and "email", like this:

    -
    { "name" : "Barney Rubble"
    -, "email" : "b@rubble.com"
    -, "url" : "http://barnyrubble.tumblr.com/"
    -}
    -

    Or you can shorten that all into a single string, and npm will parse it for you:

    -
    "Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)"
    -

    Both email and url are optional either way.

    -

    npm also sets a top-level "maintainers" field with your npm user info.

    -

    files

    -

    The "files" field is an array of files to include in your project. If -you name a folder in the array, then it will also include the files -inside that folder. (Unless they would be ignored by another rule.)

    -

    You can also provide a ".npmignore" file in the root of your package, -which will keep files from being included, even if they would be picked -up by the files array. The ".npmignore" file works just like a -".gitignore".

    -

    Certain files are always included, regardless of settings:

    -
      -
    • package.json
    • -
    • README (and its variants)
    • -
    • CHANGELOG (and its variants)
    • -
    • LICENSE / LICENCE
    • -
    -

    Conversely, some files are always ignored:

    -
      -
    • .git
    • -
    • CVS
    • -
    • .svn
    • -
    • .hg
    • -
    • .lock-wscript
    • -
    • .wafpickle-N
    • -
    • *.swp
    • -
    • .DS_Store
    • -
    • ._*
    • -
    • npm-debug.log
    • -
    -

    main

    -

    The main field is a module ID that is the primary entry point to your program. -That is, if your package is named foo, and a user installs it, and then does -require("foo"), then your main module's exports object will be returned.

    -

    This should be a module ID relative to the root of your package folder.

    -

    For most modules, it makes the most sense to have a main script and often not -much else.

    -

    bin

    -

    A lot of packages have one or more executable files that they'd like to -install into the PATH. npm makes this pretty easy (in fact, it uses this -feature to install the "npm" executable.)

    -

    To use this, supply a bin field in your package.json which is a map of -command name to local file name. On install, npm will symlink that file into -prefix/bin for global installs, or ./node_modules/.bin/ for local -installs.

    -

    For example, myapp could have this:

    -
    { "bin" : { "myapp" : "./cli.js" } }
    -

    So, when you install myapp, it'll create a symlink from the cli.js script to -/usr/local/bin/myapp.

    -

    If you have a single executable, and its name should be the name -of the package, then you can just supply it as a string. For example:

    -
    { "name": "my-program"
    -, "version": "1.2.5"
    -, "bin": "./path/to/program" }
    -

    would be the same as this:

    -
    { "name": "my-program"
    -, "version": "1.2.5"
    -, "bin" : { "my-program" : "./path/to/program" } }
    -

    man

    -

    Specify either a single file or an array of filenames to put in place for the -man program to find.

    -

    If only a single file is provided, then it's installed such that it is the -result from man <pkgname>, regardless of its actual filename. For example:

    -
    { "name" : "foo"
    -, "version" : "1.2.3"
    -, "description" : "A packaged foo fooer for fooing foos"
    -, "main" : "foo.js"
    -, "man" : "./man/doc.1"
    -}
    -

    would link the ./man/doc.1 file in such that it is the target for man foo

    -

    If the filename doesn't start with the package name, then it's prefixed. -So, this:

    -
    { "name" : "foo"
    -, "version" : "1.2.3"
    -, "description" : "A packaged foo fooer for fooing foos"
    -, "main" : "foo.js"
    -, "man" : [ "./man/foo.1", "./man/bar.1" ]
    -}
    -

    will create files to do man foo and man foo-bar.

    -

    Man files must end with a number, and optionally a .gz suffix if they are -compressed. The number dictates which man section the file is installed into.

    -
    { "name" : "foo"
    -, "version" : "1.2.3"
    -, "description" : "A packaged foo fooer for fooing foos"
    -, "main" : "foo.js"
    -, "man" : [ "./man/foo.1", "./man/foo.2" ]
    -}
    -

    will create entries for man foo and man 2 foo

    -

    directories

    -

    The CommonJS Packages spec details a -few ways that you can indicate the structure of your package using a directories -object. If you look at npm's package.json, -you'll see that it has directories for doc, lib, and man.

    -

    In the future, this information may be used in other creative ways.

    -

    directories.lib

    -

    Tell people where the bulk of your library is. Nothing special is done -with the lib folder in any way, but it's useful meta info.

    -

    directories.bin

    -

    If you specify a bin directory in directories.bin, all the files in -that folder will be added.

    -

    Because of the way the bin directive works, specifying both a -bin path and setting directories.bin is an error. If you want to -specify individual files, use bin, and for all the files in an -existing bin directory, use directories.bin.

    -

    directories.man

    -

    A folder that is full of man pages. Sugar to generate a "man" array by -walking the folder.

    -

    directories.doc

    -

    Put markdown files in here. Eventually, these will be displayed nicely, -maybe, someday.

    -

    directories.example

    -

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

    -

    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 -command will be able to find you.

    -

    Do it like this:

    -
    "repository" :
    -  { "type" : "git"
    -  , "url" : "https://github.com/npm/npm.git"
    -  }
    -
    -"repository" :
    -  { "type" : "svn"
    -  , "url" : "https://v8.googlecode.com/svn/trunk/"
    -  }
    -

    The URL should be a publicly available (perhaps read-only) url that can be handed -directly to a VCS program without any modification. It should not be a url to an -html project page that you put in your browser. It's for computers.

    -

    For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same -shortcut syntax you use for npm install:

    -
    "repository": "npm/npm"
    -
    -"repository": "gist:11081aaa281"
    -
    -"repository": "bitbucket:example/repo"
    -
    -"repository": "gitlab:another/repo"
    -

    scripts

    -

    The "scripts" property is a dictionary containing script commands that are run -at various times in the lifecycle of your package. The key is the lifecycle -event, and the value is the command to run at that point.

    -

    See npm-scripts(7) to find out more about writing package scripts.

    -

    config

    -

    A "config" object can be used to set configuration parameters used in package -scripts that persist across upgrades. For instance, if a package had the -following:

    -
    { "name" : "foo"
    -, "config" : { "port" : "8080" } }
    -

    and then had a "start" command that then referenced the -npm_package_config_port environment variable, then the user could -override that by doing npm config set foo:port 8001.

    -

    See npm-config(7) and npm-scripts(7) for more on package -configs.

    -

    dependencies

    -

    Dependencies are specified in a simple object that maps a package name to a -version range. The version range is a string which has one or more -space-separated descriptors. Dependencies can also be identified with a -tarball or git URL.

    -

    Please do not put test harnesses or transpilers in your -dependencies object. See devDependencies, below.

    -

    See semver(7) for more details about specifying version ranges.

    -
      -
    • version Must match version exactly
    • -
    • >version Must be greater than version
    • -
    • >=version etc
    • -
    • <version
    • -
    • <=version
    • -
    • ~version "Approximately equivalent to version" See semver(7)
    • -
    • ^version "Compatible with version" See semver(7)
    • -
    • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
    • -
    • http://... See 'URLs as Dependencies' below
    • -
    • * Matches any version
    • -
    • "" (just an empty string) Same as *
    • -
    • version1 - version2 Same as >=version1 <=version2.
    • -
    • range1 || range2 Passes if either range1 or range2 are satisfied.
    • -
    • 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
    • -
    -

    For example, these are all valid:

    -
    { "dependencies" :
    -  { "foo" : "1.0.0 - 2.9999.9999"
    -  , "bar" : ">=1.0.2 <2.1.2"
    -  , "baz" : ">1.0.2 <=2.3.4"
    -  , "boo" : "2.0.1"
    -  , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
    -  , "asd" : "http://asdf.com/asdf.tar.gz"
    -  , "til" : "~1.2"
    -  , "elf" : "~1.2.3"
    -  , "two" : "2.x"
    -  , "thr" : "3.3.x"
    -  , "lat" : "latest"
    -  , "dyl" : "file:../dyl"
    -  }
    -}
    -

    URLs as Dependencies

    -

    You may specify a tarball URL in place of a version range.

    -

    This tarball will be downloaded and installed locally to your package at -install time.

    -

    Git URLs as Dependencies

    -

    Git urls can be of the form:

    -
    git://github.com/user/project.git#commit-ish
    -git+ssh://user@hostname: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.

    -

    GitHub URLs

    -

    As of version 1.1.65, you can refer to GitHub urls as just "foo": -"user/foo-project". Just as with git URLs, a commit-ish suffix can be -included. For example:

    -
    {
    -  "name": "foo",
    -  "version": "0.0.0",
    -  "dependencies": {
    -    "express": "visionmedia/express",
    -    "mocha": "visionmedia/mocha#4727d357ea"
    -  }
    -}
    -

    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:

    -
    ../foo/bar
    -~/foo/bar
    -./foo/bar
    -/foo/bar
    -

    in which case they will be normalized to a relative path and added to your -package.json. For example:

    -
    {
    -  "name": "baz",
    -  "dependencies": {
    -    "bar": "file:../foo/bar"
    -  }
    -}
    -

    This feature is helpful for local offline development and creating -tests that require npm installing where you don't want to hit an -external server, but should not be used when publishing packages -to the public registry.

    -

    devDependencies

    -

    If someone is planning on downloading and using your module in their -program, then they probably don't want or need to download and build -the external test or documentation framework that you use.

    -

    In this case, it's best to map these additional items in a devDependencies -object.

    -

    These things will be installed when doing npm link or npm install -from the root of a package, and can be managed like any other npm -configuration param. See npm-config(7) for more on the topic.

    -

    For build steps that are not platform-specific, such as compiling -CoffeeScript or other languages to JavaScript, use the prepublish -script to do this, and make the required package a devDependency.

    -

    For example:

    -
    { "name": "ethopia-waza",
    -  "description": "a delightfully fruity coffee varietal",
    -  "version": "1.2.3",
    -  "devDependencies": {
    -    "coffee-script": "~1.6.3"
    -  },
    -  "scripts": {
    -    "prepublish": "coffee -o lib/ -c src/waza.coffee"
    -  },
    -  "main": "lib/waza.js"
    -}
    -

    The prepublish script will be run before publishing, so that users -can consume the functionality without requiring them to compile it -themselves. In dev mode (ie, locally running npm install), it'll -run this script as well, so that you can test it easily.

    -

    peerDependencies

    -

    In some cases, you want to express the compatibility of your package with a -host tool or library, while not necessarily doing a require of this host. -This is usually referred to as a plugin. Notably, your module may be exposing -a specific interface, expected and specified by the host documentation.

    -

    For example:

    -
    {
    -  "name": "tea-latte",
    -  "version": "1.3.5",
    -  "peerDependencies": {
    -    "tea": "2.x"
    -  }
    -}
    -

    This ensures your package tea-latte can be installed along with the second -major version of the host package tea only. npm install tea-latte could -possibly yield the following dependency graph:

    -
    ├── tea-latte@1.3.5
    -└── tea@2.2.0
    -

    NOTE: npm versions 1 and 2 will automatically install peerDependencies if -they are not explicitly depended upon higher in the dependency tree. In the -next major version of npm (npm@3), this will no longer be the case. You will -receive a warning that the peerDependency is not installed instead. The -behavior in npms 1 & 2 was frequently confusing and could easily put you into -dependency hell, a situation that npm is designed to avoid as much as possible.

    -

    Trying to install another plugin with a conflicting requirement will cause an -error. For this reason, make sure your plugin requirement is as broad as -possible, and not to lock it down to specific patch versions.

    -

    Assuming the host complies with semver, only changes in -the host package's major version will break your plugin. Thus, if you've worked -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.

    -

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

    -

    optionalDependencies

    -

    If a dependency can be used, but you would like npm to proceed if it cannot be -found or fails to install, then you may put it in the optionalDependencies -object. This is a map of package name to version or url, just like the -dependencies object. The difference is that build failures do not cause -installation to fail.

    -

    It is still your program's responsibility to handle the lack of the -dependency. For example, something like this:

    -
    try {
    -  var foo = require('foo')
    -  var fooVersion = require('foo/package.json').version
    -} catch (er) {
    -  foo = null
    -}
    -if ( notGoodFooVersion(fooVersion) ) {
    -  foo = null
    -}
    -
    -// .. then later in your program ..
    -
    -if (foo) {
    -  foo.doFooThings()
    -}
    -

    Entries in optionalDependencies will override entries of the same name in -dependencies, so it's usually best to only put in one place.

    -

    engines

    -

    You can specify the version of node that your stuff works on:

    -
    { "engines" : { "node" : ">=0.10.3 <0.12" } }
    -

    And, like with dependencies, if you don't specify the version (or if you -specify "*" as the version), then any version of node will do.

    -

    If you specify an "engines" field, then npm will require that "node" be -somewhere on that list. If "engines" is omitted, then npm will just assume -that it works on node.

    -

    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.

    -

    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.

    -

    os

    -

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

    -
    "os" : [ "darwin", "linux" ]
    -

    You can also blacklist instead of whitelist operating systems, -just prepend the blacklisted os with a '!':

    -
    "os" : [ "!win32" ]
    -

    The host operating system is determined by process.platform

    -

    It is allowed to both blacklist, and whitelist, although there isn't any -good reason to do this.

    -

    cpu

    -

    If your code only runs on certain cpu architectures, -you can specify which ones.

    -
    "cpu" : [ "x64", "ia32" ]
    -

    Like the os option, you can also blacklist architectures:

    -
    "cpu" : [ "!arm", "!mips" ]
    -

    The host architecture is determined by process.arch

    -

    preferGlobal

    -

    If your package is primarily a command-line application that should be -installed globally, then set this value to true to provide a warning -if it is installed locally.

    -

    It doesn't actually prevent users from installing it locally, but it -does help prevent some confusion if it doesn't work as expected.

    -

    private

    -

    If you set "private": true in your package.json, then npm will refuse -to publish it.

    -

    This is a way to prevent accidental publication of private repositories. If -you would like to ensure that a given package is only ever published to a -specific registry (for example, an internal registry), then use the -publishConfig dictionary described below to override the registry config -param at publish-time.

    -

    publishConfig

    -

    This is a set of config values that will be used at publish-time. It's -especially handy if you want to set the tag, registry or access, so that -you can ensure that a given package is not tagged with "latest", published -to the global public registry or that a scoped module is private by default.

    -

    Any config values can be overridden, but of course only "tag", "registry" and -"access" probably matter for the purposes of publishing.

    -

    See npm-config(7) to see the list of config options that can be -overridden.

    -

    DEFAULT VALUES

    -

    npm will default some values based on package contents.

    -
      -
    • "scripts": {"start": "node server.js"}

      -

      If there is a server.js file in the root of your package, then npm -will default the start command to node server.js.

      -
    • -
    • "scripts":{"preinstall": "node-gyp rebuild"}

      -

      If there is a binding.gyp file in the root of your package, npm will -default the preinstall command to compile using node-gyp.

      -
    • -
    • "contributors": [...]

      -

      If there is an AUTHORS file in the root of your package, npm will -treat each line as a Name <email> (url) format, where email and url -are optional. Lines which start with a # or are blank, will be -ignored.

      -
    • -
    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/files/npmrc.html b/deps/npm/html/partial/doc/files/npmrc.html deleted file mode 100644 index ed1eb0295fa5e3..00000000000000 --- a/deps/npm/html/partial/doc/files/npmrc.html +++ /dev/null @@ -1,63 +0,0 @@ -

    npmrc

    The npm config files

    -

    DESCRIPTION

    -

    npm gets its config settings from the command line, environment -variables, and npmrc files.

    -

    The npm config command can be used to update and edit the contents -of the user and global npmrc files.

    -

    For a list of available configuration options, see npm-config(7).

    -

    FILES

    -

    The four relevant files are:

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

    All npm config files are an ini-formatted list of key = value -parameters. Environment variables can be replaced using -${VARIABLE_NAME}. For example:

    -
    prefix = ${HOME}/.npm-packages
    -

    Each of these files is loaded, and config options are resolved in -priority order. For example, a setting in the userconfig file would -override the setting in the globalconfig file.

    -

    Array values are specified by adding "[]" after the key name. For -example:

    -
    key[] = "first value"
    -key[] = "second value"
    -

    NOTE: Because local (per-project or per-user) .npmrc files can contain -sensitive credentials, they must be readable and writable only by your user -account (i.e. must have a mode of 0600), otherwise they will be ignored by -npm!

    -

    Per-project config file

    -

    When working locally in a project, a .npmrc file in the root of the -project (ie, a sibling of node_modules and package.json) will set -config values specific to this project.

    -

    Note that this only applies to the root of the project that you're -running npm in. It has no effect when your module is published. For -example, you can't publish a module that forces itself to install -globally, or in a different location.

    -

    Additionally, this file is not read in global mode, such as when running -npm install -g.

    -

    Per-user config file

    -

    $HOME/.npmrc (or the userconfig param, if set in the environment -or on the command line)

    -

    Global config file

    -

    $PREFIX/etc/npmrc (or the globalconfig param, if set above): -This file is an ini-file formatted list of key = value parameters. -Environment variables can be replaced as above.

    -

    Built-in config file

    -

    path/to/npm/itself/npmrc

    -

    This is an unchangeable "builtin" configuration file that npm keeps -consistent across updates. Set fields in here using the ./configure -script that comes with npm. This is primarily for distribution -maintainers to override default configs in a standard and consistent -manner.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/files/package.json.html b/deps/npm/html/partial/doc/files/package.json.html deleted file mode 100644 index b2e54ba742ed95..00000000000000 --- a/deps/npm/html/partial/doc/files/package.json.html +++ /dev/null @@ -1,545 +0,0 @@ -

    package.json

    Specifics of npm's package.json handling

    -

    DESCRIPTION

    -

    This document is all you need to know about what's required in your package.json -file. It must be actual JSON, not just a JavaScript object literal.

    -

    A lot of the behavior described in this document is affected by the config -settings described in npm-config(7).

    -

    name

    -

    The most important things in your package.json are the name and version fields. -Those are actually required, and your package won't install without -them. The name and version together form an identifier that is assumed -to be completely unique. Changes to the package should come along with -changes to the version.

    -

    The name is what your thing is called.

    -

    Some rules:

    -
      -
    • The name must be shorter than 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.
    • -
    • The name ends up being part of a URL, an argument on the command line, and a -folder name. Therefore, the name can't contain any non-URL-safe characters.
    • -
    -

    Some tips:

    -
      -
    • Don't use the same name as a core Node module.
    • -
    • Don't put "js" or "node" in the name. It's assumed that it's js, since you're -writing a package.json file, and you can specify the engine using the "engines" -field. (See below.)
    • -
    • The name will probably be passed as an argument to require(), so it should -be something short, but also reasonably descriptive.
    • -
    • You may want to check the npm registry to see if there's something by that name -already, before you get too attached to it. https://www.npmjs.com/
    • -
    -

    A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See -npm-scope(7) for more detail.

    -

    version

    -

    The most important things in your package.json are the name and version fields. -Those are actually required, and your package won't install without -them. The name and version together form an identifier that is assumed -to be completely unique. Changes to the package should come along with -changes to the version.

    -

    Version must be parseable by -node-semver, which is bundled -with npm as a dependency. (npm install semver to use it yourself.)

    -

    More on version numbers and ranges at semver(7).

    -

    description

    -

    Put a description in it. It's a string. This helps people discover your -package, as it's listed in npm search.

    -

    keywords

    -

    Put keywords in it. It's an array of strings. This helps people -discover your package as it's listed in npm search.

    -

    homepage

    -

    The url to the project homepage.

    -

    NOTE: This is not the same as "url". If you put a "url" field, -then the registry will think it's a redirection to your package that has -been published somewhere else, and spit at you.

    -

    Literally. Spit. I'm so not kidding.

    -

    bugs

    -

    The url to your project's issue tracker and / or the email address to which -issues should be reported. These are helpful for people who encounter issues -with your package.

    -

    It should look like this:

    -
    { "url" : "https://github.com/owner/project/issues"
    -, "email" : "project@hostname.com"
    -}
    -

    You can specify either one or both values. If you want to provide only a url, -you can specify the value for "bugs" as a simple string instead of an object.

    -

    If a url is provided, it will be used by the npm bugs command.

    -

    license

    -

    You should specify a license for your package so that people know how they are -permitted to use it, and any restrictions you're placing on it.

    -

    If you're using a common license such as BSD-2-Clause or MIT, add a -current SPDX license identifier for the license you're using, like this:

    -
    { "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 -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:

    -
    { "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 -array of license objects:

    -
    // Not valid metadata
    -{ "license" :
    -  { "type" : "ISC"
    -  , "url" : "http://opensource.org/licenses/ISC"
    -  }
    -}
    -
    -// Not valid metadata
    -{ "licenses" :
    -  [
    -    { "type": "MIT"
    -    , "url": "http://www.opensource.org/licenses/mit-license.php"
    -    }
    -  , { "type": "Apache-2.0"
    -    , "url": "http://opensource.org/licenses/apache2.0.php"
    -    }
    -  ]
    -}
    -

    Those styles are now deprecated. Instead, use SPDX expressions, like this:

    -
    { "license": "ISC" }
    -
    -{ "license": "(MIT OR Apache-2.0)" }
    -

    Finally, if you do not wish to grant others the right to use a private or -unpublished package under any terms:

    -
    { "license": "UNLICENSED"}
    -

    Consider also setting "private": true to prevent accidental publication.

    -

    people fields: author, contributors

    -

    The "author" is one person. "contributors" is an array of people. A "person" -is an object with a "name" field and optionally "url" and "email", like this:

    -
    { "name" : "Barney Rubble"
    -, "email" : "b@rubble.com"
    -, "url" : "http://barnyrubble.tumblr.com/"
    -}
    -

    Or you can shorten that all into a single string, and npm will parse it for you:

    -
    "Barney Rubble <b@rubble.com> (http://barnyrubble.tumblr.com/)"
    -

    Both email and url are optional either way.

    -

    npm also sets a top-level "maintainers" field with your npm user info.

    -

    files

    -

    The "files" field is an array of files to include in your project. If -you name a folder in the array, then it will also include the files -inside that folder. (Unless they would be ignored by another rule.)

    -

    You can also provide a ".npmignore" file in the root of your package, -which will keep files from being included, even if they would be picked -up by the files array. The ".npmignore" file works just like a -".gitignore".

    -

    Certain files are always included, regardless of settings:

    -
      -
    • package.json
    • -
    • README (and its variants)
    • -
    • CHANGELOG (and its variants)
    • -
    • LICENSE / LICENCE
    • -
    -

    Conversely, some files are always ignored:

    -
      -
    • .git
    • -
    • CVS
    • -
    • .svn
    • -
    • .hg
    • -
    • .lock-wscript
    • -
    • .wafpickle-N
    • -
    • *.swp
    • -
    • .DS_Store
    • -
    • ._*
    • -
    • npm-debug.log
    • -
    -

    main

    -

    The main field is a module ID that is the primary entry point to your program. -That is, if your package is named foo, and a user installs it, and then does -require("foo"), then your main module's exports object will be returned.

    -

    This should be a module ID relative to the root of your package folder.

    -

    For most modules, it makes the most sense to have a main script and often not -much else.

    -

    bin

    -

    A lot of packages have one or more executable files that they'd like to -install into the PATH. npm makes this pretty easy (in fact, it uses this -feature to install the "npm" executable.)

    -

    To use this, supply a bin field in your package.json which is a map of -command name to local file name. On install, npm will symlink that file into -prefix/bin for global installs, or ./node_modules/.bin/ for local -installs.

    -

    For example, myapp could have this:

    -
    { "bin" : { "myapp" : "./cli.js" } }
    -

    So, when you install myapp, it'll create a symlink from the cli.js script to -/usr/local/bin/myapp.

    -

    If you have a single executable, and its name should be the name -of the package, then you can just supply it as a string. For example:

    -
    { "name": "my-program"
    -, "version": "1.2.5"
    -, "bin": "./path/to/program" }
    -

    would be the same as this:

    -
    { "name": "my-program"
    -, "version": "1.2.5"
    -, "bin" : { "my-program" : "./path/to/program" } }
    -

    man

    -

    Specify either a single file or an array of filenames to put in place for the -man program to find.

    -

    If only a single file is provided, then it's installed such that it is the -result from man <pkgname>, regardless of its actual filename. For example:

    -
    { "name" : "foo"
    -, "version" : "1.2.3"
    -, "description" : "A packaged foo fooer for fooing foos"
    -, "main" : "foo.js"
    -, "man" : "./man/doc.1"
    -}
    -

    would link the ./man/doc.1 file in such that it is the target for man foo

    -

    If the filename doesn't start with the package name, then it's prefixed. -So, this:

    -
    { "name" : "foo"
    -, "version" : "1.2.3"
    -, "description" : "A packaged foo fooer for fooing foos"
    -, "main" : "foo.js"
    -, "man" : [ "./man/foo.1", "./man/bar.1" ]
    -}
    -

    will create files to do man foo and man foo-bar.

    -

    Man files must end with a number, and optionally a .gz suffix if they are -compressed. The number dictates which man section the file is installed into.

    -
    { "name" : "foo"
    -, "version" : "1.2.3"
    -, "description" : "A packaged foo fooer for fooing foos"
    -, "main" : "foo.js"
    -, "man" : [ "./man/foo.1", "./man/foo.2" ]
    -}
    -

    will create entries for man foo and man 2 foo

    -

    directories

    -

    The CommonJS Packages spec details a -few ways that you can indicate the structure of your package using a directories -object. If you look at npm's package.json, -you'll see that it has directories for doc, lib, and man.

    -

    In the future, this information may be used in other creative ways.

    -

    directories.lib

    -

    Tell people where the bulk of your library is. Nothing special is done -with the lib folder in any way, but it's useful meta info.

    -

    directories.bin

    -

    If you specify a bin directory in directories.bin, all the files in -that folder will be added.

    -

    Because of the way the bin directive works, specifying both a -bin path and setting directories.bin is an error. If you want to -specify individual files, use bin, and for all the files in an -existing bin directory, use directories.bin.

    -

    directories.man

    -

    A folder that is full of man pages. Sugar to generate a "man" array by -walking the folder.

    -

    directories.doc

    -

    Put markdown files in here. Eventually, these will be displayed nicely, -maybe, someday.

    -

    directories.example

    -

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

    -

    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 -command will be able to find you.

    -

    Do it like this:

    -
    "repository" :
    -  { "type" : "git"
    -  , "url" : "https://github.com/npm/npm.git"
    -  }
    -
    -"repository" :
    -  { "type" : "svn"
    -  , "url" : "https://v8.googlecode.com/svn/trunk/"
    -  }
    -

    The URL should be a publicly available (perhaps read-only) url that can be handed -directly to a VCS program without any modification. It should not be a url to an -html project page that you put in your browser. It's for computers.

    -

    For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same -shortcut syntax you use for npm install:

    -
    "repository": "npm/npm"
    -
    -"repository": "gist:11081aaa281"
    -
    -"repository": "bitbucket:example/repo"
    -
    -"repository": "gitlab:another/repo"
    -

    scripts

    -

    The "scripts" property is a dictionary containing script commands that are run -at various times in the lifecycle of your package. The key is the lifecycle -event, and the value is the command to run at that point.

    -

    See npm-scripts(7) to find out more about writing package scripts.

    -

    config

    -

    A "config" object can be used to set configuration parameters used in package -scripts that persist across upgrades. For instance, if a package had the -following:

    -
    { "name" : "foo"
    -, "config" : { "port" : "8080" } }
    -

    and then had a "start" command that then referenced the -npm_package_config_port environment variable, then the user could -override that by doing npm config set foo:port 8001.

    -

    See npm-config(7) and npm-scripts(7) for more on package -configs.

    -

    dependencies

    -

    Dependencies are specified in a simple object that maps a package name to a -version range. The version range is a string which has one or more -space-separated descriptors. Dependencies can also be identified with a -tarball or git URL.

    -

    Please do not put test harnesses or transpilers in your -dependencies object. See devDependencies, below.

    -

    See semver(7) for more details about specifying version ranges.

    -
      -
    • version Must match version exactly
    • -
    • >version Must be greater than version
    • -
    • >=version etc
    • -
    • <version
    • -
    • <=version
    • -
    • ~version "Approximately equivalent to version" See semver(7)
    • -
    • ^version "Compatible with version" See semver(7)
    • -
    • 1.2.x 1.2.0, 1.2.1, etc., but not 1.3.0
    • -
    • http://... See 'URLs as Dependencies' below
    • -
    • * Matches any version
    • -
    • "" (just an empty string) Same as *
    • -
    • version1 - version2 Same as >=version1 <=version2.
    • -
    • range1 || range2 Passes if either range1 or range2 are satisfied.
    • -
    • 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
    • -
    -

    For example, these are all valid:

    -
    { "dependencies" :
    -  { "foo" : "1.0.0 - 2.9999.9999"
    -  , "bar" : ">=1.0.2 <2.1.2"
    -  , "baz" : ">1.0.2 <=2.3.4"
    -  , "boo" : "2.0.1"
    -  , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
    -  , "asd" : "http://asdf.com/asdf.tar.gz"
    -  , "til" : "~1.2"
    -  , "elf" : "~1.2.3"
    -  , "two" : "2.x"
    -  , "thr" : "3.3.x"
    -  , "lat" : "latest"
    -  , "dyl" : "file:../dyl"
    -  }
    -}
    -

    URLs as Dependencies

    -

    You may specify a tarball URL in place of a version range.

    -

    This tarball will be downloaded and installed locally to your package at -install time.

    -

    Git URLs as Dependencies

    -

    Git urls can be of the form:

    -
    git://github.com/user/project.git#commit-ish
    -git+ssh://user@hostname: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.

    -

    GitHub URLs

    -

    As of version 1.1.65, you can refer to GitHub urls as just "foo": -"user/foo-project". Just as with git URLs, a commit-ish suffix can be -included. For example:

    -
    {
    -  "name": "foo",
    -  "version": "0.0.0",
    -  "dependencies": {
    -    "express": "visionmedia/express",
    -    "mocha": "visionmedia/mocha#4727d357ea"
    -  }
    -}
    -

    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:

    -
    ../foo/bar
    -~/foo/bar
    -./foo/bar
    -/foo/bar
    -

    in which case they will be normalized to a relative path and added to your -package.json. For example:

    -
    {
    -  "name": "baz",
    -  "dependencies": {
    -    "bar": "file:../foo/bar"
    -  }
    -}
    -

    This feature is helpful for local offline development and creating -tests that require npm installing where you don't want to hit an -external server, but should not be used when publishing packages -to the public registry.

    -

    devDependencies

    -

    If someone is planning on downloading and using your module in their -program, then they probably don't want or need to download and build -the external test or documentation framework that you use.

    -

    In this case, it's best to map these additional items in a devDependencies -object.

    -

    These things will be installed when doing npm link or npm install -from the root of a package, and can be managed like any other npm -configuration param. See npm-config(7) for more on the topic.

    -

    For build steps that are not platform-specific, such as compiling -CoffeeScript or other languages to JavaScript, use the prepublish -script to do this, and make the required package a devDependency.

    -

    For example:

    -
    { "name": "ethopia-waza",
    -  "description": "a delightfully fruity coffee varietal",
    -  "version": "1.2.3",
    -  "devDependencies": {
    -    "coffee-script": "~1.6.3"
    -  },
    -  "scripts": {
    -    "prepublish": "coffee -o lib/ -c src/waza.coffee"
    -  },
    -  "main": "lib/waza.js"
    -}
    -

    The prepublish script will be run before publishing, so that users -can consume the functionality without requiring them to compile it -themselves. In dev mode (ie, locally running npm install), it'll -run this script as well, so that you can test it easily.

    -

    peerDependencies

    -

    In some cases, you want to express the compatibility of your package with a -host tool or library, while not necessarily doing a require of this host. -This is usually referred to as a plugin. Notably, your module may be exposing -a specific interface, expected and specified by the host documentation.

    -

    For example:

    -
    {
    -  "name": "tea-latte",
    -  "version": "1.3.5",
    -  "peerDependencies": {
    -    "tea": "2.x"
    -  }
    -}
    -

    This ensures your package tea-latte can be installed along with the second -major version of the host package tea only. npm install tea-latte could -possibly yield the following dependency graph:

    -
    ├── tea-latte@1.3.5
    -└── tea@2.2.0
    -

    NOTE: npm versions 1 and 2 will automatically install peerDependencies if -they are not explicitly depended upon higher in the dependency tree. In the -next major version of npm (npm@3), this will no longer be the case. You will -receive a warning that the peerDependency is not installed instead. The -behavior in npms 1 & 2 was frequently confusing and could easily put you into -dependency hell, a situation that npm is designed to avoid as much as possible.

    -

    Trying to install another plugin with a conflicting requirement will cause an -error. For this reason, make sure your plugin requirement is as broad as -possible, and not to lock it down to specific patch versions.

    -

    Assuming the host complies with semver, only changes in -the host package's major version will break your plugin. Thus, if you've worked -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.

    -

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

    -

    optionalDependencies

    -

    If a dependency can be used, but you would like npm to proceed if it cannot be -found or fails to install, then you may put it in the optionalDependencies -object. This is a map of package name to version or url, just like the -dependencies object. The difference is that build failures do not cause -installation to fail.

    -

    It is still your program's responsibility to handle the lack of the -dependency. For example, something like this:

    -
    try {
    -  var foo = require('foo')
    -  var fooVersion = require('foo/package.json').version
    -} catch (er) {
    -  foo = null
    -}
    -if ( notGoodFooVersion(fooVersion) ) {
    -  foo = null
    -}
    -
    -// .. then later in your program ..
    -
    -if (foo) {
    -  foo.doFooThings()
    -}
    -

    Entries in optionalDependencies will override entries of the same name in -dependencies, so it's usually best to only put in one place.

    -

    engines

    -

    You can specify the version of node that your stuff works on:

    -
    { "engines" : { "node" : ">=0.10.3 <0.12" } }
    -

    And, like with dependencies, if you don't specify the version (or if you -specify "*" as the version), then any version of node will do.

    -

    If you specify an "engines" field, then npm will require that "node" be -somewhere on that list. If "engines" is omitted, then npm will just assume -that it works on node.

    -

    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.

    -

    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.

    -

    os

    -

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

    -
    "os" : [ "darwin", "linux" ]
    -

    You can also blacklist instead of whitelist operating systems, -just prepend the blacklisted os with a '!':

    -
    "os" : [ "!win32" ]
    -

    The host operating system is determined by process.platform

    -

    It is allowed to both blacklist, and whitelist, although there isn't any -good reason to do this.

    -

    cpu

    -

    If your code only runs on certain cpu architectures, -you can specify which ones.

    -
    "cpu" : [ "x64", "ia32" ]
    -

    Like the os option, you can also blacklist architectures:

    -
    "cpu" : [ "!arm", "!mips" ]
    -

    The host architecture is determined by process.arch

    -

    preferGlobal

    -

    If your package is primarily a command-line application that should be -installed globally, then set this value to true to provide a warning -if it is installed locally.

    -

    It doesn't actually prevent users from installing it locally, but it -does help prevent some confusion if it doesn't work as expected.

    -

    private

    -

    If you set "private": true in your package.json, then npm will refuse -to publish it.

    -

    This is a way to prevent accidental publication of private repositories. If -you would like to ensure that a given package is only ever published to a -specific registry (for example, an internal registry), then use the -publishConfig dictionary described below to override the registry config -param at publish-time.

    -

    publishConfig

    -

    This is a set of config values that will be used at publish-time. It's -especially handy if you want to set the tag, registry or access, so that -you can ensure that a given package is not tagged with "latest", published -to the global public registry or that a scoped module is private by default.

    -

    Any config values can be overridden, but of course only "tag", "registry" and -"access" probably matter for the purposes of publishing.

    -

    See npm-config(7) to see the list of config options that can be -overridden.

    -

    DEFAULT VALUES

    -

    npm will default some values based on package contents.

    -
      -
    • "scripts": {"start": "node server.js"}

      -

      If there is a server.js file in the root of your package, then npm -will default the start command to node server.js.

      -
    • -
    • "scripts":{"preinstall": "node-gyp rebuild"}

      -

      If there is a binding.gyp file in the root of your package, npm will -default the preinstall command to compile using node-gyp.

      -
    • -
    • "contributors": [...]

      -

      If there is an AUTHORS file in the root of your package, npm will -treat each line as a Name <email> (url) format, where email and url -are optional. Lines which start with a # or are blank, will be -ignored.

      -
    • -
    -

    SEE ALSO

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

    npm-index

    Index of all npm documentation

    -

    README

    -

    a JavaScript package manager

    -

    Command Line Documentation

    -

    Using npm on the command line

    -

    npm(1)

    -

    javascript package manager

    -

    npm-access(1)

    -

    Set access level on published packages

    -

    npm-adduser(1)

    -

    Add a registry user account

    -

    npm-bin(1)

    -

    Display npm bin folder

    -

    npm-bugs(1)

    -

    Bugs for a package in a web browser maybe

    -

    npm-build(1)

    -

    Build a package

    -

    npm-bundle(1)

    -

    REMOVED

    -

    npm-cache(1)

    -

    Manipulates packages cache

    -

    npm-completion(1)

    -

    Tab Completion for npm

    -

    npm-config(1)

    -

    Manage the npm configuration files

    -

    npm-dedupe(1)

    -

    Reduce duplication

    -

    npm-deprecate(1)

    -

    Deprecate a version of a package

    -

    npm-dist-tag(1)

    -

    Modify package distribution tags

    -

    npm-docs(1)

    -

    Docs for a package in a web browser maybe

    -

    npm-edit(1)

    -

    Edit an installed package

    -

    npm-explore(1)

    -

    Browse an installed package

    -

    npm-help-search(1)

    -

    Search npm help documentation

    -

    npm-help(1)

    -

    Get help on npm

    -

    npm-init(1)

    -

    Interactively create a package.json file

    -

    npm-install(1)

    -

    Install a package

    - -

    Symlink a package folder

    -

    npm-logout(1)

    -

    Log out of the registry

    -

    npm-ls(1)

    -

    List installed packages

    -

    npm-outdated(1)

    -

    Check for outdated packages

    -

    npm-owner(1)

    -

    Manage package owners

    -

    npm-pack(1)

    -

    Create a tarball from a package

    -

    npm-ping(1)

    -

    Ping npm registry

    -

    npm-prefix(1)

    -

    Display prefix

    -

    npm-prune(1)

    -

    Remove extraneous packages

    -

    npm-publish(1)

    -

    Publish a package

    -

    npm-rebuild(1)

    -

    Rebuild a package

    -

    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)

    -

    Run arbitrary package scripts

    -

    npm-search(1)

    -

    Search for packages

    -

    npm-shrinkwrap(1)

    -

    Lock down dependency versions

    -

    npm-star(1)

    -

    Mark your favorite packages

    -

    npm-stars(1)

    -

    View packages marked as favorites

    -

    npm-start(1)

    -

    Start a package

    -

    npm-stop(1)

    -

    Stop a package

    -

    npm-tag(1)

    -

    Tag a published version

    -

    npm-test(1)

    -

    Test a package

    -

    npm-uninstall(1)

    -

    Remove a package

    -

    npm-unpublish(1)

    -

    Remove a package from the registry

    -

    npm-update(1)

    -

    Update a package

    -

    npm-version(1)

    -

    Bump a package version

    -

    npm-view(1)

    -

    View registry info

    -

    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)

    -

    Folder Structures Used by npm

    -

    npmrc(5)

    -

    The npm config files

    -

    package.json(5)

    -

    Specifics of npm's package.json handling

    -

    Misc

    -

    Various other bits and bobs

    -

    npm-coding-style(7)

    -

    npm's "funny" coding style

    -

    npm-config(7)

    -

    More than you probably want to know about npm configuration

    -

    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-registry(7)

    -

    The JavaScript Package Registry

    -

    npm-scope(7)

    -

    Scoped packages

    -

    npm-scripts(7)

    -

    How npm handles the "scripts" field

    -

    removing-npm(7)

    -

    Cleaning the Slate

    -

    semver(7)

    -

    The semantic versioner for npm

    - diff --git a/deps/npm/html/partial/doc/misc/npm-coding-style.html b/deps/npm/html/partial/doc/misc/npm-coding-style.html deleted file mode 100644 index b50b95f27f7e45..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-coding-style.html +++ /dev/null @@ -1,127 +0,0 @@ -

    npm-coding-style

    npm's "funny" coding style

    -

    DESCRIPTION

    -

    npm's coding style is a bit unconventional. It is not different for -difference's sake, but rather a carefully crafted style that is -designed to reduce visual clutter and make bugs more apparent.

    -

    If you want to contribute to npm (which is very encouraged), you should -make your code conform to npm's style.

    -

    Note: this concerns npm's code not the specific packages that you can download from the npm registry.

    -

    Line Length

    -

    Keep lines shorter than 80 characters. It's better for lines to be -too short than to be too long. Break up long lists, objects, and other -statements onto multiple lines.

    -

    Indentation

    -

    Two-spaces. Tabs are better, but they look like hell in web browsers -(and on GitHub), and node uses 2 spaces, so that's that.

    -

    Configure your editor appropriately.

    -

    Curly braces

    -

    Curly braces belong on the same line as the thing that necessitates them.

    -

    Bad:

    -
    function ()
    -{
    -

    Good:

    -
    function () {
    -

    If a block needs to wrap to the next line, use a curly brace. Don't -use it if it doesn't.

    -

    Bad:

    -
    if (foo) { bar() }
    -while (foo)
    -  bar()
    -

    Good:

    -
    if (foo) bar()
    -while (foo) {
    -  bar()
    -}
    -

    Semicolons

    -

    Don't use them except in four situations:

    -
      -
    • 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
    • -
    • 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.
    • -
    -

    Some examples of good semicolon usage:

    -
    ;(x || y).doSomething()
    -;[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")
    -  }
    -  end()
    -}
    -

    Note that starting lines with - and + also should be prefixed -with a semicolon, but this is much less common.

    -

    Comma First

    -

    If there is a list of things separated by commas, and it wraps -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"
    -                 ]
    -  , spells = { "fireball" : function () { setOnFire() }
    -             , "water" : function () { putOut() }
    -             }
    -  , a = 1
    -  , b = "abc"
    -  , etc
    -  , somethingElse
    -

    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.

    -

    Don't leave trailing whitespace at the end of lines. Don't indent empty -lines. Don't use more spaces than are helpful.

    -

    Functions

    -

    Use named functions. They make stack traces a lot easier to read.

    -

    Callbacks, Sync/async Style

    -

    Use the asynchronous/non-blocking versions of things as much as possible. -It might make more sense for npm to use the synchronous fs APIs, but this -way, the fs and http and child process stuff all uses the same callback-passing -methodology.

    -

    The callback should always be the last argument in the list. Its first -argument is the Error or null.

    -

    Be very careful never to ever ever throw anything. It's worse than useless. -Just send the error message back as the first argument to the callback.

    -

    Errors

    -

    Always create a new Error object with your message. Don't just return a -string message to the callback. Stack traces are handy.

    -

    Logging

    -

    Logging is done using the npmlog -utility.

    -

    Please clean up logs when they are no longer helpful. In particular, -logging the same object over and over again is not helpful. Logs should -report what's happening so that it's easier to track down where a fault -occurs.

    -

    Use appropriate log levels. See npm-config(7) and search for -"loglevel".

    -

    Case, naming, etc.

    -

    Use lowerCamelCase for multiword identifiers when they refer to objects, -functions, methods, properties, or anything not specified in this section.

    -

    Use UpperCamelCase for class names (things that you'd pass to "new").

    -

    Use all-lower-hyphen-css-case for multiword filenames and config keys.

    -

    Use named functions. They make stack traces easier to follow.

    -

    Use CAPS_SNAKE_CASE for constants, things that should never change -and are rarely used.

    -

    Use a single uppercase letter for function names where the function -would normally be anonymous, but needs to call itself recursively. It -makes it clear that it's a "throwaway" function.

    -

    null, undefined, false, 0

    -

    Boolean variables and functions should always be either true or -false. Don't set it to 0 unless it's supposed to be a number.

    -

    When something is intentionally missing or removed, set it to null.

    -

    Don't set things to undefined. Reserve that value to mean "not yet -set to anything."

    -

    Boolean objects are verboten.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/npm-config.html b/deps/npm/html/partial/doc/misc/npm-config.html deleted file mode 100644 index 2694cb8b2d6ea0..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-config.html +++ /dev/null @@ -1,779 +0,0 @@ -

    npm-config

    More than you probably want to know about npm configuration

    -

    DESCRIPTION

    -

    npm gets its configuration values from the following sources, sorted by priority:

    -

    Command Line Flags

    -

    Putting --foo bar on the command line sets the foo configuration -parameter to "bar". A -- argument tells the cli parser to stop -reading flags. A --flag parameter that is at the end of the -command will be given the value of true.

    -

    Environment Variables

    -

    Any environment variables that start with npm_config_ will be -interpreted as a configuration parameter. For example, putting -npm_config_foo=bar in your environment will set the foo -configuration parameter to bar. Any environment configurations that -are not given a value will be given the value of true. Config -values are case-insensitive, so NPM_CONFIG_FOO=bar will work the -same.

    -

    npmrc Files

    -

    The four relevant files are:

    -
      -
    • per-project config file (/path/to/my/project/.npmrc)
    • -
    • per-user config file (~/.npmrc)
    • -
    • global config file ($PREFIX/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.

    -

    Shorthands and Other CLI Niceties

    -

    The following shorthands are parsed on the command-line:

    -
      -
    • -v: --version
    • -
    • -h, -?, --help, -H: --usage
    • -
    • -s, --silent: --loglevel silent
    • -
    • -q, --quiet: --loglevel warn
    • -
    • -d: --loglevel info
    • -
    • -dd, --verbose: --loglevel verbose
    • -
    • -ddd: --loglevel silly
    • -
    • -g: --global
    • -
    • -C: --prefix
    • -
    • -l: --long
    • -
    • -m: --message
    • -
    • -p, --porcelain: --parseable
    • -
    • -reg: --registry
    • -
    • -f: --force
    • -
    • -desc: --description
    • -
    • -S: --save
    • -
    • -D: --save-dev
    • -
    • -O: --save-optional
    • -
    • -B: --save-bundle
    • -
    • -E: --save-exact
    • -
    • -y: --yes
    • -
    • -n: --yes false
    • -
    • ll and la commands: ls --long
    • -
    -

    If the specified configuration param resolves unambiguously to a known -configuration parameter, then it is expanded to that configuration -parameter. For example:

    -
    npm ls --par
    -# same as:
    -npm ls --parseable
    -

    If multiple single-character shorthands are strung together, and the -resulting combination is unambiguously not some other configuration -param, then it is expanded to its various component pieces. For -example:

    -
    npm ls -gpld
    -# same as:
    -npm ls --global --parseable --long --loglevel info
    -

    Per-Package Config Settings

    -

    When running scripts (see npm-scripts(7)) the package.json "config" -keys are overwritten in the environment if there is a config param of -<name>[@<version>]:<key>. For example, if the package.json has -this:

    -
    { "name" : "foo"
    -, "config" : { "port" : "8080" }
    -, "scripts" : { "start" : "node server.js" } }
    -

    and the server.js is this:

    -
    http.createServer(...).listen(process.env.npm_package_config_port)
    -

    then the user could change the behavior by doing:

    -
    npm config set foo:port 80
    -

    See package.json(5) for more information.

    -

    Config Settings

    -

    access

    -
      -
    • Default: restricted
    • -
    • Type: Access
    • -
    -

    When publishing scoped packages, the access level defaults to restricted. If -you want your scoped package to be publicly viewable (and installable) set ---access=public. The only valid values for access are public and -restricted. Unscoped packages always have an access level of public.

    -

    always-auth

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

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

    - -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Tells npm to create symlinks (or .cmd shims on Windows) for package -executables.

    -

    Set to false to have it not do this. This can be used to work around -the fact that some file systems don't support symlinks, even on -ostensibly Unix systems.

    -

    browser

    -
      -
    • Default: OS X: "open", Windows: "start", Others: "xdg-open"
    • -
    • Type: String
    • -
    -

    The browser that is called by the npm docs command to open websites.

    -

    ca

    -
      -
    • Default: The npm CA certificate
    • -
    • Type: String, Array or null
    • -
    -

    The Certificate Authority signing certificate that is trusted for SSL -connections to the registry. Values should be in PEM format with newlines -replaced by the string "\n". For example:

    -
    ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
    -

    Set to null to only allow "known" registrars, or to a specific CA cert -to trust only that specific signing authority.

    -

    Multiple CAs can be trusted by specifying an array of certificates:

    -
    ca[]="..."
    -ca[]="..."
    -

    See also the strict-ssl config.

    -

    cafile

    -
      -
    • Default: null
    • -
    • Type: path
    • -
    -

    A path to a file containing one or multiple Certificate Authority signing -certificates. Similar to the ca setting, but allows for multiple CA's, as -well as for the CA information to be stored in a file on disk.

    -

    cache

    -
      -
    • Default: Windows: %AppData%\npm-cache, Posix: ~/.npm
    • -
    • Type: path
    • -
    -

    The location of npm's cache directory. See npm-cache(1)

    -

    cache-lock-stale

    -
      -
    • Default: 60000 (1 minute)
    • -
    • Type: Number
    • -
    -

    The number of ms before cache folder lockfiles are considered stale.

    -

    cache-lock-retries

    -
      -
    • Default: 10
    • -
    • Type: Number
    • -
    -

    Number of times to retry to acquire a lock on cache folder lockfiles.

    -

    cache-lock-wait

    -
      -
    • Default: 10000 (10 seconds)
    • -
    • Type: Number
    • -
    -

    Number of ms to wait for cache lock files to expire.

    -

    cache-max

    -
      -
    • Default: Infinity
    • -
    • Type: Number
    • -
    -

    The maximum time (in seconds) to keep items in the registry cache before -re-checking against the registry.

    -

    Note that no purging is done unless the npm cache clean command is -explicitly used, and that only GET requests use the cache.

    -

    cache-min

    -
      -
    • Default: 10
    • -
    • Type: Number
    • -
    -

    The minimum time (in seconds) to keep items in the registry cache before -re-checking against the registry.

    -

    Note that no purging is done unless the npm cache clean command is -explicitly used, and that only GET requests use the cache.

    -

    cert

    -
      -
    • Default: null
    • -
    • Type: String
    • -
    -

    A client certificate to pass when accessing the registry.

    -

    color

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

    If false, never shows colors. If "always" then always shows colors. -If true, then only prints color codes for tty file descriptors.

    -

    depth

    -
      -
    • Default: Infinity
    • -
    • Type: Number
    • -
    -

    The depth to go when recursing directories for npm ls, -npm cache ls, and npm outdated.

    -

    For npm outdated, a setting of Infinity will be treated as 0 -since that gives more useful information. To show the outdated status -of all packages and dependents, use a large integer value, -e.g., npm outdated --depth 9999

    -

    description

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Show the description in npm search

    -

    dev

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

    Install dev-dependencies along with packages.

    -

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

    -

    editor

    -
      -
    • Default: EDITOR environment variable if set, or "vi" on Posix, -or "notepad" on Windows.
    • -
    • Type: path
    • -
    -

    The command to run for npm edit or npm config edit.

    -

    engine-strict

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

    If set to true, then npm will stubbornly refuse to install (or even -consider installing) any package that claims to not be compatible with -the current Node.js version.

    -

    force

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

    Makes various commands more forceful.

    -
      -
    • lifecycle script failure does not block progress.
    • -
    • publishing clobbers previously published versions.
    • -
    • skips cache when requesting from the registry.
    • -
    • prevents checks against clobbering non-npm files.
    • -
    -

    fetch-retries

    -
      -
    • Default: 2
    • -
    • Type: Number
    • -
    -

    The "retries" config for the retry module to use when fetching -packages from the registry.

    -

    fetch-retry-factor

    -
      -
    • Default: 10
    • -
    • Type: Number
    • -
    -

    The "factor" config for the retry module to use when fetching -packages.

    -

    fetch-retry-mintimeout

    -
      -
    • Default: 10000 (10 seconds)
    • -
    • Type: Number
    • -
    -

    The "minTimeout" config for the retry module to use when fetching -packages.

    -

    fetch-retry-maxtimeout

    -
      -
    • Default: 60000 (1 minute)
    • -
    • Type: Number
    • -
    -

    The "maxTimeout" config for the retry module to use when fetching -packages.

    -

    git

    -
      -
    • Default: "git"
    • -
    • Type: String
    • -
    -

    The command to use for git commands. If git is installed on the -computer, but is not in the PATH, then set this to the full path to -the git binary.

    -

    git-tag-version

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Tag the commit when using the npm version command.

    -

    global

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

    Operates in "global" mode, so that packages are installed into the -prefix folder instead of the current working directory. See -npm-folders(5) for more on the differences in behavior.

    -
      -
    • packages are installed into the {prefix}/lib/node_modules folder, instead of the -current working directory.
    • -
    • bin files are linked to {prefix}/bin
    • -
    • man pages are linked to {prefix}/share/man
    • -
    -

    globalconfig

    -
      -
    • Default: {prefix}/etc/npmrc
    • -
    • Type: path
    • -
    -

    The config file to read for global config options.

    -

    group

    -
      -
    • Default: GID of the current process
    • -
    • Type: String or Number
    • -
    -

    The group to use when running package scripts in global mode as the root -user.

    -

    heading

    -
      -
    • Default: "npm"
    • -
    • Type: String
    • -
    -

    The string that starts all the debugging log output.

    -

    https-proxy

    -
      -
    • Default: null
    • -
    • Type: url
    • -
    -

    A proxy to use for outgoing https requests. If the HTTPS_PROXY or -https_proxy or HTTP_PROXY or http_proxy environment variables are set, -proxy settings will be honored by the underlying request library.

    -

    if-present

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

    If true, npm will not exit with an error code when run-script is invoked for -a script that isn't defined in the scripts section of package.json. This -option can be used when it's desirable to optionally run a script when it's -present and fail if the script fails. This is useful, for example, when running -scripts that may only apply for some builds in an otherwise generic CI setup.

    -

    ignore-scripts

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

    If true, npm does not run scripts specified in package.json files.

    -

    init-module

    -
      -
    • Default: ~/.npm-init.js
    • -
    • Type: path
    • -
    -

    A module that will be loaded by the npm init command. See the -documentation for the -init-package-json module -for more information, or npm-init(1).

    -

    init-author-name

    -
      -
    • Default: ""
    • -
    • Type: String
    • -
    -

    The value npm init should use by default for the package author's name.

    -

    init-author-email

    -
      -
    • Default: ""
    • -
    • Type: String
    • -
    -

    The value npm init should use by default for the package author's email.

    -

    init-author-url

    -
      -
    • Default: ""
    • -
    • Type: String
    • -
    -

    The value npm init should use by default for the package author's homepage.

    -

    init-license

    -
      -
    • Default: "ISC"
    • -
    • Type: String
    • -
    -

    The value npm init should use by default for the package license.

    -

    init-version

    -
      -
    • Default: "1.0.0"
    • -
    • Type: semver
    • -
    -

    The value that npm init should use by default for the package -version number, if not already set in package.json.

    -

    json

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

    Whether or not to output JSON data, rather than the normal output.

    -

    This feature is currently experimental, and the output data structures -for many commands is either not implemented in JSON yet, or subject to -change. Only the output from npm ls --json is currently valid.

    -

    key

    -
      -
    • Default: null
    • -
    • Type: String
    • -
    -

    A client key to pass when accessing the registry.

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

    If true, then local installs will link if there is a suitable globally -installed package.

    -

    Note that this means that local installs can cause things to be -installed into the global space at the same time. The link is only done -if one of the two conditions are met:

    -
      -
    • The package is not already installed globally, or
    • -
    • the globally installed version is identical to the version that is -being installed locally.
    • -
    -

    local-address

    -
      -
    • Default: undefined
    • -
    • Type: IP Address
    • -
    -

    The IP address of the local interface to use when making connections -to the npm registry. Must be IPv4 in versions of Node prior to 0.12.

    -

    loglevel

    -
      -
    • Default: "warn"
    • -
    • Type: String
    • -
    • Values: "silent", "error", "warn", "http", "info", "verbose", "silly"
    • -
    -

    What level of logs to report. On failure, all logs are written to -npm-debug.log in the current working directory.

    -

    Any logs of a higher level than the setting are shown. -The default is "warn", which shows warn and error output.

    -

    logstream

    -
      -
    • Default: process.stderr
    • -
    • Type: Stream
    • -
    -

    This is the stream that is passed to the -npmlog module at run time.

    -

    It cannot be set from the command line, but if you are using npm -programmatically, you may wish to send logs to somewhere other than -stderr.

    -

    If the color config is set to true, then this stream will receive -colored output if it is a TTY.

    -

    long

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

    Show extended information in npm ls and npm search.

    -

    message

    -
      -
    • Default: "%s"
    • -
    • Type: String
    • -
    -

    Commit message which is used by npm version when creating version commit.

    -

    Any "%s" in the message will be replaced with the version number.

    -

    node-version

    -
      -
    • Default: process.version
    • -
    • Type: semver or false
    • -
    -

    The node version to use when checking a package's engines map.

    -

    npat

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

    Run tests on installation.

    -

    onload-script

    -
      -
    • Default: false
    • -
    • Type: path
    • -
    -

    A node module to require() when npm loads. Useful for programmatic -usage.

    -

    optional

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Attempt to install packages in the optionalDependencies object. Note -that if these packages fail to install, the overall installation -process is not aborted.

    -

    parseable

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

    Output parseable results from commands that write to -standard output.

    -

    prefix

    - -

    The location to install global items. If set on the command line, then -it forces non-global commands to run in the specified folder.

    -

    production

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

    Set to true to run in "production" mode.

    -
      -
    1. devDependencies are not installed at the topmost level when running -local npm install without any arguments.
    2. -
    3. Set the NODE_ENV="production" for lifecycle scripts.
    4. -
    -

    proprietary-attribs

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Whether or not to include proprietary extended attributes in the -tarballs created by npm.

    -

    Unless you are expecting to unpack package tarballs with something other -than npm -- particularly a very outdated tar implementation -- leave -this as true.

    -

    proxy

    -
      -
    • Default: null
    • -
    • Type: url
    • -
    -

    A proxy to use for outgoing http requests. If the HTTP_PROXY or -http_proxy environment variables are set, proxy settings will be -honored by the underlying request library.

    -

    rebuild-bundle

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Rebuild bundled dependencies after installation.

    -

    registry

    - -

    The base URL of the npm package registry.

    -

    rollback

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    Remove failed installs.

    -

    save

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

    Save installed packages to a package.json file as dependencies.

    -

    When used with the npm rm command, it removes it from the dependencies -object.

    -

    Only works if there is already a package.json file present.

    -

    save-bundle

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

    If a package would be saved at install time by the use of --save, ---save-dev, or --save-optional, then also put it in the -bundleDependencies list.

    -

    When used with the npm rm command, it removes it from the -bundledDependencies list.

    -

    save-dev

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

    Save installed packages to a package.json file as devDependencies.

    -

    When used with the npm rm command, it removes it from the -devDependencies object.

    -

    Only works if there is already a package.json file present.

    -

    save-exact

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

    Dependencies saved to package.json using --save, --save-dev or ---save-optional will be configured with an exact version rather than -using npm's default semver range operator.

    -

    save-optional

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

    Save installed packages to a package.json file as -optionalDependencies.

    -

    When used with the npm rm command, it removes it from the -devDependencies object.

    -

    Only works if there is already a package.json file present.

    -

    save-prefix

    -
      -
    • Default: '^'
    • -
    • Type: String
    • -
    -

    Configure how versions of packages installed to a package.json file via ---save or --save-dev get prefixed.

    -

    For example if a package has version 1.2.3, by default its version is -set to ^1.2.3 which allows minor upgrades for that package, but after -npm config set save-prefix='~' it would be set to ~1.2.3 which only allows -patch upgrades.

    -

    scope

    -
      -
    • Default: ""
    • -
    • Type: String
    • -
    -

    Associate an operation with a scope for a scoped registry. Useful when logging -in to a private registry for the first time: -npm login --scope=@organization --registry=registry.organization.com, which -will cause @organization to be mapped to the registry for future installation -of packages specified according to the pattern @organization/package.

    -

    searchopts

    -
      -
    • Default: ""
    • -
    • Type: String
    • -
    -

    Space-separated options that are always passed to search.

    -

    searchexclude

    -
      -
    • Default: ""
    • -
    • Type: String
    • -
    -

    Space-separated options that limit the results from search.

    -

    searchsort

    -
      -
    • Default: "name"
    • -
    • Type: String
    • -
    • Values: "name", "-name", "date", "-date", "description", -"-description", "keywords", "-keywords"
    • -
    -

    Indication of which field to sort search results by. Prefix with a - -character to indicate reverse sort.

    -

    shell

    -
      -
    • Default: SHELL environment variable, or "bash" on Posix, or "cmd" on -Windows
    • -
    • Type: path
    • -
    -

    The shell to run for the npm explore command.

    -

    shrinkwrap

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    If set to false, then ignore npm-shrinkwrap.json files when -installing.

    -

    sign-git-tag

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

    If set to true, then the npm version command will tag the version -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
    • -
    • Type: Boolean
    • -
    -

    Whether or not to do SSL key validation when making requests to the -registry via https.

    -

    See also the ca config.

    -

    tag

    -
      -
    • Default: latest
    • -
    • Type: String
    • -
    -

    If you ask npm to install a package and don't tell it a specific version, then -it will install the specified tag.

    -

    Also the tag that is added to the package@version specified by the npm -tag command, if no explicit tag is given.

    -

    tag-version-prefix

    -
      -
    • Default: "v"
    • -
    • Type: String
    • -
    -

    If set, alters the prefix used when tagging a new version when performing a -version increment using npm-version. To remove the prefix altogether, set it -to the empty string: "".

    -

    Because other tools may rely on the convention that npm version tags look like -v1.0.0, only use this property if it is absolutely necessary. In -particular, use care when overriding this setting for public packages.

    -

    tmp

    -
      -
    • Default: TMPDIR environment variable, or "/tmp"
    • -
    • Type: path
    • -
    -

    Where to store temporary files and folders. All temp files are deleted -on success, but left behind on failure for forensic purposes.

    -

    unicode

    -
      -
    • Default: true
    • -
    • Type: Boolean
    • -
    -

    When set to true, npm uses unicode characters in the tree output. When -false, it uses ascii characters to draw trees.

    -

    unsafe-perm

    -
      -
    • Default: false if running as root, true otherwise
    • -
    • Type: Boolean
    • -
    -

    Set to true to suppress the UID/GID switching when running package -scripts. If set explicitly to false, then installing as a non-root user -will fail.

    -

    usage

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

    Set to show short usage output (like the -H output) -instead of complete help when doing npm-help(1).

    -

    user

    -
      -
    • Default: "nobody"
    • -
    • Type: String or Number
    • -
    -

    The UID to set to when running package scripts as root.

    -

    userconfig

    -
      -
    • Default: ~/.npmrc
    • -
    • Type: path
    • -
    -

    The location of user-level configuration settings.

    -

    umask

    -
      -
    • Default: 022
    • -
    • Type: Octal numeric string in range 0000..0777 (0..511)
    • -
    -

    The "umask" value to use when setting the file creation mode on files -and folders.

    -

    Folders and executables are given a mode which is 0777 masked against -this value. Other files are given a mode which is 0666 masked against -this value. Thus, the defaults are 0755 and 0644 respectively.

    -

    user-agent

    -
      -
    • Default: node/{process.version} {process.platform} {process.arch}
    • -
    • Type: String
    • -
    -

    Sets a User-Agent to the request header

    -

    version

    -
      -
    • Default: false
    • -
    • Type: boolean
    • -
    -

    If true, output the npm version and exit successfully.

    -

    Only relevant when specified explicitly on the command line.

    -

    versions

    -
      -
    • Default: false
    • -
    • Type: boolean
    • -
    -

    If true, output the npm version as well as node's process.versions map, and -exit successfully.

    -

    Only relevant when specified explicitly on the command line.

    -

    viewer

    -
      -
    • Default: "man" on Posix, "browser" on Windows
    • -
    • Type: path
    • -
    -

    The program to use to view help content.

    -

    Set to "browser" to view html help content in the default web browser.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/npm-developers.html b/deps/npm/html/partial/doc/misc/npm-developers.html deleted file mode 100644 index 10d0cd89198a3f..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-developers.html +++ /dev/null @@ -1,169 +0,0 @@ -

    npm-developers

    Developer Guide

    -

    DESCRIPTION

    -

    So, you've decided to use npm to develop (and maybe publish/deploy) -your project.

    -

    Fantastic!

    -

    There are a few things that you need to do above the simple steps -that your users will do to install your program.

    -

    About These Documents

    -

    These are man pages. If you install npm, you should be able to -then do man npm-thing to get the documentation on a particular -topic, or npm help thing to see the same information.

    -

    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.

    -

    The package.json File

    -

    You need to have a package.json file in the root of your project to do -much of anything with npm. That is basically the whole interface.

    -

    See package.json(5) for details about what goes in that file. At the very -least, you need:

    -
      -
    • name: -This should be a string that identifies your project. Please do not -use the name to specify that it runs on node, or is in JavaScript. -You can use the "engines" field to explicitly state the versions of -node (or whatever else) that your program requires, and it's pretty -well assumed that it's javascript.

      -

      It does not necessarily need to match your github repository name.

      -

      So, node-foo and bar-js are bad names. foo or bar are better.

      -
    • -
    • version: -A semver-compatible version.

      -
    • -
    • engines: -Specify the versions of node (or whatever else) that your program -runs on. The node API changes a lot, and there may be bugs or new -functionality that you depend on. Be explicit.

      -
    • -
    • author: -Take some credit.

      -
    • -
    • scripts: -If you have a special compilation or installation script, then you -should put it in the scripts object. You should definitely have at -least a basic smoke-test command as the "scripts.test" field. -See npm-scripts(7).

      -
    • -
    • main: -If you have a single module that serves as the entry point to your -program (like what the "foo" package gives you at require("foo")), -then you need to specify that in the "main" field.

      -
    • -
    • directories: -This is an object mapping names to folders. The best ones to include are -"lib" and "doc", but if you use "man" to specify a folder full of man pages, -they'll get installed just like these ones.

      -
    • -
    -

    You can use npm init in the root of your package in order to get you -started with a pretty basic package.json file. See npm-init(1) for -more info.

    -

    Keeping files out of your package

    -

    Use a .npmignore file to keep stuff out of your package. If there's -no .npmignore file, but there is a .gitignore file, then npm will -ignore the stuff matched by the .gitignore file. If you want to -include something that is excluded by your .gitignore file, you can -create an empty .npmignore file to override it.

    -

    .npmignore files follow the same pattern rules -as .gitignore files:

    -
      -
    • Blank lines or lines starting with # are ignored.
    • -
    • Standard glob patterns work.
    • -
    • You can end patterns with a forward slash / to specify a directory.
    • -
    • You can negate a pattern by starting it with an exclamation point !.
    • -
    -

    By default, the following paths and files are ignored, so there's no -need to add them to .npmignore explicitly:

    -
      -
    • .*.swp
    • -
    • ._*
    • -
    • .DS_Store
    • -
    • .git
    • -
    • .hg
    • -
    • .lock-wscript
    • -
    • .svn
    • -
    • .wafpickle-*
    • -
    • CVS
    • -
    • npm-debug.log
    • -
    -

    Additionally, everything in node_modules is ignored, except for -bundled dependencies. npm automatically handles this for you, so don't -bother adding node_modules to .npmignore.

    -

    The following paths and files are never ignored, so adding them to -.npmignore is pointless:

    - - -

    npm link is designed to install a development package and see the -changes in real time without having to keep re-installing it. (You do -need to either re-link or npm rebuild -g to update compiled packages, -of course.)

    -

    More info at npm-link(1).

    -

    Before Publishing: Make Sure Your Package Installs and Works

    -

    This is important.

    -

    If you can not install it locally, you'll have -problems trying to publish it. Or, worse yet, you'll be able to -publish it, but you'll be publishing a broken or pointless package. -So don't do that.

    -

    In the root of your package, do this:

    -
    npm install . -g
    -

    That'll show you that it's working. If you'd rather just create a symlink -package that points to your working directory, then do this:

    -
    npm link
    -

    Use npm ls -g to see if it's there.

    -

    To test a local install, go into some other folder, and then do:

    -
    cd ../some-other-folder
    -npm install ../my-package
    -

    to install it locally into the node_modules folder in that other place.

    -

    Then go into the node-repl, and try using require("my-thing") to -bring in your module's main module.

    -

    Create a User Account

    -

    Create a user with the adduser command. It works like this:

    -
    npm adduser
    -

    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:

    -
    npm publish
    -

    You can give publish a url to a tarball, or a filename of a tarball, -or a path to a folder.

    -

    Note that pretty much everything in that folder will be exposed -by default. So, if you have secret stuff in there, use a -.npmignore file to list out the globs to ignore, or publish -from a fresh checkout.

    -

    Brag about it

    -

    Send emails, write blogs, blab in IRC.

    -

    Tell the world how easy it is to install your program!

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/npm-disputes.html b/deps/npm/html/partial/doc/misc/npm-disputes.html deleted file mode 100644 index 15f650627c7a42..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-disputes.html +++ /dev/null @@ -1,92 +0,0 @@ -

    npm-disputes

    Handling Module Name Disputes

    -

    SYNOPSIS

    -
      -
    1. Get the author email with npm owner ls <pkgname>
    2. -
    3. Email the author, CC support@npmjs.com
    4. -
    5. After a few weeks, if there's no resolution, we'll sort it out.
    6. -
    -

    Don't squat on package names. Publish code or move out of the way.

    -

    DESCRIPTION

    -

    There sometimes arise cases where a user publishes a module, and then -later, some other user wants to use that name. Here are some common -ways that happens (each of these is based on actual events.)

    -
      -
    1. Joe writes a JavaScript module foo, which is not node-specific. -Joe doesn't use node at all. Bob wants to use foo in node, so he -wraps it in an npm module. Some time later, Joe starts using node, -and wants to take over management of his program.
    2. -
    3. Bob writes an npm module foo, and publishes it. Perhaps much -later, Joe finds a bug in foo, and fixes it. He sends a pull -request to Bob, but Bob doesn't have the time to deal with it, -because he has a new job and a new baby and is focused on his new -erlang project, and kind of not involved with node any more. Joe -would like to publish a new foo, but can't, because the name is -taken.
    4. -
    5. Bob writes a 10-line flow-control library, and calls it foo, and -publishes it to the npm registry. Being a simple little thing, it -never really has to be updated. Joe works for Foo Inc, the makers -of the critically acclaimed and widely-marketed foo JavaScript -toolkit framework. They publish it to npm as foojs, but people are -routinely confused when npm install foo is some different thing.
    6. -
    7. Bob writes a parser for the widely-known foo file format, because -he needs it for work. Then, he gets a new job, and never updates the -prototype. Later on, Joe writes a much more complete foo parser, -but can't publish, because Bob's foo is in the way.
    8. -
    -

    The validity of Joe's claim in each situation can be debated. However, -Joe's appropriate course of action in each case is the same.

    -
      -
    1. npm owner ls foo. This will tell Joe the email address of the -owner (Bob).
    2. -
    3. 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 -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.
    4. -
    5. 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 -usually at least 4 weeks, but extra time is allowed around common -holidays.)
    6. -
    -

    REASONING

    -

    In almost every case so far, the parties involved have been able to reach -an amicable resolution without any major intervention. Most people -really do want to be reasonable, and are probably not even aware that -they're in your way.

    -

    Module ecosystems are most vibrant and powerful when they are as -self-directed as possible. If an admin one day deletes something you -had worked on, then that is going to make most people quite upset, -regardless of the justification. When humans solve their problems by -talking to other humans with respect, everyone has the chance to end up -feeling good about the interaction.

    -

    EXCEPTIONS

    -

    Some things are not allowed, and will be removed without discussion if -they are brought to the attention of the npm registry admins, including -but not limited to:

    -
      -
    1. Malware (that is, a package designed to exploit or harm the machine on -which it is installed).
    2. -
    3. Violations of copyright or licenses (for example, cloning an -MIT-licensed program, and then removing or changing the copyright and -license statement).
    4. -
    5. Illegal content.
    6. -
    7. "Squatting" on a package name that you plan to use, but aren't -actually using. Sorry, I don't care how great the name is, or how -perfect a fit it is for the thing that someday might happen. If -someone wants to use it today, and you're just taking up space with -an empty tarball, you're going to be evicted.
    8. -
    9. Putting empty packages in the registry. Packages must have SOME -functionality. It can be silly, but it can't be nothing. (See -also: squatting.)
    10. -
    11. Doing weird things with the registry, like using it as your own -personal application database or otherwise putting non-packagey -things into it.
    12. -
    -

    If you see bad behavior like this, please report it right away.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/npm-faq.html b/deps/npm/html/partial/doc/misc/npm-faq.html deleted file mode 100644 index f9a13cf4edbe94..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-faq.html +++ /dev/null @@ -1,288 +0,0 @@ -

    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/partial/doc/misc/npm-index.html b/deps/npm/html/partial/doc/misc/npm-index.html deleted file mode 100644 index a75c025771f879..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-index.html +++ /dev/null @@ -1,220 +0,0 @@ -

    npm-index

    Index of all npm documentation

    -

    README

    -

    a JavaScript package manager

    -

    Command Line Documentation

    -

    Using npm on the command line

    -

    npm(1)

    -

    javascript package manager

    -

    npm-access(1)

    -

    Set access level on published packages

    -

    npm-adduser(1)

    -

    Add a registry user account

    -

    npm-bin(1)

    -

    Display npm bin folder

    -

    npm-bugs(1)

    -

    Bugs for a package in a web browser maybe

    -

    npm-build(1)

    -

    Build a package

    -

    npm-bundle(1)

    -

    REMOVED

    -

    npm-cache(1)

    -

    Manipulates packages cache

    -

    npm-completion(1)

    -

    Tab Completion for npm

    -

    npm-config(1)

    -

    Manage the npm configuration files

    -

    npm-dedupe(1)

    -

    Reduce duplication

    -

    npm-deprecate(1)

    -

    Deprecate a version of a package

    -

    npm-dist-tag(1)

    -

    Modify package distribution tags

    -

    npm-docs(1)

    -

    Docs for a package in a web browser maybe

    -

    npm-edit(1)

    -

    Edit an installed package

    -

    npm-explore(1)

    -

    Browse an installed package

    -

    npm-help-search(1)

    -

    Search npm help documentation

    -

    npm-help(1)

    -

    Get help on npm

    -

    npm-init(1)

    -

    Interactively create a package.json file

    -

    npm-install(1)

    -

    Install a package

    - -

    Symlink a package folder

    -

    npm-logout(1)

    -

    Log out of the registry

    -

    npm-ls(1)

    -

    List installed packages

    -

    npm-outdated(1)

    -

    Check for outdated packages

    -

    npm-owner(1)

    -

    Manage package owners

    -

    npm-pack(1)

    -

    Create a tarball from a package

    -

    npm-ping(1)

    -

    Ping npm registry

    -

    npm-prefix(1)

    -

    Display prefix

    -

    npm-prune(1)

    -

    Remove extraneous packages

    -

    npm-publish(1)

    -

    Publish a package

    -

    npm-rebuild(1)

    -

    Rebuild a package

    -

    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)

    -

    Run arbitrary package scripts

    -

    npm-search(1)

    -

    Search for packages

    -

    npm-shrinkwrap(1)

    -

    Lock down dependency versions

    -

    npm-star(1)

    -

    Mark your favorite packages

    -

    npm-stars(1)

    -

    View packages marked as favorites

    -

    npm-start(1)

    -

    Start a package

    -

    npm-stop(1)

    -

    Stop a package

    -

    npm-tag(1)

    -

    Tag a published version

    -

    npm-test(1)

    -

    Test a package

    -

    npm-uninstall(1)

    -

    Remove a package

    -

    npm-unpublish(1)

    -

    Remove a package from the registry

    -

    npm-update(1)

    -

    Update a package

    -

    npm-version(1)

    -

    Bump a package version

    -

    npm-view(1)

    -

    View registry info

    -

    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)

    -

    Folder Structures Used by npm

    -

    npmrc(5)

    -

    The npm config files

    -

    package.json(5)

    -

    Specifics of npm's package.json handling

    -

    Misc

    -

    Various other bits and bobs

    -

    npm-coding-style(7)

    -

    npm's "funny" coding style

    -

    npm-config(7)

    -

    More than you probably want to know about npm configuration

    -

    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-registry(7)

    -

    The JavaScript Package Registry

    -

    npm-scope(7)

    -

    Scoped packages

    -

    npm-scripts(7)

    -

    How npm handles the "scripts" field

    -

    removing-npm(7)

    -

    Cleaning the Slate

    -

    semver(7)

    -

    The semantic versioner for npm

    - diff --git a/deps/npm/html/partial/doc/misc/npm-registry.html b/deps/npm/html/partial/doc/misc/npm-registry.html deleted file mode 100644 index 8dd80d4d25b281..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-registry.html +++ /dev/null @@ -1,50 +0,0 @@ -

    npm-registry

    The JavaScript Package Registry

    -

    DESCRIPTION

    -

    To resolve packages by name and version, npm talks to a registry website -that implements the CommonJS Package Registry specification for reading -package info.

    -

    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 -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.

    -

    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), -npmrc(5), and npm-config(7) for more on managing npm's configuration.

    -

    Can I run my own private registry?

    -

    Yes!

    -

    The easiest way is to replicate the couch database, and use the same (or -similar) design doc to implement the APIs.

    -

    If you set up continuous replication from the official CouchDB, and then -set your internal CouchDB as the registry config, then you'll be able -to read any published packages, in addition to your private ones, and by -default will only publish internally.

    -

    If you then want to publish a package for the whole world to see, you can -simply override the --registry option for that publish command.

    -

    I don't want my package published in the official registry. It's private.

    -

    Set "private": true in your package.json to prevent it from being -published at all, or -"publishConfig":{"registry":"http://my-internal-registry.local"} -to force it to be published only to your internal registry.

    -

    See package.json(5) for more info on what goes in the package.json file.

    -

    Will you replicate from my registry into the public one?

    -

    No. If you want things to be public, then publish them into the public -registry using npm. What little security there is would be for nought -otherwise.

    -

    Do I have to use couchdb to build a registry that npm can talk to?

    -

    No, but it's way easier. Basically, yes, you do, or you have to -effectively implement the entire CouchDB API anyway.

    -

    Is there a website or something to see package docs and such?

    -

    Yes, head over to https://npmjs.com/

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/npm-scope.html b/deps/npm/html/partial/doc/misc/npm-scope.html deleted file mode 100644 index f65c44036761fb..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-scope.html +++ /dev/null @@ -1,71 +0,0 @@ -

    npm-scope

    Scoped packages

    -

    DESCRIPTION

    -

    All npm packages have a name. Some package names also have a scope. A scope -follows the usual rules for package names (url-safe characters, no leading dots -or underscores). When used in package names, preceded by an @-symbol and -followed by a slash, e.g.

    -
    @somescope/somepackagename
    -

    Scopes are a way of grouping related packages together, and also affect a few -things about the way npm treats the package.

    -

    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.

    -

    Installing scoped packages

    -

    Scoped packages are installed to a sub-folder of the regular installation -folder, e.g. if your other packages are installed in node_modules/packagename, -scoped modules will be in node_modules/@myorg/packagename. The scope folder -(@myorg) is simply the name of the scope preceded by an @-symbol, and can -contain any number of scoped packages.

    -

    A scoped package is installed by referencing it by name, preceded by an -@-symbol, in npm install:

    -
    npm install @myorg/mypackage
    -

    Or in package.json:

    -
    "dependencies": {
    -  "@myorg/mypackage": "^1.3.0"
    -}
    -

    Note that if the @-symbol is omitted in either case npm will instead attempt to -install from GitHub; see npm-install(1).

    -

    Requiring scoped packages

    -

    Because scoped packages are installed into a scope folder, you have to -include the name of the scope when requiring them in your code, e.g.

    -
    require('@myorg/mypackage')
    -

    There is nothing special about the way Node treats scope folders, this is -just specifying to require the module mypackage in the folder called @myorg.

    -

    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)

    -

    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 -the initial publication. This will publish the package and set access -to public as if you had run npm access public after publishing.

    -

    Publishing private scoped packages to the npm registry

    -

    To publish a private scoped package to the npm registry, you must have -an npm Private Modules -account.

    -

    You can then publish the module with npm publish or npm publish ---access restricted, and it will be present in the npm registry, with -restricted access. You can then change the access permissions, if -desired, with npm access or on the npmjs.com website.

    -

    Associating a scope with a registry

    -

    Scopes can be associated with a separate registry. This allows you to -seamlessly use a mix of packages from the public npm registry and one or more -private registries, such as npm Enterprise.

    -

    You can associate a scope with a registry at login, e.g.

    -
    npm login --registry=http://reg.example.com --scope=@myco
    -

    Scopes have a many-to-one relationship with registries: one registry can -host multiple scopes, but a scope only ever points to one registry.

    -

    You can also associate a scope with a registry using npm config:

    -
    npm config set @myco:registry http://reg.example.com
    -

    Once a scope is associated with a registry, any npm install for a package -with that scope will request packages from that registry instead. Any -npm publish for a package name that contains the scope will be published to -that registry instead.

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/npm-scripts.html b/deps/npm/html/partial/doc/misc/npm-scripts.html deleted file mode 100644 index f4ce3221a3cdef..00000000000000 --- a/deps/npm/html/partial/doc/misc/npm-scripts.html +++ /dev/null @@ -1,187 +0,0 @@ -

    npm-scripts

    How npm handles the "scripts" field

    -

    DESCRIPTION

    -

    npm supports the "scripts" property of the package.json script, for the -following scripts:

    -
      -
    • prepublish: -Run BEFORE the package is published. (Also run on local npm -install without any arguments.)
    • -
    • publish, postpublish: -Run AFTER the package is published.
    • -
    • preinstall: -Run BEFORE the package is installed
    • -
    • install, postinstall: -Run AFTER the package is installed.
    • -
    • preuninstall, uninstall: -Run BEFORE the package is uninstalled.
    • -
    • postuninstall: -Run AFTER the package is uninstalled.
    • -
    • preversion, version: -Run BEFORE bump the package version.
    • -
    • postversion: -Run AFTER bump the package version.
    • -
    • pretest, test, posttest: -Run by the npm test command.
    • -
    • prestop, stop, poststop: -Run by the npm stop command.
    • -
    • prestart, start, poststart: -Run by the npm start command.
    • -
    • prerestart, restart, postrestart: -Run by the npm restart command. Note: npm restart will run the -stop and start scripts if no restart script is provided.
    • -
    -

    Additionally, arbitrary scripts can be executed by running npm -run-script <pkg> <stage>. Pre and post commands with matching -names will be run for those as well (e.g. premyscript, myscript, -postmyscript).

    -

    COMMON USES

    -

    If you need to perform operations on your package before it is used, in a way -that is not dependent on the operating system or architecture of the -target system, use a prepublish script. This includes -tasks such as:

    -
      -
    • Compiling CoffeeScript source code into JavaScript.
    • -
    • Creating minified versions of JavaScript source code.
    • -
    • Fetching remote resources that your package will use.
    • -
    -

    The advantage of doing these things at prepublish time is that they can be done once, in a -single place, thus reducing complexity and variability. -Additionally, this means that:

    -
      -
    • You can depend on coffee-script as a devDependency, and thus -your users don't need to have it installed.
    • -
    • You don't need to include minifiers in your package, reducing -the size for your users.
    • -
    • You don't need to rely on your users having curl or wget or -other system tools on the target machines.
    • -
    -

    DEFAULT VALUES

    -

    npm will default some script values based on package contents.

    -
      -
    • "start": "node server.js":

      -

      If there is a server.js file in the root of your package, then npm -will default the start command to node server.js.

      -
    • -
    • "preinstall": "node-waf clean || true; node-waf configure build":

      -

      If there is a wscript file in the root of your package, npm will -default the preinstall command to compile using node-waf.

      -
    • -
    -

    USER

    -

    If npm was invoked with root privileges, then it will change the uid -to the user account or uid specified by the user config, which -defaults to nobody. Set the unsafe-perm flag to run scripts with -root privileges.

    -

    ENVIRONMENT

    -

    Package scripts run in an environment where many pieces of information -are made available regarding the setup of npm and the current state of -the process.

    -

    path

    -

    If you depend on modules that define executable scripts, like test -suites, then those executables will be added to the PATH for -executing the scripts. So, if your package.json has this:

    -
    { "name" : "foo"
    -, "dependencies" : { "bar" : "0.1.x" }
    -, "scripts": { "start" : "bar ./test" } }
    -

    then you could run npm start to execute the bar script, which is -exported into the node_modules/.bin directory on npm install.

    -

    package.json vars

    -

    The package.json fields are tacked onto the npm_package_ prefix. So, -for instance, if you had {"name":"foo", "version":"1.2.5"} in your -package.json file, then your package scripts would have the -npm_package_name environment variable set to "foo", and the -npm_package_version set to "1.2.5"

    -

    configuration

    -

    Configuration parameters are put in the environment with the -npm_config_ prefix. For instance, you can view the effective root -config by checking the npm_config_root environment variable.

    -

    Special: package.json "config" object

    -

    The package.json "config" keys are overwritten in the environment if -there is a config param of <name>[@<version>]:<key>. For example, -if the package.json has this:

    -
    { "name" : "foo"
    -, "config" : { "port" : "8080" }
    -, "scripts" : { "start" : "node server.js" } }
    -

    and the server.js is this:

    -
    http.createServer(...).listen(process.env.npm_package_config_port)
    -

    then the user could change the behavior by doing:

    -
    npm config set foo:port 80
    -

    current lifecycle event

    -

    Lastly, the npm_lifecycle_event environment variable is set to -whichever stage of the cycle is being executed. So, you could have a -single script used for different parts of the process which switches -based on what's currently happening.

    -

    Objects are flattened following this format, so if you had -{"scripts":{"install":"foo.js"}} in your package.json, then you'd -see this in the script:

    -
    process.env.npm_package_scripts_install === "foo.js"
    -

    EXAMPLES

    -

    For example, if your package.json contains this:

    -
    { "scripts" :
    -  { "install" : "scripts/install.js"
    -  , "postinstall" : "scripts/install.js"
    -  , "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 -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 -fine:

    -
    { "scripts" :
    -  { "preinstall" : "./configure"
    -  , "install" : "make && make install"
    -  , "test" : "make test"
    -  }
    -}
    -

    EXITING

    -

    Scripts are run by passing the line as a script argument to sh.

    -

    If the script exits with a code other than 0, then this will abort the -process.

    -

    Note that these script files don't have to be nodejs or even -javascript programs. They just have to be some kind of executable -file.

    -

    HOOK SCRIPTS

    -

    If you want to run a specific script at a specific lifecycle event for -ALL packages, then you can use a hook script.

    -

    Place an executable file at node_modules/.hooks/{eventname}, and -it'll get run for all packages when they are going through that point -in the package lifecycle for any packages installed in that root.

    -

    Hook scripts are run exactly the same way as package.json scripts. -That is, they are in a separate child process, with the env described -above.

    -

    BEST PRACTICES

    -
      -
    • Don't exit with a non-zero error code unless you really mean it. -Except for uninstall scripts, this will cause the npm action to -fail, and potentially be rolled back. If the failure is minor or -only will prevent some optional features, then it's better to just -print a warning and exit successfully.
    • -
    • Try not to use scripts to do what npm can do for you. Read through -package.json(5) to see all the things that you can specify and enable -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 -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 -are required for some reason, then it'll fail with that error, and -the user will sudo the npm command in question.
    • -
    • Don't use install. Use a .gyp file for compilation, and prepublish -for anything else. You should almost never have to explicitly set a -preinstall or install script. If you are doing this, please consider if -there is another option. The only valid use of install or preinstall -scripts is for compilation which must be done on the target architecture.
    • -
    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/removing-npm.html b/deps/npm/html/partial/doc/misc/removing-npm.html deleted file mode 100644 index 3b3968bfc012fa..00000000000000 --- a/deps/npm/html/partial/doc/misc/removing-npm.html +++ /dev/null @@ -1,37 +0,0 @@ -

    npm-removal

    Cleaning the Slate

    -

    SYNOPSIS

    -

    So sad to see you go.

    -
    sudo npm uninstall npm -g
    -

    Or, if that fails, get the npm source code, and do:

    -
    sudo make uninstall
    -

    More Severe Uninstalling

    -

    Usually, the above instructions are sufficient. That will remove -npm, but leave behind anything you've installed.

    -

    If that doesn't work, or if you require more drastic measures, -continue reading.

    -

    Note that this is only necessary for globally-installed packages. Local -installs are completely contained within a project's node_modules -folder. Delete that folder, and everything is gone (unless a package's -install script is particularly ill-behaved).

    -

    This assumes that you installed node and npm in the default place. If -you configured node with a different --prefix, or installed npm with a -different prefix setting, then adjust the paths accordingly, replacing -/usr/local with your install prefix.

    -

    To remove everything npm-related manually:

    -
    rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*
    -

    If you installed things with npm, then your best bet is to uninstall -them with npm first, and then install them again once you have a -proper install. This can help find any symlinks that are lying -around:

    -
    ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm
    -

    Prior to version 0.3, npm used shim files for executables and node -modules. To track those down, you can do the following:

    -
    find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;
    -

    (This is also in the README file.)

    -

    SEE ALSO

    - - diff --git a/deps/npm/html/partial/doc/misc/semver.html b/deps/npm/html/partial/doc/misc/semver.html deleted file mode 100644 index 9b763ed18caaa8..00000000000000 --- a/deps/npm/html/partial/doc/misc/semver.html +++ /dev/null @@ -1,262 +0,0 @@ -

    semver

    The semantic versioner for npm

    -

    Usage

    -
    $ npm install semver
    -
    -semver.valid('1.2.3') // '1.2.3'
    -semver.valid('a.b.c') // null
    -semver.clean('  =v1.2.3   ') // '1.2.3'
    -semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
    -semver.gt('1.2.3', '9.8.7') // false
    -semver.lt('1.2.3', '9.8.7') // true
    -

    As a command-line utility:

    -
    $ semver -h
    -
    -Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
    -Test if version(s) satisfy the supplied range(s), and sort them.
    -
    -Multiple versions or ranges may be supplied, unless increment
    -option is specified.  In that case, only a single version may
    -be used, and it is incremented by the specified level
    -
    -Program exits successfully if any valid version satisfies
    -all supplied ranges, and prints all satisfying versions.
    -
    -If no versions are valid, or ranges are not satisfied,
    -then exits failure.
    -
    -Versions are printed in ascending order, so supplying
    -multiple versions to the utility will just sort them.
    -

    Versions

    -

    A "version" is described by the v2.0.0 specification found at -http://semver.org/.

    -

    A leading "=" or "v" character is stripped off and ignored.

    -

    Ranges

    -

    A version range is a set of comparators which specify versions -that satisfy the range.

    -

    A comparator is composed of an operator and a version. The set -of primitive operators is:

    -
      -
    • < Less than
    • -
    • <= Less than or equal to
    • -
    • > Greater than
    • -
    • >= Greater than or equal to
    • -
    • = Equal. If no operator is specified, then equality is assumed, -so this operator is optional, but MAY be included.
    • -
    -

    For example, the comparator >=1.2.7 would match the versions -1.2.7, 1.2.8, 2.5.3, and 1.3.9, but not the versions 1.2.6 -or 1.1.0.

    -

    Comparators can be joined by whitespace to form a comparator set, -which is satisfied by the intersection of all of the comparators -it includes.

    -

    A range is composed of one or more comparator sets, joined by ||. A -version matches a range if and only if every comparator in at least -one of the ||-separated comparator sets is satisfied by the version.

    -

    For example, the range >=1.2.7 <1.3.0 would match the versions -1.2.7, 1.2.8, and 1.2.99, but not the versions 1.2.6, 1.3.0, -or 1.1.0.

    -

    The range 1.2.7 || >=1.2.9 <2.0.0 would match the versions 1.2.7, -1.2.9, and 1.4.6, but not the versions 1.2.8 or 2.0.0.

    -

    Prerelease Tags

    -

    If a version has a prerelease tag (for example, 1.2.3-alpha.3) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same [major, minor, patch] tuple also has a -prerelease tag.

    -

    For example, the range >1.2.3-alpha.3 would be allowed to match the -version 1.2.3-alpha.7, but it would not be satisfied by -3.4.5-alpha.9, even though 3.4.5-alpha.9 is technically "greater -than" 1.2.3-alpha.3 according to the SemVer sort rules. The version -range only accepts prerelease tags on the 1.2.3 version. The -version 3.4.5 would satisfy the range, because it does not have a -prerelease flag, and 3.4.5 is greater than 1.2.3-alpha.7.

    -

    The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics.

    -

    Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use that specific set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the next set of prerelease versions.

    -

    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')
    -'1.2.4-beta.0'
    -
    -

    command-line example:

    -
    $ semver 1.2.3 -i prerelease --preid beta
    -1.2.4-beta.0
    -
    -

    Which then can be used to increment further:

    -
    $ semver 1.2.4-beta.0 -i prerelease
    -1.2.4-beta.1
    -
    -

    Advanced Range Syntax

    -

    Advanced range syntax desugars to primitive comparators in -deterministic ways.

    -

    Advanced ranges may be combined in the same way as primitive -comparators using white space or ||.

    -

    Hyphen Ranges X.Y.Z - A.B.C

    -

    Specifies an inclusive set.

    -
      -
    • 1.2.3 - 2.3.4 := >=1.2.3 <=2.3.4
    • -
    -

    If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes.

    -
      -
    • 1.2 - 2.3.4 := >=1.2.0 <=2.3.4
    • -
    -

    If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts.

    -
      -
    • 1.2.3 - 2.3 := >=1.2.3 <2.4.0
    • -
    • 1.2.3 - 2 := >=1.2.3 <3.0.0
    • -
    -

    X-Ranges 1.2.x 1.X 1.2.* *

    -

    Any of X, x, or * may be used to "stand in" for one of the -numeric values in the [major, minor, patch] tuple.

    -
      -
    • * := >=0.0.0 (Any version satisfies)
    • -
    • 1.x := >=1.0.0 <2.0.0 (Matching major version)
    • -
    • 1.2.x := >=1.2.0 <1.3.0 (Matching major and minor versions)
    • -
    -

    A partial version range is treated as an X-Range, so the special -character is in fact optional.

    -
      -
    • "" (empty string) := * := >=0.0.0
    • -
    • 1 := 1.x.x := >=1.0.0 <2.0.0
    • -
    • 1.2 := 1.2.x := >=1.2.0 <1.3.0
    • -
    -

    Tilde Ranges ~1.2.3 ~1.2 ~1

    -

    Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not.

    -
      -
    • ~1.2.3 := >=1.2.3 <1.(2+1).0 := >=1.2.3 <1.3.0
    • -
    • ~1.2 := >=1.2.0 <1.(2+1).0 := >=1.2.0 <1.3.0 (Same as 1.2.x)
    • -
    • ~1 := >=1.0.0 <(1+1).0.0 := >=1.0.0 <2.0.0 (Same as 1.x)
    • -
    • ~0.2.3 := >=0.2.3 <0.(2+1).0 := >=0.2.3 <0.3.0
    • -
    • ~0.2 := >=0.2.0 <0.(2+1).0 := >=0.2.0 <0.3.0 (Same as 0.2.x)
    • -
    • ~0 := >=0.0.0 <(0+1).0.0 := >=0.0.0 <1.0.0 (Same as 0.x)
    • -
    • ~1.2.3-beta.2 := >=1.2.3-beta.2 <1.3.0 Note that prereleases in -the 1.2.3 version will be allowed, if they are greater than or -equal to beta.2. So, 1.2.3-beta.4 would be allowed, but -1.2.4-beta.2 would not, because it is a prerelease of a -different [major, minor, patch] tuple.
    • -
    -

    Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

    -

    Allows changes that do not modify the left-most non-zero digit in the -[major, minor, patch] tuple. In other words, this allows patch and -minor updates for versions 1.0.0 and above, patch updates for -versions 0.X >=0.1.0, and no updates for versions 0.0.X.

    -

    Many authors treat a 0.x version as if the x were the major -"breaking-change" indicator.

    -

    Caret ranges are ideal when an author may make breaking changes -between 0.2.4 and 0.3.0 releases, which is a common practice. -However, it presumes that there will not be breaking changes between -0.2.4 and 0.2.5. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices.

    -
      -
    • ^1.2.3 := >=1.2.3 <2.0.0
    • -
    • ^0.2.3 := >=0.2.3 <0.3.0
    • -
    • ^0.0.3 := >=0.0.3 <0.0.4
    • -
    • ^1.2.3-beta.2 := >=1.2.3-beta.2 <2.0.0 Note that prereleases in -the 1.2.3 version will be allowed, if they are greater than or -equal to beta.2. So, 1.2.3-beta.4 would be allowed, but -1.2.4-beta.2 would not, because it is a prerelease of a -different [major, minor, patch] tuple.
    • -
    • ^0.0.3-beta := >=0.0.3-beta <0.0.4 Note that prereleases in the -0.0.3 version only will be allowed, if they are greater than or -equal to beta. So, 0.0.3-pr.2 would be allowed.
    • -
    -

    When parsing caret ranges, a missing patch value desugars to the -number 0, but will allow flexibility within that value, even if the -major and minor versions are both 0.

    -
      -
    • ^1.2.x := >=1.2.0 <2.0.0
    • -
    • ^0.0.x := >=0.0.0 <0.1.0
    • -
    • ^0.0 := >=0.0.0 <0.1.0
    • -
    -

    A missing minor and patch values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero.

    -
      -
    • ^1.x := >=1.0.0 <2.0.0
    • -
    • ^0.x := >=0.0.0 <1.0.0
    • -
    -

    Functions

    -

    All methods and classes take a final loose boolean argument that, if -true, will be more forgiving about not-quite-valid semver strings. -The resulting output will always be 100% strict, of course.

    -

    Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse.

    -
      -
    • valid(v): Return the parsed version, or null if it's not valid.
    • -
    • inc(v, release): Return the version incremented by the release -type (major, premajor, minor, preminor, patch, -prepatch, or prerelease), or null if it's not valid
        -
      • premajor in one call will bump the version up to the next major -version and down to a prerelease of that major version. -preminor, and prepatch work the same way.
      • -
      • If called from a non-prerelease version, the prerelease will work the -same as prepatch. It increments the patch version, then makes a -prerelease. If the input version is already a prerelease it simply -increments it.
      • -
      -
    • -
    • major(v): Return the major version number.
    • -
    • minor(v): Return the minor version number.
    • -
    • patch(v): Return the patch version number.
    • -
    -

    Comparison

    -
      -
    • gt(v1, v2): v1 > v2
    • -
    • gte(v1, v2): v1 >= v2
    • -
    • lt(v1, v2): v1 < v2
    • -
    • lte(v1, v2): v1 <= v2
    • -
    • eq(v1, v2): v1 == v2 This is true if they're logically equivalent, -even if they're not the exact same string. You already know how to -compare strings.
    • -
    • neq(v1, v2): v1 != v2 The opposite of eq.
    • -
    • cmp(v1, comparator, v2): Pass in a comparison string, and it'll call -the corresponding function above. "===" and "!==" do simple -string comparison, but are included for completeness. Throws if an -invalid comparison string is provided.
    • -
    • compare(v1, v2): Return 0 if v1 == v2, or 1 if v1 is greater, or -1 if -v2 is greater. Sorts in ascending order if passed to Array.sort().
    • -
    • rcompare(v1, v2): The reverse of compare. Sorts an array of versions -in descending order when passed to Array.sort().
    • -
    • diff(v1, v2): Returns difference between two versions by the release type -(major, premajor, minor, preminor, patch, prepatch, or prerelease), -or null if the versions are the same.
    • -
    -

    Ranges

    -
      -
    • validRange(range): Return the valid range or null if it's not valid
    • -
    • satisfies(version, range): Return true if the version satisfies the -range.
    • -
    • maxSatisfying(versions, range): Return the highest version in the list -that satisfies the range, or null if none of them do.
    • -
    • gtr(version, range): Return true if version is greater than all the -versions possible in the range.
    • -
    • ltr(version, range): Return true if version is less than all the -versions possible in the range.
    • -
    • outside(version, range, hilo): Return true if the version is outside -the bounds of the range in either the high or low direction. The -hilo argument must be either the string '>' or '<'. (This is -the function called by gtr and ltr.)
    • -
    -

    Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, or satisfy a range! For -example, the range 1.2 <1.2.9 || >2.0.0 would have a hole from 1.2.9 -until 2.0.0, so the version 1.2.10 would not be greater than the -range (because 2.0.1 satisfies, which is higher), nor less than the -range (since 1.2.8 satisfies, which is lower), and it also does not -satisfy the range.

    -

    If you want to know if a version satisfies or does not satisfy a -range, use the satisfies(version, range) function.

    - diff --git a/deps/npm/lib/access.js b/deps/npm/lib/access.js index cf960a67d8b8aa..158ce50544f1c4 100644 --- a/deps/npm/lib/access.js +++ b/deps/npm/lib/access.js @@ -1,123 +1,127 @@ -var assert = require("assert") -var resolve = require("path").resolve -var url = require("url") +'use strict' -var log = require("npmlog") -var readPackageJson = require("read-package-json") +var resolve = require('path').resolve -var mapToRegistry = require("./utils/map-to-registry.js") -var npa = require("npm-package-arg") -var npm = require("./npm.js") +var readPackageJson = require('read-package-json') +var mapToRegistry = require('./utils/map-to-registry.js') +var npm = require('./npm.js') + +var whoami = require('./whoami') module.exports = access -access.usage = "npm access public []" - + "\nnpm access restricted []" - + "\nnpm access add []" - + "\nnpm access rm []" - + "\nnpm access ls []" - + "\nnpm access edit []" +access.usage = + 'npm access public []\n' + + 'npm access restricted []\n' + + 'npm access grant []\n' + + 'npm access revoke []\n' + + 'npm access ls-packages [||]\n' + + 'npm access ls-collaborators [ []]\n' + + 'npm access edit []' + +access.subcommands = ['public', 'restricted', 'grant', 'revoke', + 'ls-packages', 'ls-collaborators', 'edit'] access.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length === 2) { - return cb(null, ["public", "restricted", "add", "rm", "ls", "edit"]) + return cb(null, access.subcommands) } switch (argv[2]) { - case "public": - case "restricted": - case "ls": - case "edit": - return cb(new Error("unimplemented: packages you can change")) - case "add": - if (argv.length === 3) return cb(null, ["read-only", "read-write"]) - - return cb(new Error("unimplemented: entities and packages")) - case "rm": - return cb(new Error("unimplemented: entities and packages")) + case 'grant': + if (argv.length === 3) { + return cb(null, ['read-only', 'read-write']) + } else { + return cb(null, []) + } + break + case 'public': + case 'restricted': + case 'ls-packages': + case 'ls-collaborators': + case 'edit': + return cb(null, []) + case 'revoke': + return cb(null, []) default: - return cb(new Error(argv[2]+" not recognized")) + return cb(new Error(argv[2] + ' not recognized')) } } function access (args, cb) { var cmd = args.shift() - switch (cmd) { - case "public": case "restricted": return changeAccess(args, cmd, cb) - case "add": case "set": return add(args, cb) - case "rm": case "del": case "clear": return rm(args, cb) - case "list": case "sl": case "ls": return ls(args, cb) - case "edit": case "ed": return edit(args, cb) - default: return cb("Usage:\n"+access.usage) - } -} - -function changeAccess (args, level, cb) { - assert(Array.isArray(args), "changeAccess requires args be an array") - assert( - ["public", "restricted"].indexOf(level) !== -1, - "access level must be either 'public' or 'restricted'" - ) - assert(typeof cb === "function", "changeAccess requires a callback") - - var p = (args.shift() || "").trim() - if (!p) return getCurrentPackage(level, cb) - changeAccess_(p, level, cb) -} - -function getCurrentPackage (level, cb) { - var here = resolve(npm.prefix, "package.json") - log.verbose("setPackageLevel", "here", here) - - readPackageJson(here, function (er, data) { - if (er) return cb(er) - - if (!data.name) { - return cb(new Error("Package must be named")) - } - - changeAccess_(data.name, level, cb) + var params + return parseParams(cmd, args, function (err, p) { + if (err) { return cb(err) } + params = p + return mapToRegistry(params.package, npm.config, invokeCmd) }) -} -function changeAccess_ (name, level, cb) { - log.verbose("changeAccess", "name", name, "level", level) - mapToRegistry(name, npm.config, function (er, uri, auth, base) { - if (er) return cb(er) - - var data = npa(name) - if (!data.scope) { - var msg = "Sorry, you can't change the access level of unscoped packages." - log.error("access", msg) - return cb(new Error(msg)) - } - - // name must be scoped, so escape separator - name = name.replace("/", "%2f") - // FIXME: mapToRegistry still isn't generic enough SIGH - uri = url.resolve(base, "-/package/"+name+"/access") - var params = { - level : level, - auth : auth + function invokeCmd (err, uri, auth, base) { + if (err) { return cb(err) } + params.auth = auth + try { + return npm.registry.access(cmd, uri, params, function (err, data) { + !err && data && console.log(JSON.stringify(data, undefined, 2)) + cb(err, data) + }) + } catch (e) { + cb(e.message + '\n\nUsage:\n' + access.usage) } - - npm.registry.access(uri, params, cb) - }) -} - -function add (args, cb) { - return cb(new Error("npm access add isn't implemented yet!")) + } } -function rm (args, cb) { - return cb(new Error("npm access rm isn't implemented yet!")) -} +function parseParams (cmd, args, cb) { + // 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() + } + if (['grant', 'revoke', 'ls-packages'].indexOf(cmd) !== -1) { + var entity = (args.shift() || '').split(':') + params.scope = entity[0] + params.team = entity[1] + } -function ls (args, cb) { - return cb(new Error("npm access ls isn't implemented yet!")) + if (cmd === 'ls-packages') { + if (!params.scope) { + whoami([], true, function (err, scope) { + params.scope = scope + cb(err, params) + }) + } else { + 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 edit (args, cb) { - return cb(new Error("npm access edit isn't implemented yet!")) +function getPackage (name, cb) { + if (name && name.trim()) { + cb(null, name.trim()) + } else { + readPackageJson( + resolve(npm.prefix, 'package.json'), + 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 f59372a296ccf0..42c029efb1b84b 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -8,7 +8,7 @@ var log = require("npmlog") , crypto try { - crypto = process.binding("crypto") && require("crypto") + crypto = require("crypto") } catch (ex) {} adduser.usage = "npm adduser\nThen enter stuff at the prompts" @@ -169,7 +169,9 @@ function save (c, u, cb) { }) } - 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/build.js b/deps/npm/lib/build.js index c5ee76e5c851c4..1f2d2efceb4618 100644 --- a/deps/npm/lib/build.js +++ b/deps/npm/lib/build.js @@ -122,10 +122,10 @@ function shouldWarn(pkg, folder, global, cb) { // current searched package is the linked package on first call if (linkedPkg !== currentPkg) { - if (!topPkg.dependencies) return cb() - // don't generate a warning if it's listed in dependencies - if (Object.keys(topPkg.dependencies).indexOf(currentPkg) === -1) { + 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") diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 2e11be32f862fa..851636c3c17ae9 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -337,6 +337,7 @@ function afterAdd (cb) { return function (er, data) { // 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) @@ -347,7 +348,7 @@ function afterAdd (cb) { return function (er, data) { 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) + 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..f078039e357867 100644 --- a/deps/npm/lib/cache/add-local-tarball.js +++ b/deps/npm/lib/cache/add-local-tarball.js @@ -13,7 +13,7 @@ var mkdir = require("mkdirp") , chownr = require("chownr") , inflight = require("inflight") , once = require("once") - , writeStream = require("fs-write-stream-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") , randomBytes = require("crypto").pseudoRandomBytes // only need uniqueness module.exports = addLocalTarball @@ -166,7 +166,7 @@ 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) }) diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js index 64a4670b0cd321..acc67bf9d26d4f 100644 --- a/deps/npm/lib/cache/add-named.js +++ b/deps/npm/lib/cache/add-named.js @@ -193,6 +193,12 @@ function addNameVersion (name, v, data, cb) { var rp = url.parse(ruri) if (tb.hostname === rp.hostname && tb.protocol !== rp.protocol) { tb.protocol = rp.protocol + // If a different port is associated with the other protocol + // we need to update that as well + if (rp.port !== tb.port) { + tb.port = rp.port + delete tb.host + } delete tb.href } tb = url.format(tb) diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js index 66d22009663307..d04e9da5090dd9 100644 --- a/deps/npm/lib/cache/add-remote-tarball.js +++ b/deps/npm/lib/cache/add-remote-tarball.js @@ -4,7 +4,8 @@ var mkdir = require("mkdirp") , path = require("path") , sha = require("sha") , retry = require("retry") - , createWriteStream = require("fs-write-stream-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") + , PassThrough = require('readable-stream').PassThrough , npm = require("../npm.js") , inflight = require("inflight") , addLocalTarball = require("./add-local-tarball.js") @@ -78,8 +79,8 @@ function fetchAndShaCheck (u, tmp, shasum, auth, cb) { 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() }) @@ -105,6 +106,15 @@ function fetchAndShaCheck (u, tmp, shasum, auth, cb) { }) }) - 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/completion.js b/deps/npm/lib/completion.js index 1d26ffcf8ac92d..c85a42de640194 100644 --- a/deps/npm/lib/completion.js +++ b/deps/npm/lib/completion.js @@ -47,10 +47,10 @@ completion.completion = function (opts, cb) { } 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) } diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index 916ebd6afeff45..19c5dd062906e6 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -26,13 +26,13 @@ link.completion = function (opts, cb) { } function link (args, cb) { - if (process.platform === "win32") { - var semver = require("semver") - if (!semver.satisfies(process.version, ">=0.7.9")) { - var msg = "npm link not supported on windows prior to node 0.7.9" - , e = new Error(msg) - e.code = "ENOTSUP" - e.errno = require("constants").ENOTSUP + if (process.platform === 'win32') { + var semver = require('semver') + if (!semver.gte(process.version, '0.7.9')) { + var msg = 'npm link not supported on windows prior to node 0.7.9' + var e = new Error(msg) + e.code = 'ENOTSUP' + e.errno = require('constants').ENOTSUP return cb(e) } } @@ -97,14 +97,13 @@ function linkInstall (pkgs, cb) { function next () { chain - ( [ [npm.commands, "unbuild", [target]] - , [function (cb) { + ( [ [function (cb) { log.verbose("link", "symlinking %s to %s", pp, target) cb() }] , [symlink, pp, target] - // do run lifecycle scripts - full build here. - , rp && [build, [target]] + // do not run any scripts + , rp && [build, [target], npm.config.get("global"), build._noLC, true] , [ resultPrinter, pkg, pp, target, rp ] ] , cb ) } diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index c7877b925e6be7..caba4900547dc9 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -111,10 +111,15 @@ 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 (typeof depth === 'undefined') depth = 0 if (!noname && data.name) lite.name = data.name if (data.version) lite.version = data.version if (data.extraneous) { @@ -163,7 +168,20 @@ function getLite (data, noname) { + ", required by " + data.name + "@" + data.version 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) { diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 97cdad4de264bc..cbd6893470ba2d 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -113,6 +113,7 @@ var commandCache = {} , "unpublish" , "owner" , "access" + , "team" , "deprecate" , "shrinkwrap" @@ -282,8 +283,14 @@ npm.load = function (cli, cb_) { npm.config.loaded = true loaded = true loadCb(loadErr = er) - if (onload = onload && npm.config.get("onload-script")) { - require(onload) + 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 } } diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index ab49d109690ee6..331809c9975072 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -252,6 +252,7 @@ function outdated_ (args, dir, parentHas, depth, cb) { has = Object.create(parentHas) pvs.forEach(function (pv) { has[pv[0]] = { + link: data.dependencies[pv[0]].link, version: pv[1], from: pv[2] } @@ -311,6 +312,9 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { if (parsed.type === "git" || (parsed.hosted && parsed.hosted.type === "github")) { return doIt("git", "git") } + if (curr && curr.link) { + return doIt("linked", "linked") + } // search for the latest package mapToRegistry(dep, npm.config, function (er, uri, auth) { diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index a5ce90094f6a3a..ab81cc20f61c72 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -11,7 +11,7 @@ var npm = require("./npm.js") , chain = require("slide").chain , path = require("path") , cwd = process.cwd() - , writeStream = require('fs-write-stream-atomic') + , writeStreamAtomic = require('fs-write-stream-atomic') , cachedPackageRoot = require("./cache/cached-package-root.js") pack.usage = "npm pack " @@ -52,7 +52,7 @@ function pack_ (pkg, cb) { var cached = path.join(cachedPackageRoot(data), "package.tgz") , from = fs.createReadStream(cached) - , to = writeStream(fname) + , to = writeStreamAtomic(fname) , errState = null from.on("error", cb_) diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 057af2bc69cb73..2c805615a42e3a 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -62,7 +62,7 @@ function runScript (args, cb) { function list(cb) { var json = path.join(npm.localPrefix, "package.json") var cmdList = [ "publish", "install", "uninstall" - , "test", "stop", "start", "restart" + , "test", "stop", "start", "restart", "version" ].reduce(function (l, p) { return l.concat(["pre" + p, p, "post" + p]) }, []) diff --git a/deps/npm/lib/team.js b/deps/npm/lib/team.js new file mode 100644 index 00000000000000..324d8df5e22848 --- /dev/null +++ b/deps/npm/lib/team.js @@ -0,0 +1,54 @@ +var mapToRegistry = require('./utils/map-to-registry.js') +var npm = require('./npm') + +module.exports = team + +team.subcommands = ['create', 'destroy', 'add', 'rm', 'ls', 'edit'] + +team.usage = + 'npm team create \n' + + 'npm team destroy \n' + + 'npm team add \n' + + 'npm team rm \n' + + 'npm team ls |\n' + + 'npm team edit ' + +team.completion = function (opts, cb) { + var argv = opts.conf.argv.remain + if (argv.length === 2) { + return cb(null, team.subcommands) + } + switch (argv[2]) { + case 'ls': + case 'create': + case 'destroy': + case 'add': + case 'rm': + case 'edit': + return cb(null, []) + default: + return cb(new Error(argv[2] + ' not recognized')) + } +} + +function team (args, cb) { + // Entities are in the format : + var cmd = args.shift() + var entity = (args.shift() || '').split(':') + return mapToRegistry('/', npm.config, function (err, uri, auth) { + if (err) { return cb(err) } + try { + return npm.registry.team(cmd, uri, { + auth: auth, + scope: entity[0], + team: entity[1], + user: args.shift() + }, function (err, data) { + !err && data && console.log(JSON.stringify(data, undefined, 2)) + cb(err, data) + }) + } catch (e) { + cb(e.message + '\n\nUsage:\n' + team.usage) + } + }) +} diff --git a/deps/npm/lib/utils/completion.sh b/deps/npm/lib/utils/completion.sh index 3c7a3590d80f71..25bef2c17b4b29 100755 --- a/deps/npm/lib/utils/completion.sh +++ b/deps/npm/lib/utils/completion.sh @@ -7,17 +7,21 @@ # Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm # -COMP_WORDBREAKS=${COMP_WORDBREAKS/=/} -COMP_WORDBREAKS=${COMP_WORDBREAKS/@/} -export COMP_WORDBREAKS - if type complete &>/dev/null; then _npm_completion () { + local words cword + if type _get_comp_words_by_ref &>/dev/null; then + _get_comp_words_by_ref -n = -n @ -w words -i cword + else + cword="$COMP_CWORD" + words=("${COMP_WORDS[@]}") + fi + local si="$IFS" - IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \ + IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ COMP_LINE="$COMP_LINE" \ COMP_POINT="$COMP_POINT" \ - npm completion -- "${COMP_WORDS[@]}" \ + npm completion -- "${words[@]}" \ 2>/dev/null)) || return $? IFS="$si" } 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/error-handler.js b/deps/npm/lib/utils/error-handler.js index 6ffb2867e2780c..e5daf2066ee9c7 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -11,7 +11,7 @@ var cbCalled = false , exitCode = 0 , rollbacks = npm.rollbacks , chain = require("slide").chain - , writeStream = require("fs-write-stream-atomic") + , writeStreamAtomic = require("fs-write-stream-atomic") , nameValidator = require("validate-npm-package-name") @@ -187,8 +187,10 @@ function errorHandler (er) { ,"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 + ,'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 @@ -366,6 +368,14 @@ function errorHandler (er) { ].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:" @@ -383,7 +393,7 @@ function writeLogFile (cb) { writingLogFile = true wroteLogFile = true - var fstr = writeStream("npm-debug.log") + var fstr = writeStreamAtomic("npm-debug.log") , os = require("os") , out = "" diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index a6f2b98e88d2f3..9805a1c0c1dc45 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -196,12 +196,12 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { conf.gid = gid ^ 0 } - var sh = "sh" - var shFlag = "-c" + var sh = 'sh' + var shFlag = '-c' - if (process.platform === "win32") { - sh = process.env.comspec || "cmd" - shFlag = "/c" + if (process.platform === 'win32') { + sh = process.env.comspec || 'cmd' + shFlag = '/d /s /c' conf.windowsVerbatimArguments = true } @@ -313,7 +313,9 @@ function makeEnv (data, prefix, env) { , verPref = data.name + "@" + data.version + ":" keys.forEach(function (i) { - if (i.charAt(0) === "_" && i.indexOf("_"+namePref) !== 0) { + // in some rare cases (e.g. working with nerf darts), there are segmented + // "private" (underscore-prefixed) config names -- don't export + if (i.charAt(0) === '_' && i.indexOf('_' + namePref) !== 0 || i.match(/:_/)) { return } var value = npm.config.get(i) diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index b33392488f3765..7b6eec0ce9f296 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -141,7 +141,7 @@ function dump (data, cb) { function checkGit (localData, cb) { fs.stat(path.join(npm.localPrefix, '.git'), function (er, s) { - var doGit = !er && s.isDirectory() && npm.config.get('git-tag-version') + var doGit = !er && npm.config.get('git-tag-version') if (!doGit) { if (er) log.verbose('version', 'error checking for .git', er) log.verbose('version', 'not tagging in git') @@ -180,13 +180,14 @@ function checkGit (localData, cb) { } function _commit (version, hasShrinkwrap, 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), + git.chainableExec([ 'add', packagePath ], options), 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) diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index d92a6574a181e4..bef0184a0065bd 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -40,7 +40,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( - "'npm whoami' 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/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index 997fa50f29a2da..b95f97c843cd5c 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "July 2015" "" "" +.TH "NPM" "1" "March 2016" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P @@ -14,9 +14,20 @@ 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 comes with node \fIhttp://nodejs\.org/download/\fR now\. +npm is bundled with node \fIhttp://nodejs\.org/download/\fR\|\. .SS Windows Computers .P Get the MSI \fIhttp://nodejs\.org/download/\fR\|\. npm is in it\. @@ -131,53 +142,6 @@ 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, @@ -187,45 +151,6 @@ 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: diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index f1d7272469bf21..97e3f4063f30f3 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" "July 2015" "" "" +.TH "NPM\-ACCESS" "1" "March 2016" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SH SYNOPSIS @@ -8,10 +8,11 @@ npm access public [] npm access restricted [] -npm access add [] -npm access rm [] +npm access grant [] +npm access revoke [] -npm access ls [] +npm access ls\-packages [||] +npm access ls\-collaborators [ []] npm access edit [] .fi .RE @@ -27,13 +28,19 @@ subcommand\. public / restricted: Set a package to be either publicly accessible or restricted\. .IP \(bu 2 -add / rm: +grant / revoke: Add or remove the ability of users and teams to have read\-only or read\-write access to a package\. .IP \(bu 2 -ls: +ls\-packages: +Show all of the packages a user or a team is able to access, along with the +access level, except for read\-only public packages (it won't print the whole +registry listing) +.IP \(bu 2 +ls\-collaborators: Show all of the access privileges for a package\. Will only show permissions -for packages to which you have at least read access\. +for packages to which you have at least read access\. If \fB\fP is passed in, +the list is filtered only to teams \fIthat\fR user happens to belong to\. .IP \(bu 2 edit: Set the access privileges for a package at once using \fB$EDITOR\fP\|\. @@ -65,9 +72,13 @@ of a team or directly as an owner\. If your account is not paid, then attempts to publish scoped packages will fail with an HTTP 402 status code (logically enough), unless you use \fB\-\-access=public\fP\|\. +.P +Management of teams and team memberships is done with the \fBnpm team\fP command\. .SH SEE ALSO .RS 0 .IP \(bu 2 +npm help team +.IP \(bu 2 npm help publish .IP \(bu 2 npm help 7 config diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index ade506ef539ecb..9b7b02fe0ee0d4 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" "July 2015" "" "" +.TH "NPM\-ADDUSER" "1" "March 2016" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS @@ -29,7 +29,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\|\. diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 6250b242ff475e..41dd7da33a79a2 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "July 2015" "" "" +.TH "NPM\-BIN" "1" "March 2016" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index fde8d06191b254..6326dcaffcf33b 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "July 2015" "" "" +.TH "NPM\-BUGS" "1" "March 2016" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index d17fe158c82ede..2b0ae08978c79a 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUILD" "1" "July 2015" "" "" +.TH "NPM\-BUILD" "1" "March 2016" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 04bd9694272ff0..4931522248af43 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" "July 2015" "" "" +.TH "NPM\-BUNDLE" "1" "March 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 5c84c222a629c7..ad1dcd6ede9d29 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" "July 2015" "" "" +.TH "NPM\-CACHE" "1" "March 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 15a8a21a0d1891..1141524cc33274 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "July 2015" "" "" +.TH "NPM\-COMPLETION" "1" "March 2016" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 75c458ddbdb5ef..0f39f09eb473c9 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "July 2015" "" "" +.TH "NPM\-CONFIG" "1" "March 2016" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 587cfb7ac5d2ec..af6344135010d1 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "July 2015" "" "" +.TH "NPM\-DEDUPE" "1" "March 2016" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index ae01b145a48e51..d0fee5dc4eb7ef 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "July 2015" "" "" +.TH "NPM\-DEPRECATE" "1" "March 2016" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 51444feee39bbc..056a5cd77d08aa 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" "July 2015" "" "" +.TH "NPM\-DIST\-TAG" "1" "March 2016" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SH SYNOPSIS @@ -47,16 +47,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 +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 -A project might choose to have multiple streams of development, e\.g\., -"stable", "canary"\. +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 +101,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 fa164136c50943..69d329ec5ba4cd 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" "July 2015" "" "" +.TH "NPM\-DOCS" "1" "March 2016" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index ac1857bc3d74e0..2e60f1c4029467 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "July 2015" "" "" +.TH "NPM\-EDIT" "1" "March 2016" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 40d02a1c870fbd..2de76b533e754d 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "July 2015" "" "" +.TH "NPM\-EXPLORE" "1" "March 2016" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 08d94430442569..d21cd4ceecbd74 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "July 2015" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "March 2016" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS @@ -24,7 +24,7 @@ command directly\. .IP \(bu 2 Type: Boolean .IP \(bu 2 -Default false +Default: false .RE .P diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 2a529a5d7e88be..daff3a0e618ee7 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "July 2015" "" "" +.TH "NPM\-HELP" "1" "March 2016" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index d8886630f9e105..3b7eb856eae73e 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" "July 2015" "" "" +.TH "NPM\-INIT" "1" "March 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..8b99c9af98ac92 --- /dev/null +++ b/deps/npm/man/man1/npm-install-test.1 @@ -0,0 +1,32 @@ +.TH "NPM" "" "February 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 6639b6992646ac..8555ffea5a2cd4 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "July 2015" "" "" +.TH "NPM\-INSTALL" "1" "March 2016" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS @@ -25,7 +25,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,7 +33,7 @@ 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 @@ -52,7 +52,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\|\. @@ -85,7 +86,7 @@ after packing it up into a tarball (b)\. .IP \(bu 2 \fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-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: @@ -402,9 +403,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 8a0c843fa2fcb5..f5c2e3f949144e 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "July 2015" "" "" +.TH "NPM\-LINK" "1" "March 2016" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 379b9b030622a9..8afdb2c16b8b5b 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "July 2015" "" "" +.TH "NPM\-LOGOUT" "1" "March 2016" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SH SYNOPSIS @@ -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 b7775375c1949d..583be070b1864f 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "July 2015" "" "" +.TH "NPM\-LS" "1" "March 2016" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS @@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@2.13.3 /path/to/npm +npm@2.14.20 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 01b44601404174..f791dc8332b109 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "July 2015" "" "" +.TH "NPM\-OUTDATED" "1" "March 2016" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS @@ -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 c6ef75bb35ce68..fa70604268ae51 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "July 2015" "" "" +.TH "NPM\-OWNER" "1" "March 2016" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index a630def97a034b..04cf11bc3c057b 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "July 2015" "" "" +.TH "NPM\-PACK" "1" "March 2016" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 098e82cfb67096..8b776bedcad8bd 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" "July 2015" "" "" +.TH "NPM\-PING" "1" "March 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 1bc68d0c0d1e2e..88991c72e62ee0 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" "July 2015" "" "" +.TH "NPM\-PREFIX" "1" "March 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 937fbb34f13e3c..47bb00a89237dd 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "July 2015" "" "" +.TH "NPM\-PRUNE" "1" "March 2016" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS @@ -25,7 +25,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 a6cab551937449..2911160ce457ec 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "July 2015" "" "" +.TH "NPM\-PUBLISH" "1" "March 2016" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS @@ -11,9 +11,11 @@ npm publish [\-\-tag ] [\-\-access ] .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 is present\. 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 +32,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 7e890d50b5fecd..21f54f67c9fc7e 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "July 2015" "" "" +.TH "NPM\-REBUILD" "1" "March 2016" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 477f87a3c5fa36..0ca8a95f7cfbb4 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "July 2015" "" "" +.TH "NPM\-REPO" "1" "March 2016" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index bbfd94f741cc4a..54ab5c92bcba6a 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" "July 2015" "" "" +.TH "NPM\-RESTART" "1" "March 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 index 784d7e283f4eba..2f60c6d73f5997 100644 --- a/deps/npm/man/man1/npm-rm.1 +++ b/deps/npm/man/man1/npm-rm.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RM" "1" "July 2015" "" "" +.TH "NPM\-RM" "1" "March 2016" "" "" .SH "NAME" \fBnpm-rm\fR \- Remove a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 7f3c87b76e19d7..9460a4c99ba189 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "July 2015" "" "" +.TH "NPM\-ROOT" "1" "March 2016" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 51c94d9d41c7ac..f2ea36cf28e54d 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "July 2015" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "March 2016" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index d9110550944f0e..f7c1b2af112d71 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "July 2015" "" "" +.TH "NPM\-SEARCH" "1" "March 2016" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 7b3569a172a95c..ac628d3853a307 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" "July 2015" "" "" +.TH "NPM\-SHRINKWRAP" "1" "March 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" } } } diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index d28d81168b065f..9ac6acaad77ee5 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "July 2015" "" "" +.TH "NPM\-STAR" "1" "March 2016" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 0f6c5342e8c542..5c4bf1605e639f 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "July 2015" "" "" +.TH "NPM\-STARS" "1" "March 2016" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 55e2e9c7f20351..36f26f96224cfc 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" "July 2015" "" "" +.TH "NPM\-START" "1" "March 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 b4d12d6b7797a3..d4e5dcb993d411 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" "July 2015" "" "" +.TH "NPM\-STOP" "1" "March 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 606270e9b46868..df4375f440d32f 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TAG" "1" "July 2015" "" "" +.TH "NPM\-TAG" "1" "March 2016" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 new file mode 100644 index 00000000000000..c7ede914b38f6b --- /dev/null +++ b/deps/npm/man/man1/npm-team.1 @@ -0,0 +1,63 @@ +.TH "NPM\-TEAM" "1" "March 2016" "" "" +.SH "NAME" +\fBnpm-team\fR \- Manage organization teams and team memberships +.SH SYNOPSIS +.P +.RS 2 +.nf +npm team create +npm team destroy + +npm team add +npm team rm + +npm team ls | + +npm team edit +.fi +.RE +.SH DESCRIPTION +.P +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 +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 +\fBfoo:developers\fP in these commands\. +.RS 0 +.IP \(bu 2 +create / destroy: +Create a new team, or destroy an existing one\. +.IP \(bu 2 +add / rm: +Add a user to an existing team, or remove a user from a team they belong to\. +.IP \(bu 2 +ls: +If performed on an organization name, will return a list of existing teams +under that organization\. If performed on a team, it will instead return a list +of all users belonging to that particular team\. + +.RE +.SH DETAILS +.P +\fBnpm team\fP always operates directly on the current registry, configurable from +the command line using \fB\-\-registry=\fP\|\. +.P +In order to create teams and manage team membership, you must be a \fIteam admin\fR +under the given organization\. Listing teams and team memberships may be done by +any member of the organizations\. +.P +Organization creation and management of team admins and \fIorganization\fR members +is done through the website, not the npm CLI\. +.P +To use teams to manage permissions on packages belonging to your organization, +use the \fBnpm access\fP command to grant or revoke the appropriate permissions\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help access +.IP \(bu 2 +npm help 7 registr + +.RE diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 658b8e9cce75fc..b72ed3a1e5518e 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" "July 2015" "" "" +.TH "NPM\-TEST" "1" "March 2016" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 11bb0c235ffe94..5e98f6e4879567 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,6 +1,6 @@ -.TH "NPM\-RM" "1" "July 2015" "" "" +.TH "NPM\-UNINSTALL" "1" "March 2016" "" "" .SH "NAME" -\fBnpm-rm\fR \- Remove a package +\fBnpm-uninstall\fR \- Remove a package .SH SYNOPSIS .P .RS 2 diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index dbb4bf91e4a854..fe7c0307d19a04 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "July 2015" "" "" +.TH "NPM\-UNPUBLISH" "1" "March 2016" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index d9afff56cde21c..70887dda7fa4d0 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "July 2015" "" "" +.TH "NPM\-UPDATE" "1" "March 2016" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS @@ -25,7 +25,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 +To get the old behavior, use \fBnpm \-\-depth Infinity 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\. @@ -49,16 +49,17 @@ 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 @@ -69,8 +70,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 +84,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 +100,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 +113,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 @@ -128,8 +129,8 @@ the minimum required dependency in \fBpackage\.json\fP, you can use .P .RS 2 .nf -dependencies: { - dep1: "^1\.1\.1" +"dependencies": { + "dep1": "^1\.1\.1" } .fi .RE @@ -139,8 +140,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 +150,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 1d72440fe1ec63..0431fe3081cdf4 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "July 2015" "" "" +.TH "NPM\-VERSION" "1" "March 2016" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 70f47dc979a54d..d4e60e68766fa9 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "July 2015" "" "" +.TH "NPM\-VIEW" "1" "March 2016" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS @@ -104,6 +104,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 d887b35dc0b47c..53464beef34d09 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "July 2015" "" "" +.TH "NPM\-WHOAMI" "1" "March 2016" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index cb0814dde86212..faa648a1c178d1 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "July 2015" "" "" +.TH "NPM" "1" "March 2016" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -2.13.3 +2.14.20 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts @@ -156,7 +156,7 @@ If you would like to contribute, but don't know what to work on, check the issues list or ask on the mailing list\. .RS 0 .IP \(bu 2 -http://github\.com/npm/npm/issues +https://github\.com/npm/npm/issues .IP \(bu 2 npm\-@googlegroups\.com @@ -167,7 +167,7 @@ When you find issues, please report them: .RS 0 .IP \(bu 2 web: -http://github\.com/npm/npm/issues +https://github\.com/npm/npm/issues .IP \(bu 2 email: npm\-@googlegroups\.com diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3 index 3e67fc13f3aeac..0b94f46a83e60b 100644 --- a/deps/npm/man/man3/npm-bin.3 +++ b/deps/npm/man/man3/npm-bin.3 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "3" "July 2015" "" "" +.TH "NPM\-BIN" "3" "March 2016" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3 index 03f349ecec7c93..c0ce4a68a952e1 100644 --- a/deps/npm/man/man3/npm-bugs.3 +++ b/deps/npm/man/man3/npm-bugs.3 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "3" "July 2015" "" "" +.TH "NPM\-BUGS" "3" "March 2016" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-cache.3 b/deps/npm/man/man3/npm-cache.3 index 0f3a376af4eeda..ad6ae5a87e2752 100644 --- a/deps/npm/man/man3/npm-cache.3 +++ b/deps/npm/man/man3/npm-cache.3 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "3" "July 2015" "" "" +.TH "NPM\-CACHE" "3" "March 2016" "" "" .SH "NAME" \fBnpm-cache\fR \- manage the npm cache programmatically .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-commands.3 b/deps/npm/man/man3/npm-commands.3 index 31112f889611af..c057e10d40bbfe 100644 --- a/deps/npm/man/man3/npm-commands.3 +++ b/deps/npm/man/man3/npm-commands.3 @@ -1,4 +1,4 @@ -.TH "NPM\-COMMANDS" "3" "July 2015" "" "" +.TH "NPM\-COMMANDS" "3" "March 2016" "" "" .SH "NAME" \fBnpm-commands\fR \- npm commands .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3 index 216d4d78dfd384..fc3c81e11ae208 100644 --- a/deps/npm/man/man3/npm-config.3 +++ b/deps/npm/man/man3/npm-config.3 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "3" "July 2015" "" "" +.TH "NPM\-CONFIG" "3" "March 2016" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3 index 7963db6ba9b20d..2d44db5348496e 100644 --- a/deps/npm/man/man3/npm-deprecate.3 +++ b/deps/npm/man/man3/npm-deprecate.3 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "3" "July 2015" "" "" +.TH "NPM\-DEPRECATE" "3" "March 2016" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3 index b99ea3fe948a56..a8fe23ee3046cb 100644 --- a/deps/npm/man/man3/npm-docs.3 +++ b/deps/npm/man/man3/npm-docs.3 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "3" "July 2015" "" "" +.TH "NPM\-DOCS" "3" "March 2016" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-edit.3 b/deps/npm/man/man3/npm-edit.3 index d76cea18a5f84d..3230e33279e248 100644 --- a/deps/npm/man/man3/npm-edit.3 +++ b/deps/npm/man/man3/npm-edit.3 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "3" "July 2015" "" "" +.TH "NPM\-EDIT" "3" "March 2016" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-explore.3 b/deps/npm/man/man3/npm-explore.3 index 7f253524a17370..d0c5f2a2a354ef 100644 --- a/deps/npm/man/man3/npm-explore.3 +++ b/deps/npm/man/man3/npm-explore.3 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "3" "July 2015" "" "" +.TH "NPM\-EXPLORE" "3" "March 2016" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3 index 6aa3df57047f16..57400aebe61718 100644 --- a/deps/npm/man/man3/npm-help-search.3 +++ b/deps/npm/man/man3/npm-help-search.3 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "3" "July 2015" "" "" +.TH "NPM\-HELP\-SEARCH" "3" "March 2016" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search the help pages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-init.3 b/deps/npm/man/man3/npm-init.3 index b69fdfd952b741..a938aa25eebc88 100644 --- a/deps/npm/man/man3/npm-init.3 +++ b/deps/npm/man/man3/npm-init.3 @@ -1,4 +1,4 @@ -.TH "NPM" "" "July 2015" "" "" +.TH "NPM" "" "March 2016" "" "" .SH "NAME" \fBnpm\fR .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-install.3 b/deps/npm/man/man3/npm-install.3 index e639afde0a5a91..f7db35e3fcc7f2 100644 --- a/deps/npm/man/man3/npm-install.3 +++ b/deps/npm/man/man3/npm-install.3 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "3" "July 2015" "" "" +.TH "NPM\-INSTALL" "3" "March 2016" "" "" .SH "NAME" \fBnpm-install\fR \- install a package programmatically .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-link.3 b/deps/npm/man/man3/npm-link.3 index c8a35f631caa18..1dcfe5d1a8ee26 100644 --- a/deps/npm/man/man3/npm-link.3 +++ b/deps/npm/man/man3/npm-link.3 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "3" "July 2015" "" "" +.TH "NPM\-LINK" "3" "March 2016" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-load.3 b/deps/npm/man/man3/npm-load.3 index 7268d01ad59c9d..987cd29a1e74a6 100644 --- a/deps/npm/man/man3/npm-load.3 +++ b/deps/npm/man/man3/npm-load.3 @@ -1,4 +1,4 @@ -.TH "NPM\-LOAD" "3" "July 2015" "" "" +.TH "NPM\-LOAD" "3" "March 2016" "" "" .SH "NAME" \fBnpm-load\fR \- Load config settings .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3 index 1e43327495bb1b..c04bd6824f70d8 100644 --- a/deps/npm/man/man3/npm-ls.3 +++ b/deps/npm/man/man3/npm-ls.3 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "3" "July 2015" "" "" +.TH "NPM\-LS" "3" "March 2016" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-outdated.3 b/deps/npm/man/man3/npm-outdated.3 index 9a570e8215a648..2852beb4c99770 100644 --- a/deps/npm/man/man3/npm-outdated.3 +++ b/deps/npm/man/man3/npm-outdated.3 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "3" "July 2015" "" "" +.TH "NPM\-OUTDATED" "3" "March 2016" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3 index 03b8d869e6bab5..ad037bfff9c297 100644 --- a/deps/npm/man/man3/npm-owner.3 +++ b/deps/npm/man/man3/npm-owner.3 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "3" "July 2015" "" "" +.TH "NPM\-OWNER" "3" "March 2016" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3 index de3d36c4f557d4..7f27cb4f8d2bf5 100644 --- a/deps/npm/man/man3/npm-pack.3 +++ b/deps/npm/man/man3/npm-pack.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "3" "July 2015" "" "" +.TH "NPM\-PACK" "3" "March 2016" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-ping.3 b/deps/npm/man/man3/npm-ping.3 index 5fe65f4d2319c4..ab372319835d7b 100644 --- a/deps/npm/man/man3/npm-ping.3 +++ b/deps/npm/man/man3/npm-ping.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "3" "July 2015" "" "" +.TH "NPM\-PING" "3" "March 2016" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3 index 39b7e382e90268..438e71f8182aa7 100644 --- a/deps/npm/man/man3/npm-prefix.3 +++ b/deps/npm/man/man3/npm-prefix.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "3" "July 2015" "" "" +.TH "NPM\-PREFIX" "3" "March 2016" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-prune.3 b/deps/npm/man/man3/npm-prune.3 index 1adb72e0564861..6f4dd980f1445c 100644 --- a/deps/npm/man/man3/npm-prune.3 +++ b/deps/npm/man/man3/npm-prune.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "3" "July 2015" "" "" +.TH "NPM\-PRUNE" "3" "March 2016" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3 index 650efc706c0296..0b164c00156260 100644 --- a/deps/npm/man/man3/npm-publish.3 +++ b/deps/npm/man/man3/npm-publish.3 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "3" "July 2015" "" "" +.TH "NPM\-PUBLISH" "3" "March 2016" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3 index e1bdde2484d20e..5f03cd724b1e0d 100644 --- a/deps/npm/man/man3/npm-rebuild.3 +++ b/deps/npm/man/man3/npm-rebuild.3 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "3" "July 2015" "" "" +.TH "NPM\-REBUILD" "3" "March 2016" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3 index 66558d6508a60e..f145e6ecb0e3bc 100644 --- a/deps/npm/man/man3/npm-repo.3 +++ b/deps/npm/man/man3/npm-repo.3 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "3" "July 2015" "" "" +.TH "NPM\-REPO" "3" "March 2016" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-restart.3 b/deps/npm/man/man3/npm-restart.3 index 0d6b0c03beee06..77c8f670a26592 100644 --- a/deps/npm/man/man3/npm-restart.3 +++ b/deps/npm/man/man3/npm-restart.3 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "3" "July 2015" "" "" +.TH "NPM\-RESTART" "3" "March 2016" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3 index d34c979024e105..0e4d32e6595d65 100644 --- a/deps/npm/man/man3/npm-root.3 +++ b/deps/npm/man/man3/npm-root.3 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "3" "July 2015" "" "" +.TH "NPM\-ROOT" "3" "March 2016" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-run-script.3 b/deps/npm/man/man3/npm-run-script.3 index 2908d02eaa00d1..b07e929a1ed718 100644 --- a/deps/npm/man/man3/npm-run-script.3 +++ b/deps/npm/man/man3/npm-run-script.3 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "3" "July 2015" "" "" +.TH "NPM\-RUN\-SCRIPT" "3" "March 2016" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3 index b4cb98248b3388..a56e24f67e3fd8 100644 --- a/deps/npm/man/man3/npm-search.3 +++ b/deps/npm/man/man3/npm-search.3 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "3" "July 2015" "" "" +.TH "NPM\-SEARCH" "3" "March 2016" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3 index 63d019aa749e7e..f0bffe4c18f27d 100644 --- a/deps/npm/man/man3/npm-shrinkwrap.3 +++ b/deps/npm/man/man3/npm-shrinkwrap.3 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "3" "July 2015" "" "" +.TH "NPM\-SHRINKWRAP" "3" "March 2016" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-start.3 b/deps/npm/man/man3/npm-start.3 index d309d4264af75b..2ab10b3f276193 100644 --- a/deps/npm/man/man3/npm-start.3 +++ b/deps/npm/man/man3/npm-start.3 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "3" "July 2015" "" "" +.TH "NPM\-START" "3" "March 2016" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3 index 30e3444a9d4939..f785d4ca05ad1a 100644 --- a/deps/npm/man/man3/npm-stop.3 +++ b/deps/npm/man/man3/npm-stop.3 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "3" "July 2015" "" "" +.TH "NPM\-STOP" "3" "March 2016" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3 index 2eecc980615555..a2714a69e24752 100644 --- a/deps/npm/man/man3/npm-tag.3 +++ b/deps/npm/man/man3/npm-tag.3 @@ -1,4 +1,4 @@ -.TH "NPM\-TAG" "3" "July 2015" "" "" +.TH "NPM\-TAG" "3" "March 2016" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3 index 3c91fde9806231..331de1105962c0 100644 --- a/deps/npm/man/man3/npm-test.3 +++ b/deps/npm/man/man3/npm-test.3 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "3" "July 2015" "" "" +.TH "NPM\-TEST" "3" "March 2016" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3 index d5027d84b14348..a274b114d0d088 100644 --- a/deps/npm/man/man3/npm-uninstall.3 +++ b/deps/npm/man/man3/npm-uninstall.3 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "3" "July 2015" "" "" +.TH "NPM\-UNINSTALL" "3" "March 2016" "" "" .SH "NAME" \fBnpm-uninstall\fR \- uninstall a package programmatically .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-unpublish.3 b/deps/npm/man/man3/npm-unpublish.3 index f9b333da5be897..17f0c219d71bf7 100644 --- a/deps/npm/man/man3/npm-unpublish.3 +++ b/deps/npm/man/man3/npm-unpublish.3 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "3" "July 2015" "" "" +.TH "NPM\-UNPUBLISH" "3" "March 2016" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-update.3 b/deps/npm/man/man3/npm-update.3 index 51601179d988e6..26520ce55f9b82 100644 --- a/deps/npm/man/man3/npm-update.3 +++ b/deps/npm/man/man3/npm-update.3 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "3" "July 2015" "" "" +.TH "NPM\-UPDATE" "3" "March 2016" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS @@ -8,7 +8,7 @@ npm\.commands\.update(packages, callback) .fi .RE -.TH "DESCRIPTION" "" "July 2015" "" "" +.TH "DESCRIPTION" "" "March 2016" "" "" .SH "NAME" \fBDESCRIPTION\fR .P diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3 index bbc5785d8859ec..ee100ef86faeab 100644 --- a/deps/npm/man/man3/npm-version.3 +++ b/deps/npm/man/man3/npm-version.3 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "3" "July 2015" "" "" +.TH "NPM\-VERSION" "3" "March 2016" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm-view.3 b/deps/npm/man/man3/npm-view.3 index 65a201f65b7225..a625d4efecf3a3 100644 --- a/deps/npm/man/man3/npm-view.3 +++ b/deps/npm/man/man3/npm-view.3 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "3" "July 2015" "" "" +.TH "NPM\-VIEW" "3" "March 2016" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS @@ -98,7 +98,7 @@ was required by each matching version of yui3: .P .RS 2 .nf -npm\.commands\.view(["yui3@'>0\.5\.4'", "dependencies\.jsdom"], callback) +npm\.commands\.view(["yui3@>0\.5\.4", "dependencies\.jsdom"], callback) .fi .RE .SH OUTPUT diff --git a/deps/npm/man/man3/npm-whoami.3 b/deps/npm/man/man3/npm-whoami.3 index c9e20c789573a6..a782b53b9bdc98 100644 --- a/deps/npm/man/man3/npm-whoami.3 +++ b/deps/npm/man/man3/npm-whoami.3 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "3" "July 2015" "" "" +.TH "NPM\-WHOAMI" "3" "March 2016" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3 index ddb2025944f63d..7fa67dbcb2ad67 100644 --- a/deps/npm/man/man3/npm.3 +++ b/deps/npm/man/man3/npm.3 @@ -1,4 +1,4 @@ -.TH "NPM" "3" "July 2015" "" "" +.TH "NPM" "3" "March 2016" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) { .RE .SH VERSION .P -2.13.3 +2.14.20 .SH DESCRIPTION .P This is the API documentation for npm\. diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index f1b2a8d7f2f26b..33ad7d4c63d83f 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" "July 2015" "" "" +.TH "NPM\-FOLDERS" "5" "March 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\. diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index f1b2a8d7f2f26b..33ad7d4c63d83f 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" "July 2015" "" "" +.TH "NPM\-FOLDERS" "5" "March 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\. diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 3f1754eedb203e..2cfab7b03e119f 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" "July 2015" "" "" +.TH "PACKAGE\.JSON" "5" "March 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 @@ -217,21 +217,23 @@ The "files" field is an array of files to include in your project\. If you name a folder in the array, then it will also include the files inside that folder\. (Unless they would be ignored by another rule\.) .P -You can also provide a "\.npmignore" file in the root of your package, -which will keep files from being included, even if they would be picked -up by the files array\. The "\.npmignore" file works just like a -"\.gitignore"\. +You can also provide a "\.npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array\. The \fB\|\.npmignore\fP file +works just like a \fB\|\.gitignore\fP\|\. .P Certain files are always included, regardless of settings: .RS 0 .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 (any casing and file extension) .IP \(bu 2 \fBLICENSE\fP / \fBLICENCE\fP +.IP \(bu 2 +The file in the "main" field .RE .P @@ -250,13 +252,15 @@ 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 .RE .SH main @@ -506,7 +510,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 @@ -694,7 +698,7 @@ this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\ .P Array of package names that will be bundled when publishing the package\. .P -If this is spelled \fB"bundleDependencies"\fP, then that is also honorable\. +If this is spelled \fB"bundleDependencies"\fP, then that is also honored\. .SH optionalDependencies .P If a dependency can be used, but you would like npm to proceed if it cannot be @@ -884,7 +888,7 @@ 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 246c4a39c44b67..e99cb155dadc57 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "July 2015" "" "" +.TH "NPMRC" "5" "March 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 3f1754eedb203e..2cfab7b03e119f 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" "July 2015" "" "" +.TH "PACKAGE\.JSON" "5" "March 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 @@ -217,21 +217,23 @@ The "files" field is an array of files to include in your project\. If you name a folder in the array, then it will also include the files inside that folder\. (Unless they would be ignored by another rule\.) .P -You can also provide a "\.npmignore" file in the root of your package, -which will keep files from being included, even if they would be picked -up by the files array\. The "\.npmignore" file works just like a -"\.gitignore"\. +You can also provide a "\.npmignore" file in the root of your package or +in subdirectories, which will keep files from being included, even +if they would be picked up by the files array\. The \fB\|\.npmignore\fP file +works just like a \fB\|\.gitignore\fP\|\. .P Certain files are always included, regardless of settings: .RS 0 .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 (any casing and file extension) .IP \(bu 2 \fBLICENSE\fP / \fBLICENCE\fP +.IP \(bu 2 +The file in the "main" field .RE .P @@ -250,13 +252,15 @@ 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 .RE .SH main @@ -506,7 +510,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 @@ -694,7 +698,7 @@ this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\ .P Array of package names that will be bundled when publishing the package\. .P -If this is spelled \fB"bundleDependencies"\fP, then that is also honorable\. +If this is spelled \fB"bundleDependencies"\fP, then that is also honored\. .SH optionalDependencies .P If a dependency can be used, but you would like npm to proceed if it cannot be @@ -884,7 +888,7 @@ 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 b7c629c3fbcc87..2c816816617544 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" "July 2015" "" "" +.TH "NPM\-CODING\-STYLE" "7" "March 2016" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 8a446f1d39f185..c60d8d94415638 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" "July 2015" "" "" +.TH "NPM\-CONFIG" "7" "March 2016" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -323,7 +323,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 diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 90dff7ba16c1e9..a9162d0ff65cc9 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" "July 2015" "" "" +.TH "NPM\-DEVELOPERS" "7" "March 2016" "" "" .SH "NAME" \fBnpm-developers\fR \- Developer Guide .SH DESCRIPTION @@ -110,9 +110,11 @@ Use a \fB\|\.npmignore\fP file to keep stuff out of your package\. If there's no \fB\|\.npmignore\fP file, but there \fIis\fR a \fB\|\.gitignore\fP file, then npm will ignore the stuff matched by the \fB\|\.gitignore\fP file\. If you \fIwant\fR to include something that is excluded by your \fB\|\.gitignore\fP file, you can -create an empty \fB\|\.npmignore\fP file to override it\. +create an empty \fB\|\.npmignore\fP file to override it\. Like \fBgit\fP, \fBnpm\fP looks +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 @@ -140,12 +142,16 @@ need to add them to \fB\|\.npmignore\fP explicitly: .IP \(bu 2 \fB\|\.hg\fP .IP \(bu 2 +\fB\|\.npmrc\fP +.IP \(bu 2 \fB\|\.lock\-wscript\fP .IP \(bu 2 \fB\|\.svn\fP .IP \(bu 2 \fB\|\.wafpickle\-*\fP .IP \(bu 2 +\fBconfig\.gypi\fP +.IP \(bu 2 \fBCVS\fP .IP \(bu 2 \fBnpm\-debug\.log\fP @@ -162,7 +168,11 @@ The following paths and files are never ignored, so adding them to .IP \(bu 2 \fBpackage\.json\fP .IP \(bu 2 -\fBREADME\.*\fP +\fBREADME\fP (and its variants) +.IP \(bu 2 +\fBCHANGELOG\fP (and its variants) +.IP \(bu 2 +\fBLICENSE\fP / \fBLICENCE\fP .RE .SH Link Packages @@ -229,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 diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index 42f47cd24fa57e..3e56cc4a3dca47 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" "July 2015" "" "" +.TH "NPM\-DISPUTES" "7" "March 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 907c2591bcfc4f..00000000000000 --- a/deps/npm/man/man7/npm-faq.7 +++ /dev/null @@ -1,429 +0,0 @@ -.TH "NPM\-FAQ" "7" "July 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 6cf62b8de6b793..6727cb33bc5ec8 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" "July 2015" "" "" +.TH "NPM\-INDEX" "7" "March 2016" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README @@ -136,6 +136,9 @@ Stop a package .SS npm help tag .P Tag a published version +.SS npm help team +.P +Manage organization teams and team memberships .SS npm help test .P Test a package @@ -307,12 +310,12 @@ 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 +.SS npm help 7 orgs +.P +Working with Teams & Orgs .SS npm help 7 registry .P The JavaScript Package Registry diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7 new file mode 100644 index 00000000000000..031c93376d8a32 --- /dev/null +++ b/deps/npm/man/man7/npm-orgs.7 @@ -0,0 +1,146 @@ +.TH "NPM\-ORGS" "7" "March 2016" "" "" +.SH "NAME" +\fBnpm-orgs\fR \- Working with Teams & Orgs +.SH DESCRIPTION +.P +There are three levels of org users: +.RS 0 +.IP 1. 3 +Super admin, controls billing & adding people to the org\. +.IP 2. 3 +Team admin, manages team membership & package access\. +.IP 3. 3 +Developer, works on packages they are given access to\. + +.RE +.P +The super admin is the only person who can add users to the org because it impacts the monthly bill\. The super admin will use the website to manage membership\. Every org has a \fBdevelopers\fP team that all users are automatically added to\. +.P +The team admin is the person who manages team creation, team membership, and package access for teams\. The team admin grants package access to teams, not individuals\. +.P +The developer will be able to access packages based on the teams they are on\. Access is either read\-write or read\-only\. +.P +There are two main commands: +.RS 0 +.IP 1. 3 +\fBnpm team\fP see npm help access for more details +.IP 2. 3 +\fBnpm access\fP see npm help team for more details + +.RE +.SH Team Admins create teams +.RS 0 +.IP \(bu 2 +Check who you’ve added to your org: + +.RE +.P +.RS 2 +.nf +npm team ls :developers +.fi +.RE +.RS 0 +.IP \(bu 2 +Each org is automatically given a \fBdevelopers\fP team, so you can see the whole list of team members in your org\. This team automatically gets read\-write access to all packages, but you can change that with the \fBaccess\fP command\. +.IP \(bu 2 +Create a new team: + +.RE +.P +.RS 2 +.nf +npm team create +.fi +.RE +.RS 0 +.IP \(bu 2 +Add members to that team: + +.RE +.P +.RS 2 +.nf +npm team add +.fi +.RE +.SH Publish a package and adjust package access +.RS 0 +.IP \(bu 2 +In package directory, run + +.RE +.P +.RS 2 +.nf +npm init \-\-scope= +.fi +.RE +.P +to scope it for your org & publish as usual +.RS 0 +.IP \(bu 2 +Grant access: + +.RE +.P +.RS 2 +.nf +npm access grant [] +.fi +.RE +.RS 0 +.IP \(bu 2 +Revoke access: + +.RE +.P +.RS 2 +.nf +npm access revoke [] +.fi +.RE +.SH Monitor your package access +.RS 0 +.IP \(bu 2 +See what org packages a team member can access: + +.RE +.P +.RS 2 +.nf +npm access ls\-packages +.fi +.RE +.RS 0 +.IP \(bu 2 +See packages available to a specific team: + +.RE +.P +.RS 2 +.nf +npm access ls\-packages +.fi +.RE +.RS 0 +.IP \(bu 2 +Check which teams are collaborating on a package: + +.RE +.P +.RS 2 +.nf +npm access ls\-collaborators +.fi +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help team +.IP \(bu 2 +npm help access +.IP \(bu 2 +npm help 7 scope + +.RE diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index a1cf07f1d83167..5ef2ab8df190e0 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" "July 2015" "" "" +.TH "NPM\-REGISTRY" "7" "March 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 5c1ffb242280d7..4a97a8536ba64d 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" "July 2015" "" "" +.TH "NPM\-SCOPE" "7" "March 2016" "" "" .SH "NAME" \fBnpm-scope\fR \- Scoped packages .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index 1e1002dea70984..b6cfbe9c0450dd 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" "July 2015" "" "" +.TH "NPM\-SCRIPTS" "7" "March 2016" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION @@ -91,9 +91,9 @@ npm will default some script values based on package contents\. 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"preinstall": "node\-waf clean || true; node\-waf configure build"\fP: -If there is a \fBwscript\fP file in the root of your package, npm will -default the \fBpreinstall\fP command to compile using node\-waf\. +\fB"install": "node\-gyp rebuild"\fP: +If there is a \fBbindings\.gyp\fP file in the root of your package, npm will +default the \fBinstall\fP command to compile using node\-gyp\. .RE .SH USER @@ -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 bf1c9ca9f49947..338724b26a06dc 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" "July 2015" "" "" +.TH "NPM\-REMOVAL" "1" "March 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 994615e4c917bf..2cb733f85fe3c6 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "July 2015" "" "" +.TH "SEMVER" "7" "March 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/request/node_modules/har-validator/node_modules/chalk/node_modules/has-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/request/node_modules/har-validator/node_modules/chalk/node_modules/has-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/node_modules/ansi-regex/license b/deps/npm/node_modules/ansi-regex/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/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..88457331688474 --- /dev/null +++ b/deps/npm/node_modules/ansi-regex/package.json @@ -0,0 +1,86 @@ +{ + "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", + "_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/request/node_modules/har-validator/node_modules/chalk/node_modules/has-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/request/node_modules/har-validator/node_modules/chalk/node_modules/has-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 index f4a9fe30434aea..aea8aaf0991e70 100644 --- a/deps/npm/node_modules/ansi/History.md +++ b/deps/npm/node_modules/ansi/History.md @@ -1,4 +1,11 @@ +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 ================== diff --git a/deps/npm/node_modules/ansi/LICENSE b/deps/npm/node_modules/ansi/LICENSE new file mode 100644 index 00000000000000..2ea4dc5efb8729 --- /dev/null +++ b/deps/npm/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/lib/ansi.js b/deps/npm/node_modules/ansi/lib/ansi.js index 52fc8ec8bea14b..b1714e328995c1 100644 --- a/deps/npm/node_modules/ansi/lib/ansi.js +++ b/deps/npm/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/package.json b/deps/npm/node_modules/ansi/package.json index 706ae63067694d..f65863bd6585fd 100644 --- a/deps/npm/node_modules/ansi/package.json +++ b/deps/npm/node_modules/ansi/package.json @@ -1,6 +1,7 @@ { "name": "ansi", "description": "Advanced ANSI formatting tool for Node.js", + "license": "MIT", "keywords": [ "ansi", "formatting", @@ -11,7 +12,7 @@ "256", "stream" ], - "version": "0.3.0", + "version": "0.3.1", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", @@ -22,14 +23,17 @@ "url": "git://github.com/TooTallNate/ansi.js.git" }, "main": "./lib/ansi.js", + "gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246", "bugs": { "url": "https://github.com/TooTallNate/ansi.js/issues" }, - "homepage": "https://github.com/TooTallNate/ansi.js", - "_id": "ansi@0.3.0", - "_shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0", + "homepage": "https://github.com/TooTallNate/ansi.js#readme", + "_id": "ansi@0.3.1", + "scripts": {}, + "_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", "_from": "ansi@latest", - "_npmVersion": "1.4.9", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", "_npmUser": { "name": "tootallnate", "email": "nathan@tootallnate.net" @@ -45,10 +49,10 @@ } ], "dist": { - "shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0", - "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz" + "shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", + "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz", + "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/chmodr/chmodr.js b/deps/npm/node_modules/chmodr/chmodr.js index 9edaa7f02d7c69..2f30d2f867b91a 100644 --- a/deps/npm/node_modules/chmodr/chmodr.js +++ b/deps/npm/node_modules/chmodr/chmodr.js @@ -2,43 +2,62 @@ module.exports = chmodr chmodr.sync = chmodrSync var fs = require("fs") -, path = require("path") +var path = require("path") function chmodr (p, mode, cb) { + fs.lstat(p, function (er, stats) { + if (er) + return cb(er) + if (stats.isSymbolicLink()) + return cb() + if (stats.isDirectory()) + return chmodrDir(p, mode, cb) + return fs.chmod(p, mode, cb) + }) +} + +function chmodrDir (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") + if (er) return cb(er) - var isDir = !er - var m = isDir ? dirMode(mode) : mode - if (er || !children.length) - return fs.chmod(p, m, cb) + + if (!children.length) + return fs.chmod(p, dirMode(mode), cb) var len = children.length var errState = null children.forEach(function (child) { chmodr(path.resolve(p, child), mode, then) }) + + // return first error, but not until all are finished, + // so we don't keep performing FS operations after the cb function then (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- len === 0) return fs.chmod(p, dirMode(mode), cb) + len = len - 1 + if (er && !errState) + errState = er + if (len === 0) { + if (errState) + return cb(errState) + else + 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 stats = fs.lstatSync(p) + if (stats.isSymbolicLink()) + return + if (stats.isDirectory()) + return chmodrDirSync(p, mode) + else + return fs.chmodSync(p, mode) +} + +function chmodrDirSync (p, mode) { + fs.readdirSync(p).forEach(function (child) { chmodrSync(path.resolve(p, child), mode) }) return fs.chmodSync(p, dirMode(mode)) @@ -47,8 +66,11 @@ function chmodrSync (p, 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 + 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 index e253434ef45432..cd32ff52bbc3e2 100644 --- a/deps/npm/node_modules/chmodr/package.json +++ b/deps/npm/node_modules/chmodr/package.json @@ -6,38 +6,41 @@ }, "name": "chmodr", "description": "like `chmod -R`", - "version": "0.1.1", + "version": "1.0.2", "repository": { "type": "git", "url": "git://github.com/isaacs/chmodr.git" }, "main": "chmodr.js", "devDependencies": { - "tap": "0.2", "mkdirp": "0.3", - "rimraf": "" + "rimraf": "", + "tap": "^1.3.2" }, "scripts": { "test": "tap test/*.js" }, "license": "ISC", - "gitHead": "2f301476bc6fc93e47d2ba2e3ab0409f0d0c15ba", + "files": [ + "chmodr.js" + ], + "gitHead": "1eeeb38b3a4899714e11840fe28ea7fd93865f01", "bugs": { "url": "https://github.com/isaacs/chmodr/issues" }, "homepage": "https://github.com/isaacs/chmodr#readme", - "_id": "chmodr@0.1.1", - "_shasum": "115c8f9ec62be3ef019085782c9448e471560261", - "_from": "chmodr@0.1.1", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", + "_id": "chmodr@1.0.2", + "_shasum": "04662b932d0f02ec66deaa2b0ea42811968e3eb9", + "_from": "chmodr@>=1.0.2 <1.1.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", "_npmUser": { "name": "isaacs", "email": "isaacs@npmjs.com" }, "dist": { - "shasum": "115c8f9ec62be3ef019085782c9448e471560261", - "tarball": "http://registry.npmjs.org/chmodr/-/chmodr-0.1.1.tgz" + "shasum": "04662b932d0f02ec66deaa2b0ea42811968e3eb9", + "tarball": "http://registry.npmjs.org/chmodr/-/chmodr-1.0.2.tgz" }, "maintainers": [ { @@ -46,5 +49,5 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/chmodr/-/chmodr-0.1.1.tgz" + "_resolved": "https://registry.npmjs.org/chmodr/-/chmodr-1.0.2.tgz" } diff --git a/deps/npm/node_modules/chmodr/test/basic.js b/deps/npm/node_modules/chmodr/test/basic.js deleted file mode 100644 index aba1cd30a7018c..00000000000000 --- a/deps/npm/node_modules/chmodr/test/basic.js +++ /dev/null @@ -1,63 +0,0 @@ -var chmodr = require("../") -, test = require("tap").test -, mkdirp = require("mkdirp") -, rimraf = require("rimraf") -, fs = require("fs") -, dirs = [] - -rimraf("/tmp/chmodr", function (er) { - if (er) throw er - var cnt = 5 - for (var i = 0; i < 5; i ++) { - mkdirp(getDir(), then) - } - function then (er) { - if (er) throw er - if (-- cnt === 0) { - runTest() - } - } -}) - -function getDir () { - var dir = "/tmp/chmodr" - - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - return dir -} - -function runTest () { - test("should complete successfully", function (t) { - console.error("calling chmodr 0700") - chmodr("/tmp/chmodr", 0700, function (er) { - t.ifError(er) - t.end() - }) - }) - - dirs.forEach(function (dir) { - test("verify "+dir, function (t) { - fs.stat(dir, function (er, st) { - if (er) { - t.ifError(er) - return t.end() - } - t.equal(st.mode & 0777, 0700, "mode should be 0700") - t.end() - }) - }) - }) - - test("cleanup", function (t) { - rimraf("/tmp/chmodr/", function (er) { - t.ifError(er) - t.end() - }) - }) -} - diff --git a/deps/npm/node_modules/chmodr/test/sync.js b/deps/npm/node_modules/chmodr/test/sync.js deleted file mode 100644 index 71f90cd1ee96d2..00000000000000 --- a/deps/npm/node_modules/chmodr/test/sync.js +++ /dev/null @@ -1,58 +0,0 @@ -var chmodr = require("../") -, test = require("tap").test -, mkdirp = require("mkdirp") -, rimraf = require("rimraf") -, fs = require("fs") -, dirs = [] - -rimraf("/tmp/chmodr", function (er) { - if (er) throw er - var cnt = 5 - for (var i = 0; i < 5; i ++) { - mkdirp(getDir(), then) - } - function then (er) { - if (er) throw er - if (-- cnt === 0) { - runTest() - } - } -}) - -function getDir () { - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var dir = "/tmp/chmodr/" + [x,y,z].join("/") - dirs.push(dir) - return dir -} - -function runTest () { - test("should complete successfully", function (t) { - console.error("calling chmodr 0700") - chmodr.sync("/tmp/chmodr", 0700) - t.end() - }) - - dirs.forEach(function (dir) { - test("verify "+dir, function (t) { - fs.stat(dir, function (er, st) { - if (er) { - t.ifError(er) - return t.end() - } - t.equal(st.mode & 0777, 0700, "uid should be 0700") - t.end() - }) - }) - }) - - test("cleanup", function (t) { - rimraf("/tmp/chmodr", function (er) { - t.ifError(er) - t.end() - }) - }) -} - diff --git a/deps/npm/node_modules/chownr/LICENCE b/deps/npm/node_modules/chownr/LICENCE deleted file mode 100644 index 74489e2e2658e7..00000000000000 --- a/deps/npm/node_modules/chownr/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/chownr/chownr.js b/deps/npm/node_modules/chownr/chownr.js index 598b8f844190b8..ecd7b452df57d7 100644 --- a/deps/npm/node_modules/chownr/chownr.js +++ b/deps/npm/node_modules/chownr/chownr.js @@ -14,7 +14,15 @@ function chownr (p, uid, gid, cb) { var len = children.length , errState = null children.forEach(function (child) { - chownr(path.resolve(p, child), uid, gid, then) + var pathChild = path.resolve(p, child); + fs.lstat(pathChild, function(er, stats) { + if (er) + return cb(er) + if (!stats.isSymbolicLink()) + chownr(pathChild, uid, gid, then) + else + then() + }) }) function then (er) { if (errState) return @@ -35,7 +43,10 @@ function chownrSync (p, uid, gid) { if (!children.length) return fs.chownSync(p, uid, gid) children.forEach(function (child) { - chownrSync(path.resolve(p, child), uid, gid) + var pathChild = path.resolve(p, child) + var stats = fs.lstatSync(pathChild) + if (!stats.isSymbolicLink()) + chownrSync(pathChild, uid, gid) }) return fs.chownSync(p, uid, gid) } diff --git a/deps/npm/node_modules/chownr/package.json b/deps/npm/node_modules/chownr/package.json index a551c869ec1a34..fdd1dd23083e77 100644 --- a/deps/npm/node_modules/chownr/package.json +++ b/deps/npm/node_modules/chownr/package.json @@ -6,38 +6,41 @@ }, "name": "chownr", "description": "like `chown -R`", - "version": "0.0.2", + "version": "1.0.1", "repository": { "type": "git", "url": "git://github.com/isaacs/chownr.git" }, "main": "chownr.js", + "files": [ + "chownr.js" + ], "devDependencies": { - "tap": "0.2", "mkdirp": "0.3", - "rimraf": "" + "rimraf": "", + "tap": "^1.2.0" }, "scripts": { "test": "tap test/*.js" }, "license": "ISC", - "gitHead": "3cafeb70b2c343e893f710750406b3909ec537cb", + "gitHead": "c6c43844e80d7c7045e737a72b9fbb1ba0579a26", "bugs": { "url": "https://github.com/isaacs/chownr/issues" }, "homepage": "https://github.com/isaacs/chownr#readme", - "_id": "chownr@0.0.2", - "_shasum": "2f9aebf746f90808ce00607b72ba73b41604c485", - "_from": "chownr@0.0.2", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", + "_id": "chownr@1.0.1", + "_shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", + "_from": "chownr@1.0.1", + "_npmVersion": "3.2.2", + "_nodeVersion": "2.2.1", "_npmUser": { "name": "isaacs", "email": "isaacs@npmjs.com" }, "dist": { - "shasum": "2f9aebf746f90808ce00607b72ba73b41604c485", - "tarball": "http://registry.npmjs.org/chownr/-/chownr-0.0.2.tgz" + "shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", + "tarball": "http://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz" }, "maintainers": [ { @@ -46,5 +49,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/chownr/-/chownr-0.0.2.tgz" + "_resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/chownr/test/basic.js b/deps/npm/node_modules/chownr/test/basic.js deleted file mode 100644 index 9e4f6bde038454..00000000000000 --- a/deps/npm/node_modules/chownr/test/basic.js +++ /dev/null @@ -1,84 +0,0 @@ -if (!process.getuid || !process.getgid) { - throw new Error("Tests require getuid/getgid support") -} - -var curUid = +process.getuid() -, curGid = +process.getgid() -, chownr = require("../") -, test = require("tap").test -, mkdirp = require("mkdirp") -, rimraf = require("rimraf") -, fs = require("fs") - -// sniff the 'id' command for other groups that i can legally assign to -var exec = require("child_process").exec -, groups -, dirs = [] - -exec("id", function (code, output) { - if (code) throw new Error("failed to run 'id' command") - groups = output.trim().split("groups=")[1].split(",").map(function (s) { - return parseInt(s, 10) - }).filter(function (g) { - return g !== curGid - }) - - console.error([curUid, groups[0]], "uid, gid") - - rimraf("/tmp/chownr", function (er) { - if (er) throw er - var cnt = 5 - for (var i = 0; i < 5; i ++) { - mkdirp(getDir(), then) - } - function then (er) { - if (er) throw er - if (-- cnt === 0) { - runTest() - } - } - }) -}) - -function getDir () { - var dir = "/tmp/chownr" - - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - dir += "/" + Math.floor(Math.random() * Math.pow(16,4)).toString(16) - dirs.push(dir) - return dir -} - -function runTest () { - test("should complete successfully", function (t) { - console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) - chownr("/tmp/chownr", curUid, groups[0], function (er) { - t.ifError(er) - t.end() - }) - }) - - dirs.forEach(function (dir) { - test("verify "+dir, function (t) { - fs.stat(dir, function (er, st) { - if (er) { - t.ifError(er) - return t.end() - } - t.equal(st.uid, curUid, "uid should be " + curUid) - t.equal(st.gid, groups[0], "gid should be "+groups[0]) - t.end() - }) - }) - }) - - test("cleanup", function (t) { - rimraf("/tmp/chownr/", function (er) { - t.ifError(er) - t.end() - }) - }) -} diff --git a/deps/npm/node_modules/chownr/test/sync.js b/deps/npm/node_modules/chownr/test/sync.js deleted file mode 100644 index 2e26c56aafd294..00000000000000 --- a/deps/npm/node_modules/chownr/test/sync.js +++ /dev/null @@ -1,79 +0,0 @@ -if (!process.getuid || !process.getgid) { - throw new Error("Tests require getuid/getgid support") -} - -var curUid = +process.getuid() -, curGid = +process.getgid() -, chownr = require("../") -, test = require("tap").test -, mkdirp = require("mkdirp") -, rimraf = require("rimraf") -, fs = require("fs") - -// sniff the 'id' command for other groups that i can legally assign to -var exec = require("child_process").exec -, groups -, dirs = [] - -exec("id", function (code, output) { - if (code) throw new Error("failed to run 'id' command") - groups = output.trim().split("groups=")[1].split(",").map(function (s) { - return parseInt(s, 10) - }).filter(function (g) { - return g !== curGid - }) - - console.error([curUid, groups[0]], "uid, gid") - - rimraf("/tmp/chownr", function (er) { - if (er) throw er - var cnt = 5 - for (var i = 0; i < 5; i ++) { - mkdirp(getDir(), then) - } - function then (er) { - if (er) throw er - if (-- cnt === 0) { - runTest() - } - } - }) -}) - -function getDir () { - var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16); - var dir = "/tmp/chownr/" + [x,y,z].join("/") - dirs.push(dir) - return dir -} - -function runTest () { - test("should complete successfully", function (t) { - console.error("calling chownr", curUid, groups[0], typeof curUid, typeof groups[0]) - chownr.sync("/tmp/chownr", curUid, groups[0]) - t.end() - }) - - dirs.forEach(function (dir) { - test("verify "+dir, function (t) { - fs.stat(dir, function (er, st) { - if (er) { - t.ifError(er) - return t.end() - } - t.equal(st.uid, curUid, "uid should be " + curUid) - t.equal(st.gid, groups[0], "gid should be "+groups[0]) - t.end() - }) - }) - }) - - test("cleanup", function (t) { - rimraf("/tmp/chownr/", function (er) { - t.ifError(er) - t.end() - }) - }) -} 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/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..c2b91db60bf115 100644 --- a/deps/npm/node_modules/cmd-shim/package.json +++ b/deps/npm/node_modules/cmd-shim/package.json @@ -1,46 +1,52 @@ { "name": "cmd-shim", - "version": "2.0.1", + "version": "2.0.2", "description": "Used in npm for command line application support", "scripts": { "test": "tap test/*.js" }, "repository": { "type": "git", - "url": "https://github.com/ForbesLindesay/cmd-shim.git" + "url": "git+https://github.com/ForbesLindesay/cmd-shim.git" }, - "license": "BSD", + "license": "BSD-2-Clause", "dependencies": { - "graceful-fs": ">3.0.1 <4.0.0-0", + "graceful-fs": "^4.1.2", "mkdirp": "~0.5.0" }, "devDependencies": { "tap": "~0.4.11", "rimraf": "~2.2.8" }, - "gitHead": "6f53d506be590fe9ac20c9801512cd1a3aad5974", + "gitHead": "8492e2a92b5062bb02a9eec509e57eea94b110a7", "bugs": { "url": "https://github.com/ForbesLindesay/cmd-shim/issues" }, "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", + "_id": "cmd-shim@2.0.2", + "_shasum": "6fcbda99483a8fd15d7d30a196ca69d688a2efdb", + "_from": "cmd-shim@2.0.2", + "_npmVersion": "2.7.1", + "_nodeVersion": "1.6.2", "_npmUser": { "name": "forbeslindesay", "email": "forbes@lindesay.co.uk" }, + "dist": { + "shasum": "6fcbda99483a8fd15d7d30a196ca69d688a2efdb", + "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz" + }, "maintainers": [ { "name": "forbeslindesay", "email": "forbes@lindesay.co.uk" } ], - "dist": { - "shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", - "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/cmd-shim-2.0.2.tgz_1455116566936_0.7582207734230906" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" + "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.2.tgz", + "readme": "ERROR: No README data found!" } 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 db10a01181752d..334d5509ae222e 100644 --- a/deps/npm/node_modules/columnify/columnify.js +++ b/deps/npm/node_modules/columnify/columnify.js @@ -1,6 +1,4 @@ -'use strict'; - -var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }; +"use strict"; var wcwidth = require('./width'); @@ -35,7 +33,7 @@ var DEFAULTS = Object.freeze({ }); module.exports = function (items) { - var options = arguments[1] === undefined ? {} : arguments[1]; + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; var columnConfigs = options.config || {}; delete options.config; // remove config so doesn't appear on every column. @@ -147,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); }); @@ -183,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,8 +219,9 @@ function createRows(items, columns, columnNames, paddingChr) { columnNames.forEach(function (columnName) { numLines = Math.max(numLines, item[columnName].length); }); + // 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]; @@ -227,7 +230,6 @@ function createRows(items, columns, columnNames, paddingChr) { }); }; - // combine matching lines of each rows for (var i = 0; i < numLines; i++) { _loop(i); } @@ -242,18 +244,16 @@ function createRows(items, columns, columnNames, paddingChr) { */ function mixin() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } + var _Object; - if (Object.assign) { - return Object.assign.apply(Object, _toConsumableArray(args)); - }return ObjectAssign.apply(undefined, _toConsumableArray(args)); + 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'); + "use strict"; + + if (target === undefined || target === null) throw new TypeError("Cannot convert first argument to object"); var to = Object(target); @@ -295,9 +295,8 @@ function endsWith(target, searchString, position) { } function toArray(items, columnNames) { - if (Array.isArray(items)) { - return items; - }var rows = []; + if (Array.isArray(items)) return items; + var rows = []; for (var key in items) { var item = {}; item[columnNames[0] || 'key'] = key; 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/cli.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js deleted file mode 100755 index b83f63b907e2e0..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env node -'use strict'; -var fs = require('fs'); -var pkg = require('./package.json'); -var stripAnsi = require('./'); -var argv = process.argv.slice(2); -var input = argv[0]; - -function help() { - console.log([ - '', - ' ' + pkg.description, - '', - ' Usage', - ' strip-ansi > ', - ' cat | strip-ansi > ', - '', - ' Example', - ' strip-ansi unicorn.txt > unicorn-stripped.txt' - ].join('\n')); -} - -function init(data) { - process.stdout.write(stripAnsi(data)); -} - -if (argv.indexOf('--help') !== -1) { - help(); - return; -} - -if (argv.indexOf('--version') !== -1) { - console.log(pkg.version); - return; -} - -if (!input && process.stdin.isTTY) { - help(); - return; -} - -if (input) { - init(fs.readFileSync(input, 'utf8')); -} else { - process.stdin.setEncoding('utf8'); - process.stdin.on('data', init); -} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index 2fcdd1e472f961..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/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/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 da92c5d12e08b3..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,77 +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": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "http://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```sh\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*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()`.*\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@1.1.1", - "_shasum": "41c847194646375e6a1a5d10c3ca054ef9fc980d", - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", - "_from": "ansi-regex@>=1.0.0 <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/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md deleted file mode 100644 index ae876e7292feb7..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/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/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 e43cfb5a5c4d09..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "strip-ansi", - "version": "2.0.1", - "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": "http://sindresorhus.com" - }, - "bin": { - "strip-ansi": "cli.js" - }, - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "files": [ - "index.js", - "cli.js" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^1.0.0" - }, - "devDependencies": { - "mocha": "*" - }, - "readme": "# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi)\n\n> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```sh\n$ npm install --save strip-ansi\n```\n\n\n## Usage\n\n```js\nvar stripAnsi = require('strip-ansi');\n\nstripAnsi('\\u001b[4mcake\\u001b[0m');\n//=> 'cake'\n```\n\n\n## CLI\n\n```sh\n$ npm install --global strip-ansi\n```\n\n```sh\n$ strip-ansi --help\n\n Usage\n strip-ansi > \n cat | strip-ansi > \n\n Example\n strip-ansi unicorn.txt > unicorn-stripped.txt\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "bugs": { - "url": "https://github.com/sindresorhus/strip-ansi/issues" - }, - "homepage": "https://github.com/sindresorhus/strip-ansi#readme", - "_id": "strip-ansi@2.0.1", - "_shasum": "df62c1aa94ed2f114e1d0f21fd1d50482b79a60e", - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", - "_from": "strip-ansi@>=2.0.1 <3.0.0" -} 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 53ec26436ca545..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,43 +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 - -```sh -$ npm install --save strip-ansi -``` - - -## Usage - -```js -var stripAnsi = require('strip-ansi'); - -stripAnsi('\u001b[4mcake\u001b[0m'); -//=> 'cake' -``` - - -## CLI - -```sh -$ npm install --global strip-ansi -``` - -```sh -$ strip-ansi --help - - Usage - strip-ansi > - cat | strip-ansi > - - Example - strip-ansi unicorn.txt > unicorn-stripped.txt -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) 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 dc56f3f191f7fb..84d16fb51829a7 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,26 +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", + "gitHead": "0e8216efc672496b612fd7ab62159117d16ec4a0", "homepage": "https://github.com/pvorb/node-clone", - "_id": "clone@0.1.19", - "_shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", - "_from": "clone@>=0.1.5 <0.2.0", + "_id": "clone@1.0.2", + "_shasum": "260b7a99ebb1edfe247538175f783243cb19d149", + "_from": "clone@>=1.0.2 <2.0.0", "_npmVersion": "1.4.14", "_npmUser": { "name": "pvorb", @@ -118,10 +125,10 @@ } ], "dist": { - "shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", - "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz" + "shasum": "260b7a99ebb1edfe247538175f783243cb19d149", + "tarball": "http://registry.npmjs.org/clone/-/clone-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz", + "_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", "readme": "ERROR: No README data found!" } 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 eea2e9b0f60bc9..8ad5116c70bd7a 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,35 +20,36 @@ }, "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", "readme": "ERROR: No README data found!" } 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 49fc6f0408a7a5..4744d9dc3f7f7b 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json @@ -56,6 +56,5 @@ "shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", "tarball": "http://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!" + "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" } diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json index eaef8abcb89b51..b4c3738c870af5 100644 --- a/deps/npm/node_modules/columnify/package.json +++ b/deps/npm/node_modules/columnify/package.json @@ -1,7 +1,7 @@ { "name": "columnify", - "version": "1.5.1", - "description": "Render data in text columns. supports in-column text-wrap.", + "version": "1.5.4", + "description": "Render data in text columns. Supports in-column text-wrap.", "main": "columnify.js", "scripts": { "pretest": "npm prune", @@ -9,15 +9,22 @@ "bench": "npm test && node bench", "prepublish": "make prepublish" }, + "babel": { + "presets": [ + "es2015" + ] + }, "author": { "name": "Tim Oxley" }, "license": "MIT", "devDependencies": { - "babel": "^5.0.10", - "chalk": "^1.0.0", - "tap-spec": "^3.0.0", - "tape": "^4.0.0" + "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" }, "repository": { "type": "git", @@ -37,18 +44,18 @@ }, "homepage": "https://github.com/timoxley/columnify", "dependencies": { - "strip-ansi": "^2.0.1", + "strip-ansi": "^3.0.0", "wcwidth": "^1.0.0" }, "directories": { "test": "test" }, - "gitHead": "1e5f5ec9478d7dbd1e3d1d74343b552da7ae01ba", - "_id": "columnify@1.5.1", - "_shasum": "15fdda803a3875f87f9d302b3bc828932d664003", - "_from": "columnify@>=1.5.1 <1.6.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "0.10.36", + "gitHead": "b5373b3d6344bf59e1ab63c912c188c34bce5889", + "_id": "columnify@1.5.4", + "_shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb", + "_from": "columnify@latest", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.3", "_npmUser": { "name": "timoxley", "email": "secoif@gmail.com" @@ -60,9 +67,8 @@ } ], "dist": { - "shasum": "15fdda803a3875f87f9d302b3bc828932d664003", - "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.1.tgz" + "shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb", + "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz" }, - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz" } 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..699311ed04c04f 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 @@ -44,5 +44,6 @@ } ], "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", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/config-chain/package.json b/deps/npm/node_modules/config-chain/package.json index b25913cab0143b..ecbf8f621f1fbe 100644 --- a/deps/npm/node_modules/config-chain/package.json +++ b/deps/npm/node_modules/config-chain/package.json @@ -1,6 +1,6 @@ { "name": "config-chain", - "version": "1.1.9", + "version": "1.1.10", "licenses": [ { "type": "MIT", @@ -11,11 +11,11 @@ "homepage": "http://github.com/dominictarr/config-chain", "repository": { "type": "git", - "url": "https://github.com/dominictarr/config-chain.git" + "url": "git+https://github.com/dominictarr/config-chain.git" }, "dependencies": { "proto-list": "~1.2.1", - "ini": "1" + "ini": "^1.3.4" }, "devDependencies": { "tap": "0.3.0" @@ -28,19 +28,23 @@ "scripts": { "test": "tap test/" }, - "gitHead": "832609897082a0a887c59dadb105f4db6de1ab4c", + "gitHead": "0b6db3e14b9cdbe31460292bc4caf3983f977816", "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", + "_id": "config-chain@1.1.10", + "_shasum": "7fc383de0fcc84d711cb465bd176579cad612346", + "_from": "config-chain@latest", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", "_npmUser": { "name": "dominictarr", "email": "dominic.tarr@gmail.com" }, + "dist": { + "shasum": "7fc383de0fcc84d711cb465bd176579cad612346", + "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz" + }, "maintainers": [ { "name": "dominictarr", @@ -51,10 +55,7 @@ "email": "i@izs.me" } ], - "dist": { - "shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e", - "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz" + "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz", + "readme": "ERROR: No README data found!" } 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/fs-vacuum/node_modules/graceful-fs/.npmignore b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/README.md b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/node_modules/graceful-fs/package.json b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/package.json deleted file mode 100644 index 6aa482b61bbd8c..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - "graceful-fs@^3.0.2", - "/Users/isaacs/dev/npm/npm/node_modules/fs-vacuum" - ] - ], - "_from": "graceful-fs@>=3.0.2 <4.0.0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/fs-vacuum/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.2", - "rawSpec": "^3.0.2", - "scope": null, - "spec": ">=3.0.2 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "/fs-vacuum" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@^3.0.2", - "_where": "/Users/isaacs/dev/npm/npm/node_modules/fs-vacuum", - "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/fs-vacuum/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/fs-vacuum/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/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json index 3b4935451812b4..c7d9895a924d72 100644 --- a/deps/npm/node_modules/fs-vacuum/package.json +++ b/deps/npm/node_modules/fs-vacuum/package.json @@ -1,6 +1,6 @@ { "name": "fs-vacuum", - "version": "1.2.6", + "version": "1.2.7", "description": "recursively remove empty directories -- to a point", "main": "vacuum.js", "scripts": { @@ -30,30 +30,14 @@ "tmp": "0.0.24" }, "dependencies": { - "graceful-fs": "^3.0.2", + "graceful-fs": "^4.1.2", "path-is-inside": "^1.0.1", "rimraf": "^2.2.8" }, - "gitHead": "04b5093ac6fbcc4135835fb1c4ed990dfed5a04c", - "_id": "fs-vacuum@1.2.6", - "_shasum": "860c5e4b3e3aa2a6a3cbb327c57534f3a3bff642", - "_from": "fs-vacuum@>=1.2.5 <1.3.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - "dist": { - "shasum": "860c5e4b3e3aa2a6a3cbb327c57534f3a3bff642", - "tarball": "http://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.6.tgz" - }, - "maintainers": [ - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.6.tgz" + "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" } 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=3.0.2 <4.0.0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/fs-write-stream-atomic/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.2", - "rawSpec": "^3.0.2", - "scope": null, - "spec": ">=3.0.2 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "/fs-write-stream-atomic" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@^3.0.2", - "_where": "/Users/isaacs/dev/npm/npm/node_modules/fs-write-stream-atomic", - "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/fs-write-stream-atomic/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/fs-write-stream-atomic/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/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.npmignore rename to deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE new file mode 100644 index 00000000000000..19d5f4bce547ba --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/iferr/README.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md new file mode 100644 index 00000000000000..0940763fa94137 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/iferr/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee new file mode 100644 index 00000000000000..da6d00719f10c4 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/iferr/index.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js new file mode 100644 index 00000000000000..78fce3d2b0965a --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/iferr/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json new file mode 100644 index 00000000000000..9017857c56ddbc --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/iferr/test/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee new file mode 100644 index 00000000000000..be0bc56fdf1b96 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/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/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts new file mode 100644 index 00000000000000..019defcf152a84 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts @@ -0,0 +1,2 @@ +--compilers coffee:coffee-script/register +--reporter spec diff --git a/deps/npm/node_modules/fs-write-stream-atomic/package.json b/deps/npm/node_modules/fs-write-stream-atomic/package.json index c300228a5d3361..0fae54c40a2449 100644 --- a/deps/npm/node_modules/fs-write-stream-atomic/package.json +++ b/deps/npm/node_modules/fs-write-stream-atomic/package.json @@ -1,23 +1,28 @@ { "name": "fs-write-stream-atomic", - "version": "1.0.3", + "version": "1.0.8", "description": "Like `fs.createWriteStream(...)`, but atomic.", "main": "index.js", "directories": { "test": "test" }, "dependencies": { - "graceful-fs": "^3.0.2" + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" }, "devDependencies": { - "tap": "^0.4.12" + "rimraf": "^2.4.4", + "standard": "^5.4.1", + "tap": "^2.3.1" }, "scripts": { - "test": "tap test/*.js" + "test": "standard && tap --coverage test/*.js" }, "repository": { "type": "git", - "url": "https://github.com/npm/fs-write-stream-atomic" + "url": "git+https://github.com/npm/fs-write-stream-atomic.git" }, "author": { "name": "Isaac Z. Schlueter", @@ -29,29 +34,37 @@ "url": "https://github.com/npm/fs-write-stream-atomic/issues" }, "homepage": "https://github.com/npm/fs-write-stream-atomic", - "gitHead": "78573c09271f3ec672740862dad80be3d75e1963", - "_id": "fs-write-stream-atomic@1.0.3", - "_shasum": "c8fe17f66d7d3f50e9aee59195c358e7710372cc", - "_from": "fs-write-stream-atomic@1.0.3", - "_npmVersion": "2.7.6", - "_nodeVersion": "1.6.2", + "gitHead": "b55824ee4de7f1ca23784929d68b1b8f5edbf4a4", + "_id": "fs-write-stream-atomic@1.0.8", + "_shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b", + "_from": "fs-write-stream-atomic@>=1.0.5 <1.1.0", + "_npmVersion": "3.5.2", + "_nodeVersion": "4.2.2", "_npmUser": { "name": "iarna", "email": "me@re-becca.org" }, "dist": { - "shasum": "c8fe17f66d7d3f50e9aee59195c358e7710372cc", - "tarball": "http://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.3.tgz" + "shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b", + "tarball": "http://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz" }, "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, { "name": "isaacs", "email": "i@izs.me" }, { - "name": "iarna", - "email": "me@re-becca.org" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" } ], - "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.3.tgz" + "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz" } diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js b/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js index 159c596ab0181f..d0205e15f4389c 100644 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js +++ b/deps/npm/node_modules/fs-write-stream-atomic/test/basic.js @@ -1,7 +1,14 @@ +var fs = require('graceful-fs') var test = require('tap').test -var writeStream = require('../index.js') -var fs = require('fs') var path = require('path') +var writeStream = require('../index.js') + +var rename = fs.rename +fs.rename = function (from, to, cb) { + setTimeout(function () { + rename(from, to, cb) + }, 100) +} test('basic', function (t) { // open 10 write streams to the same file. @@ -10,40 +17,41 @@ test('basic', function (t) { var target = path.resolve(__dirname, 'test.txt') var n = 10 + // We run all of our assertions twice: + // once for finish, once for close + // There are 6 assertions, two fixed, plus 4 lines in the file. + t.plan(n * 2 * 6) + var streams = [] for (var i = 0; i < n; i++) { var s = writeStream(target) - s.on('finish', verifier('finish')) - s.on('close', verifier('close')) + s.on('finish', verifier('finish', i)) + s.on('close', verifier('close', i)) streams.push(s) } - var verifierCalled = 0 - function verifier (ev) { return function () { - if (ev === 'close') - t.equal(this.__emittedFinish, true) - else { - this.__emittedFinish = true - t.equal(ev, 'finish') - } - - // make sure that one of the atomic streams won. - var res = fs.readFileSync(target, 'utf8') - var lines = res.trim().split(/\n/) - lines.forEach(function (line) { - var first = lines[0].match(/\d+$/)[0] - var cur = line.match(/\d+$/)[0] - t.equal(cur, first) - }) + function verifier (ev, num) { + return function () { + if (ev === 'close') { + t.equal(this.__emittedFinish, true, num + '. closed only after finish') + } else { + this.__emittedFinish = true + t.equal(ev, 'finish', num + '. finished') + } - var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/ - t.similar(res, resExpr) + // make sure that one of the atomic streams won. + var res = fs.readFileSync(target, 'utf8') + var lines = res.trim().split(/\n/) + lines.forEach(function (line, lineno) { + var first = lines[0].match(/\d+$/)[0] + var cur = line.match(/\d+$/)[0] + t.equal(cur, first, num + '. line ' + lineno + ' matches') + }) - // should be called once for each close, and each finish - if (++verifierCalled === n * 2) { - t.end() + var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/ + t.similar(res, resExpr, num + '. content matches') } - }} + } // now write something to each stream. streams.forEach(function (stream, i) { diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js b/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js new file mode 100644 index 00000000000000..1733cf27ec2089 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js @@ -0,0 +1,44 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-chown') + +test('chown works', function (t) { + t.plan(1) + var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, false, 'no errors before close') + }) + stream.end() +}) + +test('chown fails', function (t) { + t.plan(1) + fs.chown = function (file, uid, gid, cb) { + cb(new Error('TEST BREAK')) + } + var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}}) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, true, 'error before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js new file mode 100644 index 00000000000000..7e27f0bfb0f616 --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js @@ -0,0 +1,30 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-rename') + +test('rename fails', function (t) { + t.plan(1) + fs.rename = function (src, dest, cb) { + cb(new Error('TEST BREAK')) + } + var stream = writeStream(target) + var hadError = false + stream.on('error', function (er) { + hadError = true + console.log('#', er) + }) + stream.on('close', function () { + t.is(hadError, true, 'error before close') + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js b/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js new file mode 100644 index 00000000000000..9840a6ef0308bf --- /dev/null +++ b/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js @@ -0,0 +1,40 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var rimraf = require('rimraf') +var writeStream = require('../index.js') + +var target = path.resolve(__dirname, 'test-chown') + +test('slow close', function (t) { + t.plan(2) + // The goal here is to simulate the "file close" step happening so slowly + // that the whole close/rename process could finish before the file is + // actually closed (and thus buffers truely flushed to the OS). In + // previous versions of this module, this would result in the module + // emitting finish & close before the file was fully written and in + // turn, could break other layers that tried to read the new file. + var realEmit = fs.WriteStream.prototype.emit + var reallyClosed = false + fs.WriteStream.prototype.emit = function (event) { + if (event !== 'close') return realEmit.apply(this, arguments) + setTimeout(function () { + reallyClosed = true + realEmit.call(this, 'close') + }.bind(this), 200) + } + var stream = writeStream(target) + stream.on('finish', function () { + t.is(reallyClosed, true, "didn't finish before target was closed") + }) + stream.on('close', function () { + t.is(reallyClosed, true, "didn't close before target was closed") + }) + stream.end() +}) + +test('cleanup', function (t) { + rimraf.sync(target) + t.end() +}) diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js b/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js index e5b2b05b8c3a04..f146cc55b1dabc 100644 --- a/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js +++ b/deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js @@ -2,7 +2,7 @@ var path = require('path') var test = require('tap').test var writeStream = require('../index.js') -function repeat(times, string) { +function repeat (times, string) { var output = '' for (var ii = 0; ii < times; ++ii) { output += string @@ -10,15 +10,20 @@ function repeat(times, string) { return output } -var target = path.resolve(__dirname, repeat(1000,'test')) +var target = path.resolve(__dirname, repeat(1000, 'test')) test('name too long', function (t) { + t.plan(2) var stream = writeStream(target) + var hadError = false stream.on('error', function (er) { - t.is(er.code, 'ENAMETOOLONG', target.length + " character name results in ENAMETOOLONG") + if (!hadError) { + t.is(er.code, 'ENAMETOOLONG', target.length + ' character name results in ENAMETOOLONG') + hadError = true + } }) stream.on('close', function () { - t.end() + t.ok(hadError, 'got error before close') }) stream.end() -}) \ No newline at end of file +}) diff --git a/deps/npm/node_modules/fstream-npm/.travis.yml b/deps/npm/node_modules/fstream-npm/.travis.yml new file mode 100644 index 00000000000000..3637c003fcd0aa --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/.travis.yml @@ -0,0 +1,15 @@ +language: node_js +sudo: false +node_js: + - "5" + - "4" + - iojs + - "0.12" + - "0.10" + - "0.8" +before_install: + - "npm config set spin false" + - "npm install -g npm" +script: "npm test" +notifications: + slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/node_modules/fstream-npm/fstream-npm.js b/deps/npm/node_modules/fstream-npm/fstream-npm.js index ab528952c104cb..8f8114fe89a123 100644 --- a/deps/npm/node_modules/fstream-npm/fstream-npm.js +++ b/deps/npm/node_modules/fstream-npm/fstream-npm.js @@ -89,17 +89,19 @@ Packer.prototype.readBundledLinks = function () { } Packer.prototype.applyIgnores = function (entry, partial, entryObj) { - // package.json files can never be ignored. - if (entry === 'package.json') return true + if (!entryObj || entryObj.type !== 'Directory') { + // 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 + // 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 + // 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 + // 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 @@ -109,16 +111,20 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) { if (mainFile && path.resolve(this.path, entry) === path.resolve(this.path, mainFile)) return true // some files are *never* allowed under any circumstances + // (VCS folders, native build cruft, npm cruft, regular cruft) if (entry === '.git' || - entry === '.lock-wscript' || - entry.match(/^\.wafpickle-[0-9]+$/) || entry === 'CVS' || entry === '.svn' || entry === '.hg' || + entry === '.lock-wscript' || + entry.match(/^\.wafpickle-[0-9]+$/) || + (this.parent && this.parent.packageRoot && this.basename === 'build' && + entry === 'config.gypi') || + entry === 'npm-debug.log' || + entry === '.npmrc' || entry.match(/^\..*\.swp$/) || entry === '.DS_Store' || - entry.match(/^\._/) || - entry === 'npm-debug.log' + entry.match(/^\._/) ) { return false } 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/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 e44a6dd92ba24f..7b5da94c0440d3 100644 --- a/deps/npm/node_modules/fstream-npm/package.json +++ b/deps/npm/node_modules/fstream-npm/package.json @@ -6,13 +6,13 @@ }, "name": "fstream-npm", "description": "fstream class for creating npm packages", - "version": "1.0.4", + "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" + "test": "standard && tap test/*.js" }, "main": "./fstream-npm.js", "dependencies": { @@ -20,17 +20,21 @@ "inherits": "2" }, "devDependencies": { - "standard": "^4.3.1" + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.1", + "rimraf": "^2.4.2", + "standard": "^4.3.1", + "tap": "^1.3.2" }, "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": "d4bec1d24e777b8cef64857d26af828cff1bba68", + "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.4", - "_shasum": "22196318b8fc2ab5ce15fd330fff931165e0305a", - "_from": "fstream-npm@>=1.0.3 <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 new file mode 100644 index 00000000000000..ac94251f72caa2 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/test/ignores.js @@ -0,0 +1,132 @@ +var fs = require('graceful-fs') +var join = require('path').join + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var Packer = require('..') + +var pkg = join(__dirname, 'test-package') + +var elfJS = function () {/* +module.exports = function () { + console.log("i'm a elf") +} +*/}.toString().split('\n').slice(1, -1).join() + +var json = { + 'name': 'test-package', + 'version': '3.1.4', + 'main': 'elf.js' +} + +test('setup', function (t) { + setup() + t.end() +}) + +var included = [ + 'package.json', + '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') + + // 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 () { + // 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) { + // rimraf.sync chokes here for some reason + rimraf(pkg, function () { t.end() }) +}) + +function setup () { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync( + join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + fs.writeFileSync( + join(pkg, 'elf.js'), + elfJS + ) + + fs.writeFileSync( + join(pkg, '.npmrc'), + 'packaged=false' + ) + + fs.writeFileSync( + 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(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" + ) + + 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/node_modules/graceful-fs/.npmignore b/deps/npm/node_modules/fstream/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/fstream/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/fstream/node_modules/graceful-fs/README.md b/deps/npm/node_modules/fstream/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/fstream/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/node_modules/graceful-fs/package.json b/deps/npm/node_modules/fstream/node_modules/graceful-fs/package.json deleted file mode 100644 index 458bb9538dbfd4..00000000000000 --- a/deps/npm/node_modules/fstream/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - "graceful-fs@3", - "/Users/isaacs/dev/npm/npm/node_modules/fstream" - ] - ], - "_from": "graceful-fs@>=3.0.0 <4.0.0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/fstream/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", - "rawSpec": "3", - "scope": null, - "spec": ">=3.0.0 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "/fstream" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@3", - "_where": "/Users/isaacs/dev/npm/npm/node_modules/fstream", - "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/fstream/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/fstream/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/fstream/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/fstream/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/fstream/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/fstream/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/fstream/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/fstream/package.json b/deps/npm/node_modules/fstream/package.json index 0109d940c27aa1..8c008195442823 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -6,7 +6,7 @@ }, "name": "fstream", "description": "Advanced file system stream things", - "version": "1.0.7", + "version": "1.0.8", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream.git" @@ -16,7 +16,7 @@ "node": ">=0.6" }, "dependencies": { - "graceful-fs": "3", + "graceful-fs": "^4.1.2", "inherits": "~2.0.0", "mkdirp": ">=0.5 0", "rimraf": "2" @@ -31,12 +31,12 @@ "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": "586e8efc1cf77883f6c22fc32a7cb38f0eb88911", + "gitHead": "d9f81146c50e687f1df04c1a0e7e4c173eb3dae2", "bugs": { "url": "https://github.com/isaacs/fstream/issues" }, "homepage": "https://github.com/isaacs/fstream#readme", - "_id": "fstream@1.0.7", - "_shasum": "455a1aa1d46077668d95b6d27838e1b1daa78c78", - "_from": "fstream@>=1.0.7 <1.1.0" + "_id": "fstream@1.0.8", + "_shasum": "7e8d7a73abb3647ef36e4b8a15ca801dba03d038", + "_from": "fstream@1.0.8" } diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index e4c9fb00206fad..2949b83be0637f 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -6,7 +6,7 @@ }, "name": "glob", "description": "a little globber", - "version": "5.0.14", + "version": "5.0.15", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" @@ -23,7 +23,7 @@ "dependencies": { "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^2.0.1", + "minimatch": "2 || 3", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -43,23 +43,23 @@ "benchclean": "node benchclean.js" }, "license": "ISC", - "gitHead": "c47d4514f8f93f23b589afa18947306116bfe40f", + "gitHead": "3a7e71d453dd80e75b196fd262dd23ed54beeceb", "bugs": { "url": "https://github.com/isaacs/node-glob/issues" }, "homepage": "https://github.com/isaacs/node-glob#readme", - "_id": "glob@5.0.14", - "_shasum": "a811d507acb605441edd6cd2622a3c6f06cc00e1", - "_from": "glob@latest", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", + "_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": "a811d507acb605441edd6cd2622a3c6f06cc00e1", - "tarball": "http://registry.npmjs.org/glob/-/glob-5.0.14.tgz" + "shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1", + "tarball": "http://registry.npmjs.org/glob/-/glob-5.0.15.tgz" }, "maintainers": [ { @@ -68,5 +68,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.14.tgz" + "_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "readme": "ERROR: No README data found!" } 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..d519c205d901d5 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,45 +1,10 @@ { - "_args": [ - [ - "graceful-fs@latest", - "/Users/isaacs/dev/npm/npm" - ] - ], - "_from": "graceful-fs@latest", - "_id": "graceful-fs@4.1.2", - "_inCache": true, - "_location": "/graceful-fs", - "_nodeVersion": "2.2.1", - "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - "_npmVersion": "3.0.0", - "_phantomChildren": {}, - "_requested": { - "name": "graceful-fs", - "raw": "graceful-fs@latest", - "rawSpec": "latest", - "scope": null, - "spec": "latest", - "type": "tag" - }, - "_requiredBy": [ - "/" - ], - "_shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37", - "_shrinkwrap": null, - "_spec": "graceful-fs@latest", - "_where": "/Users/isaacs/dev/npm/npm", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "dependencies": {}, + "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "3.0.8", + "version": "4.1.3", "repository": { "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" + "url": "git+https://github.com/isaacs/node-graceful-fs.git" }, "main": "graceful-fs.js", "engines": { @@ -48,21 +13,9 @@ "directories": { "test": "test" }, - "dist": { - "shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz" - }, - "engines": { - "node": ">=0.4.0" + "scripts": { + "test": "node test.js | tap -" }, - "files": [ - "fs.js", - "graceful-fs.js", - "legacy-streams.js", - "polyfills.js" - ], - "gitHead": "c286080071b6be9aa9ba108b0bb9b44ff122926d", - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ "fs", "module", @@ -83,25 +36,31 @@ "devDependencies": { "mkdirp": "^0.5.0", "rimraf": "^2.2.8", - "tap": "^1.2.0" + "tap": "^5.4.2" }, - "gitHead": "45c57aa5e323c35a985a525de6f0c9a6ef59e1f8", + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js" + ], + "gitHead": "694c56f3aed4aee62d6df169be123d3984f61b85", "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", + "_id": "graceful-fs@4.1.3", + "_shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", + "_from": "graceful-fs@latest", + "_npmVersion": "3.7.0", + "_nodeVersion": "4.0.0", "_npmUser": { "name": "isaacs", - "email": "isaacs@npmjs.com" + "email": "i@izs.me" }, "dist": { - "shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" + "shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz" }, "maintainers": [ { @@ -109,14 +68,9 @@ "email": "i@izs.me" } ], - "name": "graceful-fs", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/node-graceful-fs.git" - }, - "scripts": { - "test": "node test.js | tap -" + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/graceful-fs-4.1.3.tgz_1454449326495_0.943017533281818" }, - "version": "4.1.2" + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz" } 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..d1e69bca8cc1b8 --- /dev/null +++ b/deps/npm/node_modules/imurmurhash/package.json @@ -0,0 +1,60 @@ +{ + "name": "imurmurhash", + "version": "0.1.4", + "description": "An incremental implementation of MurmurHash3", + "homepage": "https://github.com/jensyt/imurmurhash-js", + "main": "imurmurhash.js", + "files": [ + "imurmurhash.js", + "imurmurhash.min.js", + "package.json", + "README.md" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/jensyt/imurmurhash-js.git" + }, + "bugs": { + "url": "https://github.com/jensyt/imurmurhash-js/issues" + }, + "keywords": [ + "murmur", + "murmurhash", + "murmurhash3", + "hash", + "incremental" + ], + "author": { + "name": "Jens Taylor", + "email": "jensyt@gmail.com", + "url": "https://github.com/homebrewing" + }, + "license": "MIT", + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.8.19" + }, + "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", + "_id": "imurmurhash@0.1.4", + "dist": { + "shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "tarball": "http://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" + }, + "_from": "imurmurhash@0.1.4", + "_npmVersion": "1.3.2", + "_npmUser": { + "name": "jensyt", + "email": "jensyt@gmail.com" + }, + "maintainers": [ + { + "name": "jensyt", + "email": "jensyt@gmail.com" + } + ], + "directories": {}, + "_shasum": "9218b9b2b928a238b13dc4fb6b6d576f231453ea", + "_resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz" +} 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/init-package-json/default-input.js b/deps/npm/node_modules/init-package-json/default-input.js index ef5161e7926a96..59f8fec6121a8c 100644 --- a/deps/npm/node_modules/init-package-json/default-input.js +++ b/deps/npm/node_modules/init-package-json/default-input.js @@ -32,6 +32,9 @@ function readDeps (test) { return function (cb) { try { p = JSON.parse(p) } catch (e) { return next() } if (!p.version) return next() + if (p._requiredBy) { + if (!p._requiredBy.some(function (req) { return req === '#USER' })) return next() + } deps[d] = config.get('save-exact') ? p.version : config.get('save-prefix') + p.version return next() }) diff --git a/deps/npm/node_modules/init-package-json/init-package-json.js b/deps/npm/node_modules/init-package-json/init-package-json.js index 5e50e712747a18..87c72ccf948b7e 100644 --- a/deps/npm/node_modules/init-package-json/init-package-json.js +++ b/deps/npm/node_modules/init-package-json/init-package-json.js @@ -106,7 +106,9 @@ function init (dir, input, config, cb) { var d = JSON.stringify(pkg, null, 2) + '\n' function write (yes) { fs.writeFile(package, d, 'utf8', function (er) { - if (!er && yes) console.log('Wrote to %s:\n\n%s\n', package, d) + if (!er && yes && !config.get('silent')) { + console.log('Wrote to %s:\n\n%s\n', package, d) + } return cb(er, pkg) }) } 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/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/request/node_modules/har-validator/node_modules/chalk/node_modules/has-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/request/node_modules/har-validator/node_modules/chalk/node_modules/has-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..39372636f3fb4f --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,70 @@ +{ + "name": "path-is-absolute", + "version": "1.0.0", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "_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!" +} 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..19e926cbf1035a --- /dev/null +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/package.json @@ -0,0 +1,73 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "6.0.4", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.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" + }, + "license": "ISC", + "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "_id": "glob@6.0.4", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_from": "glob@>=6.0.0 <7.0.0", + "_npmVersion": "2.14.15", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "readme": "ERROR: No README data found!" +} 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/package.json b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json index 1407e97be584d7..42900314b94c93 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json @@ -8,7 +8,7 @@ "description": "prompting wizardly", "version": "0.3.0", "repository": { - "url": "git://github.com/isaacs/promzard.git" + "url": "git://github.com/isaacs/promzard" }, "dependencies": { "read": "1" @@ -46,6 +46,5 @@ "tarball": "http://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz" } diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index ad9fab899bfc28..4be24267cfe9fc 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -1,13 +1,13 @@ { "name": "init-package-json", - "version": "1.7.1", + "version": "1.9.3", "main": "init-package-json.js", "scripts": { "test": "tap test/*.js" }, "repository": { "type": "git", - "url": "git://github.com/isaacs/init-package-json.git" + "url": "git+https://github.com/npm/init-package-json.git" }, "author": { "name": "Isaac Z. Schlueter", @@ -17,13 +17,13 @@ "license": "ISC", "description": "A node module to get your node module started", "dependencies": { - "glob": "^5.0.3", + "glob": "^6.0.0", "npm-package-arg": "^4.0.0", "promzard": "^0.3.0", "read": "~1.0.1", "read-package-json": "1 || 2", "semver": "2.x || 3.x || 4 || 5", - "validate-npm-package-license": "^2.0.0", + "validate-npm-package-license": "^3.0.1", "validate-npm-package-name": "^2.0.1" }, "devDependencies": { @@ -41,14 +41,42 @@ "prompt", "start" ], - "readme": "# init-package-json\n\nA node module to get your node module started.\n\n[![Build Status](https://secure.travis-ci.org/npm/init-package-json.svg)](http://travis-ci.org/npm/init-package-json)\n\n## Usage\n\n```javascript\nvar init = require('init-package-json')\nvar path = require('path')\n\n// a path to a promzard module. In the event that this file is\n// not found, one will be provided for you.\nvar initFile = path.resolve(process.env.HOME, '.npm-init')\n\n// the dir where we're doin stuff.\nvar dir = process.cwd()\n\n// extra stuff that gets put into the PromZard module's context.\n// In npm, this is the resolved config object. Exposed as 'config'\n// Optional.\nvar configData = { some: 'extra stuff' }\n\n// Any existing stuff from the package.json file is also exposed in the\n// PromZard module as the `package` object. There will also be free\n// vars for:\n// * `filename` path to the package.json file\n// * `basename` the tip of the package dir\n// * `dirname` the parent of the package dir\n\ninit(dir, initFile, configData, function (er, data) {\n // the data's already been written to {dir}/package.json\n // now you can do stuff with it\n})\n```\n\nOr from the command line:\n\n```\n$ npm-init\n```\n\nSee [PromZard](https://github.com/isaacs/promzard) for details about\nwhat can go in the config file.\n", - "readmeFilename": "README.md", - "gitHead": "443031e837c81bb10548212a7b3700b5dde94cfb", + "gitHead": "12eb24ff2f75f84a4a27436bc6f6cb765cbd9ee2", "bugs": { - "url": "https://github.com/isaacs/init-package-json/issues" + "url": "https://github.com/npm/init-package-json/issues" }, - "homepage": "https://github.com/isaacs/init-package-json#readme", - "_id": "init-package-json@1.7.1", - "_shasum": "32a8643779c91732d901a6fdc7505de7119fb7ad", - "_from": "init-package-json@>=1.7.1 <1.8.0" + "homepage": "https://github.com/npm/init-package-json#readme", + "_id": "init-package-json@1.9.3", + "_shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d", + "_from": "init-package-json@1.9.3", + "_npmVersion": "3.5.4", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d", + "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.9.3.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.3.tgz" } diff --git a/deps/npm/node_modules/init-package-json/test/silent.js b/deps/npm/node_modules/init-package-json/test/silent.js new file mode 100644 index 00000000000000..4937020562a3da --- /dev/null +++ b/deps/npm/node_modules/init-package-json/test/silent.js @@ -0,0 +1,23 @@ +var tap = require('tap') +var init = require('../') +var rimraf = require('rimraf') + +var log = console.log +var logged = false +console.log = function () { + logged = true +} + +tap.test('silent: true', function (t) { + init(__dirname, __dirname, {yes: 'yes', silent: true}, function (er, data) { + if (er) throw er + + t.false(logged, 'did not print anything') + t.end() + }) +}) + +tap.test('teardown', function (t) { + console.log = log + rimraf(__dirname + '/package.json', t.end.bind(t)) +}) diff --git a/deps/npm/node_modules/lru-cache/README.md b/deps/npm/node_modules/lru-cache/README.md index a8bba688f7202e..f804699809b9b9 100644 --- a/deps/npm/node_modules/lru-cache/README.md +++ b/deps/npm/node_modules/lru-cache/README.md @@ -7,7 +7,7 @@ A cache object that deletes the least-recently-used items. ```javascript var LRU = require("lru-cache") , options = { max: 500 - , length: function (n) { return n * 2 } + , length: function (n, key) { return n * 2 + key.length } , dispose: function (key, n) { n.close() } , maxAge: 1000 * 60 * 60 } , cache = LRU(options) @@ -16,6 +16,12 @@ var LRU = require("lru-cache") cache.set("key", "value") cache.get("key") // "value" +// non-string keys ARE fully supported +var someObject = {} +cache.set(someObject, 'a value') +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') + cache.reset() // empty the cache ``` @@ -35,9 +41,10 @@ away. 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 `n` - like-sized things. + to do something like `function(n, key){return n.length}`. The default is + `function(){return 1}`, which is fine if you want to store `max` + like-sized things. They item is passed as the first argument, and + the key is passed as the second argumnet. * `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 @@ -89,6 +96,12 @@ away. in the cache, in order of recent-ness. (Ie, more recently used items are iterated over first.) +* `rforEach(function(value,key,cache), [thisp])` + + The same as `cache.forEach(...)` but items are iterated over in + reverse order. (ie, less recently used items are iterated over + first.) + * `keys()` Return an array of the keys in the cache. @@ -102,8 +115,18 @@ away. Return total length of objects in cache taking into account `length` options function. -* `itemCount()` +* `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 index d66e7a2382f176..dccc6d59d27e15 100644 --- a/deps/npm/node_modules/lru-cache/lib/lru-cache.js +++ b/deps/npm/node_modules/lru-cache/lib/lru-cache.js @@ -1,15 +1,8 @@ -;(function () { // closure for web browsers +module.exports = LRUCache -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) -} +// This will be a proper iterable 'Map' in engines that support it, +// or a fakey-fake PseudoMap in older versions. +var Map = require('pseudomap') function naiveLength () { return 1 } @@ -54,17 +47,17 @@ 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 - } + this._length = this._lruList.size + this._cache.forEach(function (value, key) { + value.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 - } + this._cache.forEach(function (value, key) { + value.length = this._lengthCalculator(value.value, key) + this._length += value.length + }, this) } if (this._length > this._max) trim(this) @@ -78,69 +71,97 @@ Object.defineProperty(LRUCache.prototype, "length", , enumerable : true }) - Object.defineProperty(LRUCache.prototype, "itemCount", - { get : function () { return this._itemCount } + { get : function () { return this._lruList.size } , enumerable : true }) -LRUCache.prototype.forEach = function (fn, thisp) { +function reverseKeys (map) { + // keys live in lruList map in insertion order. + // we want them in reverse insertion order. + // flip the list of keys. + var itemCount = map.size + var keys = new Array(itemCount) + var i = itemCount + map.forEach(function (value, key) { + keys[--i] = key + }) + + return keys +} + +LRUCache.prototype.rforEach = 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) + this._lruList.forEach(function (hit) { + forEachStep(this, fn, hit, thisp) + }, this) +} + +function forEachStep (self, fn, hit, thisp) { + if (isStale(self, hit)) { + del(self, hit) + if (!self._allowStale) { + hit = undefined } } + if (hit) { + fn.call(thisp, hit.value, hit.key, self) + } } -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 + +LRUCache.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + + var keys = reverseKeys(this._lruList) + for (var k = 0; k < keys.length; k++) { + var hit = this._lruList.get(keys[k]) + forEachStep(this, fn, hit, thisp) } - return keys +} + +LRUCache.prototype.keys = function () { + return reverseKeys(this._lruList).map(function (k) { + return this._lruList.get(k).key + }, this) } 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 + return reverseKeys(this._lruList).map(function (k) { + return this._lruList.get(k).value + }, this) } LRUCache.prototype.reset = function () { if (this._dispose && this._cache) { - for (var k in this._cache) { - this._dispose(k, this._cache[k].value) - } + this._cache.forEach(function (entry, key) { + this._dispose(key, entry.value) + }, this) } - this._cache = Object.create(null) // hash of items by key - this._lruList = Object.create(null) // list of items in order of use recency + this._cache = new Map() // hash of items by key + this._lruList = new Map() // 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 } -// Provided for debugging/dev purposes only. No promises whatsoever that -// this API stays stable. LRUCache.prototype.dump = function () { - return this._cache + var arr = [] + var i = 0 + var size = this._lruList.size + return reverseKeys(this._lruList).map(function (k) { + var hit = this._lruList.get(k) + if (!isStale(this, hit)) { + return { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + } + } + }, this).filter(function (h) { + return h + }) } LRUCache.prototype.dumpLru = function () { @@ -149,22 +170,37 @@ LRUCache.prototype.dumpLru = function () { LRUCache.prototype.set = function (key, value, maxAge) { maxAge = maxAge || this._maxAge + var now = maxAge ? Date.now() : 0 + var len = this._lengthCalculator(value, key) + + if (this._cache.has(key)) { + if (len > this._max) { + del(this, this._cache.get(key)) + return false + } + + var item = this._cache.get(key) - if (hOP(this._cache, key)) { // dispose of the old one before overwriting if (this._dispose) - this._dispose(key, this._cache[key].value) + this._dispose(key, item.value) - this._cache[key].now = now - this._cache[key].maxAge = maxAge - this._cache[key].value = value + item.now = now + item.maxAge = maxAge + item.value = value + this._length += (len - item.length) + item.length = len this.get(key) + + if (this._length > this._max) + trim(this) + return true } - var len = this._lengthCalculator(value) - var hit = new Entry(key, value, this._mru++, len, now, maxAge) + var hit = new Entry(key, value, this._mru, len, now, maxAge) + incMru(this) // oversized objects fall out of cache automatically. if (hit.length > this._max) { @@ -173,8 +209,8 @@ LRUCache.prototype.set = function (key, value, maxAge) { } this._length += hit.length - this._lruList[hit.lu] = this._cache[key] = hit - this._itemCount ++ + this._cache.set(key, hit) + this._lruList.set(hit.lu, hit) if (this._length > this._max) trim(this) @@ -183,8 +219,8 @@ LRUCache.prototype.set = function (key, value, maxAge) { } LRUCache.prototype.has = function (key) { - if (!hOP(this._cache, key)) return false - var hit = this._cache[key] + if (!this._cache.has(key)) return false + var hit = this._cache.get(key) if (isStale(this, hit)) { return false } @@ -200,17 +236,39 @@ LRUCache.prototype.peek = function (key) { } LRUCache.prototype.pop = function () { - var hit = this._lruList[this._lru] + var hit = this._lruList.get(this._lru) del(this, hit) return hit || null } LRUCache.prototype.del = function (key) { - del(this, this._cache[key]) + del(this, this._cache.get(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] + var hit = self._cache.get(key) if (hit) { if (isStale(self, hit)) { del(self, hit) @@ -237,26 +295,35 @@ function isStale(self, hit) { function use (self, hit) { shiftLU(self, hit) - hit.lu = self._mru ++ - self._lruList[hit.lu] = hit + hit.lu = self._mru + incMru(self) + self._lruList.set(hit.lu, hit) } function trim (self) { - while (self._lru < self._mru && self._length > self._max) - del(self, self._lruList[self._lru]) + if (self._length > self._max) { + var keys = reverseKeys(self._lruList) + for (var k = keys.length - 1; self._length > self._max; k--) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + self._lru = keys[k - 1] + del(self, self._lruList.get(keys[k])) + } + } } function shiftLU (self, hit) { - delete self._lruList[ hit.lu ] - while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ + self._lruList.delete(hit.lu) + if (hit.lu === self._lru) + self._lru = reverseKeys(self._lruList).pop() } 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 ] + self._cache.delete(hit.key) shiftLU(self, hit) } } @@ -271,4 +338,19 @@ function Entry (key, value, lu, length, now, maxAge) { if (maxAge) this.maxAge = maxAge } -})() + +// Incrementers and decrementers that loop at MAX_SAFE_INTEGER +// only relevant for the lu, lru, and mru counters, since they +// get touched a lot and can get very large. Also, since they +// only go upwards, and the sets will tend to be much smaller than +// the max, we can very well assume that a very small number comes +// after a very large number, rather than before it. +var maxSafeInt = Number.MAX_SAFE_INTEGER || 9007199254740991 +function intInc (number) { + return (number === maxSafeInt) ? 0 : number + 1 +} +function incMru (self) { + do { + self._mru = intInc(self._mru) + } while (self._lruList.has(self._mru)) +} diff --git a/deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/LICENSE b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE similarity index 100% rename from deps/npm/node_modules/fs-vacuum/node_modules/graceful-fs/LICENSE rename to deps/npm/node_modules/lru-cache/node_modules/pseudomap/LICENSE diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/README.md b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/README.md new file mode 100644 index 00000000000000..778bf01dfaaf9f --- /dev/null +++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/README.md @@ -0,0 +1,60 @@ +# pseudomap + +A thing that is a lot like ES6 `Map`, but without iterators, for use +in environments where `for..of` syntax and `Map` are not available. + +If you need iterators, or just in general a more faithful polyfill to +ES6 Maps, check out [es6-map](http://npm.im/es6-map). + +If you are in an environment where `Map` is supported, then that will +be returned instead, unless `process.env.TEST_PSEUDOMAP` is set. + +You can use any value as keys, and any value as data. Setting again +with the identical key will overwrite the previous value. + +Internally, data is stored on an `Object.create(null)` style object. +The key is coerced to a string to generate the key on the internal +data-bag object. The original key used is stored along with the data. + +In the event of a stringified-key collision, a new key is generated by +appending an increasing number to the stringified-key until finding +either the intended key or an empty spot. + +Note that because object traversal order of plain objects is not +guaranteed to be identical to insertion order, the insertion order +guarantee of `Map.prototype.forEach` is not guaranteed in this +implementation. However, in all versions of Node.js and V8 where this +module works, `forEach` does traverse data in insertion order. + +## API + +Most of the [Map +API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), +with the following exceptions: + +1. A `Map` object is not an iterator. +2. `values`, `keys`, and `entries` methods are not implemented, + because they return iterators. +3. The argument to the constructor can be an Array of `[key, value]` + pairs, or a `Map` or `PseudoMap` object. But, since iterators + aren't used, passing any plain-old iterator won't initialize the + map properly. + +## USAGE + +Use just like a regular ES6 Map. + +```javascript +var PseudoMap = require('pseudomap') + +// optionally provide a pseudomap, or an array of [key,value] pairs +// as the argument to initialize the map with +var myMap = new PseudoMap() + +myMap.set(1, 'number 1') +myMap.set('1', 'string 1') +var akey = {} +var bkey = {} +myMap.set(akey, { some: 'data' }) +myMap.set(bkey, { some: 'other data' }) +``` diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/map.js b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/map.js new file mode 100644 index 00000000000000..c0ad39c029718f --- /dev/null +++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/map.js @@ -0,0 +1,122 @@ +if (process.env.npm_package_name === 'pseudomap' && + process.env.npm_lifecycle_script === 'test') + process.env.TEST_PSEUDOMAP = 'true' + +if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { + module.exports = Map + return +} + +var hasOwnProperty = Object.prototype.hasOwnProperty + +module.exports = PseudoMap + +function PseudoMap (set) { + if (!(this instanceof PseudoMap)) // whyyyyyyy + throw new TypeError("Constructor PseudoMap requires 'new'") + + this.clear() + + if (set) { + if ((set instanceof PseudoMap) || + (typeof Map === 'function' && set instanceof Map)) + set.forEach(function (value, key) { + this.set(key, value) + }, this) + else if (Array.isArray(set)) + set.forEach(function (kv) { + this.set(kv[0], kv[1]) + }, this) + else + throw new TypeError('invalid argument') + } +} + +PseudoMap.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + Object.keys(this._data).forEach(function (k) { + if (k !== 'size') + fn.call(thisp, this._data[k].value, this._data[k].key) + }, this) +} + +PseudoMap.prototype.has = function (k) { + return !!find(this._data, k) +} + +PseudoMap.prototype.get = function (k) { + var res = find(this._data, k) + return res && res.value +} + +PseudoMap.prototype.set = function (k, v) { + set(this._data, k, v) +} + +PseudoMap.prototype.delete = function (k) { + var res = find(this._data, k) + if (res) { + delete this._data[res._index] + this._data.size-- + } +} + +PseudoMap.prototype.clear = function () { + var data = Object.create(null) + data.size = 0 + + Object.defineProperty(this, '_data', { + value: data, + enumerable: false, + configurable: true, + writable: false + }) +} + +Object.defineProperty(PseudoMap.prototype, 'size', { + get: function () { + return this._data.size + }, + set: function (n) {}, + enumerable: true, + configurable: true +}) + +PseudoMap.prototype.values = +PseudoMap.prototype.keys = +PseudoMap.prototype.entries = function () { + throw new Error('iterators are not implemented in this version') +} + +// Either identical, or both NaN +function same (a, b) { + return a === b || a !== a && b !== b +} + +function Entry (k, v, i) { + this.key = k + this.value = v + this._index = i +} + +function find (data, k) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) + return data[key] + } +} + +function set (data, k, v) { + for (var i = 0, s = '_' + k, key = s; + hasOwnProperty.call(data, key); + key = s + i++) { + if (same(data[key].key, k)) { + data[key].value = v + return + } + } + data.size++ + data[key] = new Entry(k, v, key) +} diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/package.json b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/package.json new file mode 100644 index 00000000000000..a0161aca345563 --- /dev/null +++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/package.json @@ -0,0 +1,35 @@ +{ + "name": "pseudomap", + "version": "1.0.1", + "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.", + "main": "map.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "tap": "^2.3.1" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/pseudomap.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/isaacs/pseudomap/issues" + }, + "homepage": "https://github.com/isaacs/pseudomap#readme", + "readme": "# pseudomap\n\nA thing that is a lot like ES6 `Map`, but without iterators, for use\nin environments where `for..of` syntax and `Map` are not available.\n\nIf you need iterators, or just in general a more faithful polyfill to\nES6 Maps, check out [es6-map](http://npm.im/es6-map).\n\nIf you are in an environment where `Map` is supported, then that will\nbe returned instead, unless `process.env.TEST_PSEUDOMAP` is set.\n\nYou can use any value as keys, and any value as data. Setting again\nwith the identical key will overwrite the previous value.\n\nInternally, data is stored on an `Object.create(null)` style object.\nThe key is coerced to a string to generate the key on the internal\ndata-bag object. The original key used is stored along with the data.\n\nIn the event of a stringified-key collision, a new key is generated by\nappending an increasing number to the stringified-key until finding\neither the intended key or an empty spot.\n\nNote that because object traversal order of plain objects is not\nguaranteed to be identical to insertion order, the insertion order\nguarantee of `Map.prototype.forEach` is not guaranteed in this\nimplementation. However, in all versions of Node.js and V8 where this\nmodule works, `forEach` does traverse data in insertion order.\n\n## API\n\nMost of the [Map\nAPI](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map),\nwith the following exceptions:\n\n1. A `Map` object is not an iterator.\n2. `values`, `keys`, and `entries` methods are not implemented,\n because they return iterators.\n3. The argument to the constructor can be an Array of `[key, value]`\n pairs, or a `Map` or `PseudoMap` object. But, since iterators\n aren't used, passing any plain-old iterator won't initialize the\n map properly.\n\n## USAGE\n\nUse just like a regular ES6 Map.\n\n```javascript\nvar PseudoMap = require('pseudomap')\n\n// optionally provide a pseudomap, or an array of [key,value] pairs\n// as the argument to initialize the map with\nvar myMap = new PseudoMap()\n\nmyMap.set(1, 'number 1')\nmyMap.set('1', 'string 1')\nvar akey = {}\nvar bkey = {}\nmyMap.set(akey, { some: 'data' })\nmyMap.set(bkey, { some: 'other data' })\n```\n", + "readmeFilename": "README.md", + "_id": "pseudomap@1.0.1", + "_shasum": "29b4e7f37bbbf3e3c9b9152981c40f33d56b2b28", + "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.1.tgz", + "_from": "pseudomap@>=1.0.1 <2.0.0" +} diff --git a/deps/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js new file mode 100644 index 00000000000000..4378e4541e9a14 --- /dev/null +++ b/deps/npm/node_modules/lru-cache/node_modules/pseudomap/test/basic.js @@ -0,0 +1,86 @@ +var t = require('tap') + +process.env.TEST_PSEUDOMAP = 'true' + +var PM = require('../') +runTests(PM) + +// if possible, verify that Map also behaves the same way +if (typeof Map === 'function') + runTests(Map) + + +function runTests (Map) { + t.throws(Map) + + var m = new Map() + + t.equal(m.size, 0) + + m.set(1, '1 string') + t.equal(m.get(1), '1 string') + t.equal(m.size, 1) + m.size = 1000 + t.equal(m.size, 1) + m.size = 0 + t.equal(m.size, 1) + + m = new Map([[1, 'number 1'], ['1', 'string 1']]) + t.equal(m.get(1), 'number 1') + t.equal(m.get('1'), 'string 1') + t.equal(m.size, 2) + + m = new Map(m) + t.equal(m.get(1), 'number 1') + t.equal(m.get('1'), 'string 1') + t.equal(m.size, 2) + + var akey = {} + var bkey = {} + m.set(akey, { some: 'data' }) + m.set(bkey, { some: 'other data' }) + t.same(m.get(akey), { some: 'data' }) + t.same(m.get(bkey), { some: 'other data' }) + t.equal(m.size, 4) + + var x = /x/ + var y = /x/ + m.set(x, 'x regex') + m.set(y, 'y regex') + t.equal(m.get(x), 'x regex') + m.set(x, 'x again') + t.equal(m.get(x), 'x again') + t.equal(m.size, 6) + + m.set(NaN, 'not a number') + t.equal(m.get(NaN), 'not a number') + m.set(NaN, 'it is a ' + typeof NaN) + t.equal(m.get(NaN), 'it is a number') + m.set('NaN', 'stringie nan') + t.equal(m.get(NaN), 'it is a number') + t.equal(m.get('NaN'), 'stringie nan') + t.equal(m.size, 8) + + m.delete(NaN) + t.equal(m.get(NaN), undefined) + t.equal(m.size, 7) + + var expect = [ + { value: 'number 1', key: 1 }, + { value: 'string 1', key: '1' }, + { value: { some: 'data' }, key: {} }, + { value: { some: 'other data' }, key: {} }, + { value: 'x again', key: /x/ }, + { value: 'y regex', key: /x/ }, + { value: 'stringie nan', key: 'NaN' } + ] + var actual = [] + + m.forEach(function (value, key) { + actual.push({ value: value, key: key }) + }) + t.same(actual, expect) + + m.clear() + t.equal(m.size, 0) +} diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json index 5d0f9a27a92add..04e14d44bbdbbc 100644 --- a/deps/npm/node_modules/lru-cache/package.json +++ b/deps/npm/node_modules/lru-cache/package.json @@ -1,7 +1,7 @@ { "name": "lru-cache", "description": "A cache object that deletes the least-recently-used items.", - "version": "2.6.5", + "version": "3.2.0", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me" @@ -24,34 +24,17 @@ "weak": "" }, "license": "ISC", - "gitHead": "7062a0c891bfb80a294be9217e4de0f882e75776", + "dependencies": { + "pseudomap": "^1.0.1" + }, + "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n, key) { return n * 2 + key.length }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\n// non-string keys ARE fully supported\nvar someObject = {}\ncache.set(someObject, 'a value')\ncache.set('[object Object]', 'a different value')\nassert.equal(cache.get(someObject), 'a value')\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n, key){return n.length}`. The default is\n `function(){return 1}`, which is fine if you want to store `max`\n like-sized things. They item is passed as the first argument, and\n the key is passed as the second argumnet.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value, maxAge)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `rforEach(function(value,key,cache), [thisp])`\n\n The same as `cache.forEach(...)` but items are iterated over in\n reverse order. (ie, less recently used items are iterated over\n first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n\n* `dump()`\n\n Return an array of the cache entries ready for serialization and usage\n with 'destinationCache.load(arr)`.\n\n* `load(cacheEntriesArray)`\n\n Loads another cache entries array, obtained with `sourceCache.dump()`,\n into the cache. The destination cache is reset before loading new entries\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/node-lru-cache/issues" }, "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "_id": "lru-cache@2.6.5", - "_shasum": "e56d6354148ede8d7707b58d143220fd08df0fd5", - "_from": "lru-cache@2.6.5", - "_npmVersion": "3.0.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "e56d6354148ede8d7707b58d143220fd08df0fd5", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.6.5.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.6.5.tgz" + "_id": "lru-cache@3.2.0", + "_shasum": "71789b3b7f5399bec8565dda38aa30d2a097efee", + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-3.2.0.tgz", + "_from": "lru-cache@>=3.2.0 <3.3.0" } diff --git a/deps/npm/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/lru-cache/test/basic.js index 949113e9ce8bd7..02000a79593c31 100644 --- a/deps/npm/node_modules/lru-cache/test/basic.js +++ b/deps/npm/node_modules/lru-cache/test/basic.js @@ -93,40 +93,18 @@ test("reset", function (t) { }) -// Note: `.dump()` is a debugging tool only. No guarantees are made -// about the format/layout of the response. -test("dump", function (t) { - var cache = new LRU(10) - var d = cache.dump(); - t.equal(Object.keys(d).length, 0, "nothing in dump for empty cache") - cache.set("a", "A") - var d = cache.dump() // { a: { key: "a", value: "A", lu: 0 } } - t.ok(d.a) - t.equal(d.a.key, "a") - t.equal(d.a.value, "A") - t.equal(d.a.lu, 0) - - cache.set("b", "B") - cache.get("b") - d = cache.dump() - t.ok(d.b) - t.equal(d.b.key, "b") - t.equal(d.b.value, "B") - t.equal(d.b.lu, 2) - - t.end() -}) - - test("basic with weighed length", function (t) { var cache = new LRU({ max: 100, - length: function (item) { return item.size } + length: function (item, key) { + t.isa(key, 'string') + 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.lengthCalculator(cache.get("key"), 'key'), 50) t.equal(cache.length, 50) t.equal(cache.max, 100) t.end() @@ -182,6 +160,32 @@ test("lru recently gotten with weighed length", function (t) { 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, @@ -228,7 +232,7 @@ test("drop the old items", function(t) { }, 155) }) -test("individual item can have it's own maxAge", function(t) { +test("individual item can have its own maxAge", function(t) { var cache = new LRU({ max: 5, maxAge: 50 @@ -241,7 +245,7 @@ test("individual item can have it's own maxAge", function(t) { }, 25) }) -test("individual item can have it's own maxAge > cache's", function(t) { +test("individual item can have its own maxAge > cache's", function(t) { var cache = new LRU({ max: 5, maxAge: 20 @@ -393,3 +397,31 @@ test("pop the least used item", function (t) { t.end() }) + +test("get and set only accepts strings and numbers as keys", function(t) { + var cache = new LRU() + + cache.set("key", "value") + cache.set(123, 456) + + t.equal(cache.get("key"), "value") + t.equal(cache.get(123), 456) + + t.end() +}) + +test("peek with wierd keys", function(t) { + var cache = new LRU() + + cache.set("key", "value") + cache.set(123, 456) + + t.equal(cache.peek("key"), "value") + t.equal(cache.peek(123), 456) + + t.equal(cache.peek({ + toString: function() { return "key" } + }), undefined) + + t.end() +}) diff --git a/deps/npm/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/lru-cache/test/foreach.js index 4190417cbc61d8..d037d41c33af16 100644 --- a/deps/npm/node_modules/lru-cache/test/foreach.js +++ b/deps/npm/node_modules/lru-cache/test/foreach.js @@ -4,13 +4,13 @@ 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)) + l.set(i, i.toString(2)) } var i = 9 l.forEach(function (val, key, cache) { t.equal(cache, l) - t.equal(key, i.toString()) + t.equal(key, i) t.equal(val, i.toString(2)) i -= 1 }) @@ -25,10 +25,20 @@ test('forEach', function (t) { l.forEach(function (val, key, cache) { var j = order[i ++] t.equal(cache, l) - t.equal(key, j.toString()) + t.equal(key, j) t.equal(val, j.toString(2)) }) - t.equal(i, order.length); + t.equal(i, order.length) + + i = 0 + order.reverse() + l.rforEach(function (val, key, cache) { + var j = order[i ++] + t.equal(cache, l) + t.equal(key, j) + t.equal(val, j.toString(2)) + }) + t.equal(i, order.length) t.end() }) @@ -36,17 +46,17 @@ test('forEach', function (t) { 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)) + l.set(i, i.toString(2)) } - t.similar(l.keys(), ['9', '8', '7', '6', '5']) + 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.keys(), [8, 6, 9, 7, 5]) t.similar(l.values(), ['1000', '110', '1001', '111', '101']) t.end() diff --git a/deps/npm/node_modules/lru-cache/test/overflow.js b/deps/npm/node_modules/lru-cache/test/overflow.js new file mode 100644 index 00000000000000..238af699b0a0c0 --- /dev/null +++ b/deps/npm/node_modules/lru-cache/test/overflow.js @@ -0,0 +1,45 @@ +var LRU = require('../') +var t = require('tap') + +var c = new LRU(5) + +// now the hacksy bitses +c._mru = Number.MAX_SAFE_INTEGER - 10 + +function test (c) { + t.test('mru=' + c._mru + ', lru=' + c._lru, function (t) { + t.equal(c.length, 5) + t.equal(c._cache.get(0), undefined) + t.equal(c._cache.get(1).value, 1) + t.equal(c._cache.get(2).value, 2) + t.equal(c._cache.get(3).value, 3) + t.equal(c._cache.get(4).value, 4) + t.equal(c._cache.get(5).value, 5) + t.ok(c._mru < Number.MAX_SAFE_INTEGER, 'did not overflow') + t.end() + }) +} + +for (var i = 0; i < 6; i++) { + c.set(i, i) +} + +test(c) + +for (var i = 0; i < 6; i++) { + c.set(i, i) +} + +test(c) + +for (var i = 0; i < 6; i++) { + c.set(i, i) +} + +test(c) + +for (var i = 0; i < 6; i++) { + c.set(i, i) +} + +test(c) diff --git a/deps/npm/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/lru-cache/test/serialize.js new file mode 100644 index 00000000000000..b87eb5d0b0383d --- /dev/null +++ b/deps/npm/node_modules/lru-cache/test/serialize.js @@ -0,0 +1,224 @@ +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(123, 456) + t.deepEqual(cache.dump(), [ + { k: 123, v: 456, e: 0 }, + { k: "b", v: "B", e: 0 }, + { k: "a", v: "A", e: 0 }, + ]) + cache.del(123) + + 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") + cache.set(123, 456) + + 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/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 index 249bc20eb5573c..353546af2368e1 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ b/deps/npm/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/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md index 62bc7bae3fed28..179392978d30fe 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -4,6 +4,7 @@ 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/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml index cc4dba29d959a2..6e5919de39a312 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ b/deps/npm/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/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/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/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/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 index ede6efefa07883..898644e114cc6c 100644 --- 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 @@ -1,7 +1,7 @@ { "name": "balanced-match", "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.2.0", + "version": "0.2.1", "repository": { "type": "git", "url": "git://github.com/juliangruber/balanced-match.git" @@ -44,30 +44,29 @@ "android-browser/4.2..latest" ] }, - "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", + "gitHead": "d743dd31d7376e0fcf99392a4be7227f2e99bf5d", "bugs": { "url": "https://github.com/juliangruber/balanced-match/issues" }, - "_id": "balanced-match@0.2.0", - "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", + "_id": "balanced-match@0.2.1", + "_shasum": "7bc658b4bed61eee424ad74f75f5c3e2c4df3cc7", "_from": "balanced-match@>=0.2.0 <0.3.0", - "_npmVersion": "2.1.8", - "_nodeVersion": "0.10.32", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.1", "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" }, + "dist": { + "shasum": "7bc658b4bed61eee424ad74f75f5c3e2c4df3cc7", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz" + }, "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!" + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz" } 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 index 2f1bd3d5d241b8..b516138098fba9 100644 --- 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 @@ -63,7 +63,7 @@ "_id": "concat-map@0.0.1", "dist": { "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "https://registrytwo.npmjs.com/concat-map/-/concat-map-0.0.1.tgz" + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" }, "_from": "concat-map@0.0.1", "_npmVersion": "1.3.21", @@ -78,6 +78,6 @@ } ], "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_resolved": "https://registrytwo.npmjs.com/concat-map/-/concat-map-0.0.1.tgz", + "_resolved": "https://registry.npmjs.org/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 index 5f1866c8b5a29e..4cb3e05d7ceb6c 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,7 +1,7 @@ { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", - "version": "1.1.0", + "version": "1.1.1", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" @@ -42,15 +42,15 @@ "android-browser/4.2..latest" ] }, - "gitHead": "b5fa3b1c74e5e2dba2d0efa19b28335641bc1164", + "gitHead": "f50da498166d76ea570cf3b30179f01f0f119612", "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, - "_id": "brace-expansion@1.1.0", - "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", + "_id": "brace-expansion@1.1.1", + "_shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.10", - "_nodeVersion": "0.10.32", + "_npmVersion": "2.6.1", + "_nodeVersion": "0.10.36", "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" @@ -66,10 +66,10 @@ } ], "dist": { - "shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" + "shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.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 index c7c9a089ceb430..66755da6ef12b0 100644 --- a/deps/npm/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/minimatch/package.json @@ -6,7 +6,7 @@ }, "name": "minimatch", "description": "a glob matcher in javascript", - "version": "2.0.10", + "version": "3.0.0", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" @@ -14,8 +14,7 @@ "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" + "test": "tap test/*.js" }, "engines": { "node": "*" @@ -24,32 +23,30 @@ "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" + "minimatch.js" ], - "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", + "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", "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", + "_id": "minimatch@3.0.0", + "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "_from": "minimatch@>=3.0.0 <3.1.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", "_npmUser": { "name": "isaacs", "email": "isaacs@npmjs.com" }, "dist": { - "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" + "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" }, "maintainers": [ { @@ -58,5 +55,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/node-gyp/.npmignore b/deps/npm/node_modules/node-gyp/.npmignore index b0b49bd62b6405..6748492014230d 100644 --- a/deps/npm/node_modules/node-gyp/.npmignore +++ b/deps/npm/node_modules/node-gyp/.npmignore @@ -1 +1,3 @@ gyp/test +node_modules +test/.node-gyp diff --git a/deps/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch b/deps/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch index 3607789397f62a..694913f5954c25 100644 --- a/deps/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch +++ b/deps/npm/node_modules/node-gyp/0001-gyp-always-install-into-PRODUCT_DIR.patch @@ -28,7 +28,8 @@ index b88a433..9b3e4e3 100644 + # # convenient access with LD_LIBRARY_PATH. + # return '$(builddir)/lib.%s/%s' % (self.toolset, self.alias) return '$(builddir)/' + self.alias - - --- + + +-- 2.3.2 (Apple Git-55) + diff --git a/deps/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch b/deps/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch index cc0a5b87f85872..d1c5cac7177490 100644 --- a/deps/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch +++ b/deps/npm/node_modules/node-gyp/0002-gyp-apply-https-codereview.chromium.org-11361103.patch @@ -18,7 +18,7 @@ index d8e0872..c59aea1 100644 + if 'TargetExt' not in msbuild_attributes and 'product_extension' in spec: + ext = spec.get('product_extension') + msbuild_attributes['TargetExt'] = '.' + ext - + if spec.get('msvs_external_builder'): external_out_dir = spec.get('msvs_external_builder_out_dir', '.') @@ -2773,6 +2776,9 @@ def _GetMSBuildConfigurationGlobalProperties(spec, configurations, build_file): @@ -28,8 +28,9 @@ index d8e0872..c59aea1 100644 + if 'TargetExt' in attributes: + _AddConditionalProperty(properties, condition, 'TargetExt', + attributes['TargetExt']) - + if attributes.get('TargetPath'): _AddConditionalProperty(properties, condition, 'TargetPath', --- +-- 2.3.2 (Apple Git-55) + diff --git a/deps/npm/node_modules/node-gyp/0003-gyp-don-t-use-links-at-all-just-copy-the-files-inste.patch b/deps/npm/node_modules/node-gyp/0003-gyp-don-t-use-links-at-all-just-copy-the-files-inste.patch index 291e82dcad13d7..673a3ddd38516f 100644 --- a/deps/npm/node_modules/node-gyp/0003-gyp-don-t-use-links-at-all-just-copy-the-files-inste.patch +++ b/deps/npm/node_modules/node-gyp/0003-gyp-don-t-use-links-at-all-just-copy-the-files-inste.patch @@ -13,12 +13,12 @@ index 9b3e4e3..b3f8a2b 100644 --- a/gyp/pylib/gyp/generator/make.py +++ b/gyp/pylib/gyp/generator/make.py @@ -372,7 +372,7 @@ cmd_touch = touch $@ - + 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 = rm -rf "$@" && cp -af "$<" "$@" - + %(link_commands)s """ diff --git a/gyp/pylib/gyp/generator/ninja.py b/gyp/pylib/gyp/generator/ninja.py @@ -32,7 +32,8 @@ index 7461814..c2951a4 100644 - command='ln -f $in $out 2>/dev/null || (rm -rf $out && cp -af $in $out)') + command='rm -rf $out && cp -af $in $out') master_ninja.newline() - + all_targets = set() --- +-- 2.3.2 (Apple Git-55) + diff --git a/deps/npm/node_modules/node-gyp/CHANGELOG.md b/deps/npm/node_modules/node-gyp/CHANGELOG.md new file mode 100644 index 00000000000000..089ee84a4d7dbc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/CHANGELOG.md @@ -0,0 +1,57 @@ +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) + +v3.0.2 2015-09-12 + +* [[`6e8c3bf3c6`](https://github.com/nodejs/node-gyp/commit/6e8c3bf3c6)] - add back support for passing additional cmdline args (Rod Vagg) [#723](https://github.com/nodejs/node-gyp/pull/723) +* [[`ff82f2f3b9`](https://github.com/nodejs/node-gyp/commit/ff82f2f3b9)] - fixed broken link in docs to Visual Studio 2013 download (simon-p-r) [#722](https://github.com/nodejs/node-gyp/pull/722) + +v3.0.1 2015-09-08 + +* [[`846337e36b`](https://github.com/nodejs/node-gyp/commit/846337e36b)] - normalise versions for target == this comparison (Rod Vagg) [#716](https://github.com/nodejs/node-gyp/pull/716) + +v3.0.0 2015-09-08 + +* [[`9720d0373c`](https://github.com/nodejs/node-gyp/commit/9720d0373c)] - remove node_modules from tree (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`6dcf220db7`](https://github.com/nodejs/node-gyp/commit/6dcf220db7)] - test version major directly, don't use semver.satisfies() (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`938dd18d1c`](https://github.com/nodejs/node-gyp/commit/938dd18d1c)] - refactor for clarity, fix dist-url, add env var dist-url functionality (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`9e9df66a06`](https://github.com/nodejs/node-gyp/commit/9e9df66a06)] - use process.release, make aware of io.js & node v4 differences (Rod Vagg) [#711](https://github.com/nodejs/node-gyp/pull/711) +* [[`1ea7ed01f4`](https://github.com/nodejs/node-gyp/commit/1ea7ed01f4)] - **deps**: update graceful-fs dependency to the latest (Sakthipriyan Vairamani) [#714](https://github.com/nodejs/node-gyp/pull/714) +* [[`0fbc387b35`](https://github.com/nodejs/node-gyp/commit/0fbc387b35)] - Update repository URLs. (Ben Noordhuis) [#715](https://github.com/nodejs/node-gyp/pull/715) +* [[`bbedb8868b`](https://github.com/nodejs/node-gyp/commit/bbedb8868b)] - **(SEMVER-MAJOR)** **win**: enable delay-load hook by default (Jeremiah Senkpiel) [#708](https://github.com/nodejs/node-gyp/pull/708) +* [[`85ed107565`](https://github.com/nodejs/node-gyp/commit/85ed107565)] - Merge pull request #664 from othiym23/othiym23/allow-semver-5 (Nathan Rajlich) +* [[`0c720d234c`](https://github.com/nodejs/node-gyp/commit/0c720d234c)] - allow semver@5 (Forrest L Norvell) diff --git a/deps/npm/node_modules/node-gyp/README.md b/deps/npm/node_modules/node-gyp/README.md index edde1f6c39ab87..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,10 +144,10 @@ 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) - * [*"binding.gyp" files out in the wild* wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild) + * ["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) Commands @@ -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.visualstudio.com/en-us/downloads/download-visual-studio-vs -[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 93f84892434256..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', @@ -79,7 +84,7 @@ '-luuid.lib', '-lodbc32.lib', '-lDelayImp.lib', - '-l"<(node_root_dir)/$(ConfigurationName)/iojs.lib"' + '-l"<(node_root_dir)/$(ConfigurationName)/<(node_lib_file)"' ], 'msvs_disabled_warnings': [ # warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent' @@ -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/bin/node-gyp.js b/deps/npm/node_modules/node-gyp/bin/node-gyp.js index 4678260fd5b050..e44e73877c73b9 100755 --- a/deps/npm/node_modules/node-gyp/bin/node-gyp.js +++ b/deps/npm/node_modules/node-gyp/bin/node-gyp.js @@ -125,7 +125,7 @@ function issueMessage () { errorMessage() log.error('', [ 'This is a bug in `node-gyp`.' , 'Try to update node-gyp and file an Issue if it does not help:' - , ' ' + , ' ' ].join('\n')) } 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/easy_xml.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py index b71e9d4e8a5168..2b0bb60cb4296b 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py @@ -115,7 +115,7 @@ def WriteXmlIfChanged(content, path, encoding='utf-8', pretty=False, xml_string = XmlToString(content, encoding, pretty) if win32 and os.linesep != '\r\n': xml_string = xml_string.replace('\n', '\r\n') - + try: xml_string = xml_string.encode(encoding) except Exception: 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/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 b35ca01624b979..3a3edccf872b92 100644 --- a/deps/npm/node_modules/node-gyp/lib/build.js +++ b/deps/npm/node_modules/node-gyp/lib/build.js @@ -13,14 +13,21 @@ var fs = require('graceful-fs') , which = require('which') , mkdirp = require('mkdirp') , exec = require('child_process').exec + , processRelease = require('./process-release') , win = process.platform == 'win32' 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 makeCommand = gyp.opts.make || process.env.MAKE - || (process.platform.indexOf('bsd') != -1 && process.platform.indexOf('kfreebsd') == -1 ? 'gmake' : 'make') + var release = processRelease(argv, gyp, process.version, process.release) + , makeCommand = gyp.opts.make || process.env.MAKE || platformMake , command = win ? 'msbuild' : makeCommand , buildDir = path.resolve('build') , configPath = path.resolve(buildDir, 'config.gypi') @@ -173,7 +180,7 @@ function build (gyp, argv, callback) { } /** - * Copies the iojs.lib file for the current target architecture into the + * Copies the node.lib file for the current target architecture into the * current proper dev dir location. */ @@ -181,15 +188,15 @@ function build (gyp, argv, callback) { if (!win || !copyDevLib) return doBuild() var buildDir = path.resolve(nodeDir, buildType) - , archNodeLibPath = path.resolve(nodeDir, arch, 'iojs.lib') - , buildNodeLibPath = path.resolve(buildDir, 'iojs.lib') + , archNodeLibPath = path.resolve(nodeDir, arch, release.name + '.lib') + , buildNodeLibPath = path.resolve(buildDir, release.name + '.lib') mkdirp(buildDir, function (err, isNew) { if (err) return callback(err) log.verbose('"' + buildType + '" dir needed to be created?', isNew) var rs = fs.createReadStream(archNodeLibPath) , ws = fs.createWriteStream(buildNodeLibPath) - log.verbose('copying "iojs.lib" for ' + arch, buildNodeLibPath) + log.verbose('copying "' + release.name + '.lib" for ' + arch, buildNodeLibPath) rs.pipe(ws) rs.on('error', callback) ws.on('error', callback) diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 291fbd0d34dbe9..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. @@ -15,9 +16,11 @@ var fs = require('graceful-fs') , cp = require('child_process') , PathArray = require('path-array') , extend = require('util')._extend + , processRelease = require('./process-release') , 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' @@ -28,98 +31,16 @@ function configure (gyp, argv, callback) { , configNames = [ 'config.gypi', 'common.gypi' ] , configs = [] , 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 () { @@ -135,35 +56,25 @@ function configure (gyp, argv, callback) { } else { // if no --nodedir specified, ensure node dependencies are installed - var version - var versionStr - - if (gyp.opts.target) { + if ('v' + release.version !== process.version) { // if --target was given, then determine a target version to compile for - versionStr = gyp.opts.target - log.verbose('get node dir', 'compiling against --target node version: %s', versionStr) + log.verbose('get node dir', 'compiling against --target node version: %s', release.version) } else { // if no --target was specified then use the current host node version - versionStr = process.version - log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', versionStr) + log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version) } - // make sure we have a valid version - try { - version = semver.parse(versionStr) - } catch (e) { - return callback(e) - } - if (!version) { - return callback(new Error('Invalid version number: ' + versionStr)) + if (!release.semver) { + // could not parse the version string with semver + return callback(new Error('Invalid version number: ' + release.version)) } // ensure that the target node version's dev files are installed gyp.opts.ensure = true - gyp.commands.install([ versionStr ], function (err, version) { + gyp.commands.install([ release.version ], function (err, version) { if (err) return callback(err) - log.verbose('get node dir', 'target node version installed:', version) - nodeDir = path.resolve(gyp.devDir, version) + log.verbose('get node dir', 'target node version installed:', release.versionDir) + nodeDir = path.resolve(gyp.devDir, release.versionDir) createBuildDir() }) } @@ -307,49 +218,82 @@ 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') var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi') - //TODO: ideally async - if (!fs.existsSync(common_gypi)) - common_gypi = path.resolve(nodeDir, 'common.gypi') - - var output_dir = 'build' - if (win) { - // Windows expects an absolute path - output_dir = buildDir - } - var nodeGypDir = path.resolve(__dirname, '..') + fs.stat(common_gypi, function (err, stat) { + if (err) + common_gypi = path.resolve(nodeDir, 'common.gypi') - argv.push('-I', addon_gypi) - argv.push('-I', common_gypi) - argv.push('-Dlibrary=shared_library') - argv.push('-Dvisibility=default') - argv.push('-Dnode_root_dir=' + nodeDir) - argv.push('-Dnode_gyp_dir=' + nodeGypDir) - argv.push('-Dmodule_root_dir=' + process.cwd()) - argv.push('--depth=.') - argv.push('--no-parallel') + var output_dir = 'build' + if (win) { + // Windows expects an absolute path + output_dir = buildDir + } + var nodeGypDir = path.resolve(__dirname, '..') + + argv.push('-I', addon_gypi) + argv.push('-I', common_gypi) + 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()) + argv.push('--depth=.') + argv.push('--no-parallel') - // tell gyp to write the Makefile/Solution files into output_dir - argv.push('--generator-output', output_dir) + // tell gyp to write the Makefile/Solution files into output_dir + argv.push('--generator-output', output_dir) - // tell make to write its output into the same dir - argv.push('-Goutput_dir=.') + // tell make to write its output into the same dir + argv.push('-Goutput_dir=.') - // enforce use of the "binding.gyp" file - argv.unshift('binding.gyp') + // enforce use of the "binding.gyp" file + argv.unshift('binding.gyp') - // execute `gyp` from the current target nodedir - argv.unshift(gyp_script) + // execute `gyp` from the current target nodedir + argv.unshift(gyp_script) - // make sure python uses files that came with this particular node package - var pypath = new PathArray(process.env, 'PYTHONPATH') - pypath.unshift(path.join(__dirname, '..', 'gyp', 'pylib')) + // make sure python uses files that came with this particular node package + var pypath = new PathArray(process.env, 'PYTHONPATH') + pypath.unshift(path.join(__dirname, '..', 'gyp', 'pylib')) - var cp = gyp.spawn(python, argv) - cp.on('exit', onCpExit) + var cp = gyp.spawn(python, argv) + cp.on('exit', onCpExit) + }) } /** @@ -366,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 79b6cd38266f7d..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.' /** @@ -20,10 +22,13 @@ var fs = require('graceful-fs') , request = require('request') , minimatch = require('minimatch') , mkdir = require('mkdirp') + , processRelease = require('./process-release') , win = process.platform == 'win32' function install (gyp, argv, callback) { + var release = processRelease(argv, gyp, process.version, process.release) + // ensure no double-callbacks happen function cb (err) { if (cb.done) return @@ -31,34 +36,29 @@ function install (gyp, argv, callback) { if (err) { log.warn('install', 'got an error, rolling back install') // roll-back the install if anything went wrong - gyp.commands.remove([ version ], function (err2) { + gyp.commands.remove([ release.versionDir ], function (err2) { callback(err) }) } else { - callback(null, version) + callback(null, release.version) } } - var defaultUrl = getDefaultIojsUrl(process.version) - var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || defaultUrl - // Determine which node dev files version we are installing - var versionStr = argv[0] || gyp.opts.target || process.version - log.verbose('install', 'input version string %j', versionStr) + log.verbose('install', 'input version string %j', release.version) - // parse the version to normalize and ensure it's valid - var version = semver.parse(versionStr) - if (!version) { - return callback(new Error('Invalid version number: ' + versionStr)) + if (!release.semver) { + // could not parse the version string with semver + return callback(new Error('Invalid version number: ' + release.version)) } - if (semver.lt(versionStr, '0.8.0')) { - return callback(new Error('Minimum target version is `0.8.0` or greater. Got: ' + versionStr)) + if (semver.lt(release.version, '0.8.0')) { + return callback(new Error('Minimum target version is `0.8.0` or greater. Got: ' + release.version)) } // 0.x.y-pre versions are not published yet and cannot be installed. Bail. - if (version.prerelease[0] === 'pre') { - log.verbose('detected "pre" node version', versionStr) + if (release.semver.prerelease[0] === 'pre') { + log.verbose('detected "pre" node version', release.version) if (gyp.opts.nodedir) { log.verbose('--nodedir flag was passed; skipping install', gyp.opts.nodedir) callback() @@ -69,14 +69,10 @@ function install (gyp, argv, callback) { } // flatten version into String - version = version.version - log.verbose('install', 'installing version: %s', version) - - // distributions starting with 0.10.0 contain sha256 checksums - var checksumAlgo = semver.gte(version, '0.10.0') ? 'sha256' : 'sha1' + log.verbose('install', 'installing version: %s', release.versionDir) // the directory where the dev files will be installed - var devDir = path.resolve(gyp.devDir, version) + var devDir = path.resolve(gyp.devDir, release.versionDir) // If '--ensure' was passed, then don't *always* install the version; // check if it is already installed, and only install when needed @@ -85,7 +81,7 @@ function install (gyp, argv, callback) { fs.stat(devDir, function (err, stat) { if (err) { if (err.code == 'ENOENT') { - log.verbose('install', 'version not already installed, continuing with install', version) + log.verbose('install', 'version not already installed, continuing with install', release.version) go() } else if (err.code == 'EACCES') { eaccesFallback() @@ -116,47 +112,8 @@ 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/TooTallNate/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(checksumAlgo) + var shasum = crypto.createHash('sha256') res.on('data', function (chunk) { shasum.update(chunk) }).on('end', function () { @@ -184,9 +141,8 @@ function install (gyp, argv, callback) { } // now download the node tarball - var tarPath = gyp.opts['tarball'] - var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/iojs-v' + version + '-headers.tar.gz' - , badDownload = false + var tarPath = gyp.opts.tarball + var badDownload = false , extractCount = 0 , gunzip = zlib.createGunzip() , extracter = tar.Extract({ path: devDir, strip: 1, filter: isValid }) @@ -220,13 +176,16 @@ function install (gyp, argv, callback) { // download the tarball, gunzip and extract! if (tarPath) { - var input = fs.createReadStream(tarballUrl) + var input = fs.createReadStream(tarPath) input.pipe(gunzip).pipe(extracter) return } - var req = download(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) { @@ -248,12 +207,12 @@ function install (gyp, argv, callback) { req.on('response', function (res) { if (res.statusCode !== 200) { badDownload = true - cb(new Error(res.statusCode + ' response downloading ' + tarballUrl)) + cb(new Error(res.statusCode + ' response downloading ' + release.tarballUrl)) return } // content checksum getContentSha(res, function (_, checksum) { - var filename = path.basename(tarballUrl).trim() + var filename = path.basename(release.tarballUrl).trim() contentShasums[filename] = checksum log.verbose('content checksum', filename, checksum) }) @@ -272,7 +231,7 @@ function install (gyp, argv, callback) { var async = 0 if (win) { - // need to download iojs.lib + // need to download node.lib async++ downloadNodeLib(deref) } @@ -314,14 +273,16 @@ function install (gyp, argv, callback) { } function downloadShasums(done) { - var shasumsFile = (checksumAlgo === 'sha256') ? 'SHASUMS256.txt' : 'SHASUMS.txt' - log.verbose('check download content checksum, need to download `' + shasumsFile + '`...') - var shasumsPath = path.resolve(devDir, shasumsFile) - , shasumsUrl = distUrl + '/v' + version + '/' + shasumsFile - - log.verbose('checksum url', shasumsUrl) - var req = download(shasumsUrl) - if (!req) return + log.verbose('check download content checksum, need to download `SHASUMS256.txt`...') + var shasumsPath = path.resolve(devDir, 'SHASUMS256.txt') + + log.verbose('checksum url', release.shasumsUrl) + 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) { @@ -351,39 +312,41 @@ function install (gyp, argv, callback) { } function downloadNodeLib (done) { - log.verbose('on Windows; need to download `iojs.lib`...') + log.verbose('on Windows; need to download `' + release.name + '.lib`...') var dir32 = path.resolve(devDir, 'ia32') , dir64 = path.resolve(devDir, 'x64') - , nodeLibPath32 = path.resolve(dir32, 'iojs.lib') - , nodeLibPath64 = path.resolve(dir64, 'iojs.lib') - , nodeLibUrl32 = distUrl + '/v' + version + '/win-x86/iojs.lib' - , nodeLibUrl64 = distUrl + '/v' + version + '/win-x64/iojs.lib' + , libPath32 = path.resolve(dir32, release.name + '.lib') + , libPath64 = path.resolve(dir64, release.name + '.lib') - log.verbose('32-bit iojs.lib dir', dir32) - log.verbose('64-bit iojs.lib dir', dir64) - log.verbose('`iojs.lib` 32-bit url', nodeLibUrl32) - log.verbose('`iojs.lib` 64-bit url', nodeLibUrl64) + log.verbose('32-bit ' + release.name + '.lib dir', dir32) + log.verbose('64-bit ' + release.name + '.lib dir', dir64) + log.verbose('`' + release.name + '.lib` 32-bit url', release.libUrl32) + log.verbose('`' + release.name + '.lib` 64-bit url', release.libUrl64) var async = 2 mkdir(dir32, function (err) { if (err) return done(err) - log.verbose('streaming 32-bit iojs.lib to:', nodeLibPath32) + log.verbose('streaming 32-bit ' + release.name + '.lib to:', libPath32) + + try { + var req = download(gyp, process.env, release.libUrl32, cb) + } catch (e) { + return cb(e) + } - var req = download(nodeLibUrl32) - if (!req) return req.on('error', done) req.on('response', function (res) { if (res.statusCode !== 200) { - done(new Error(res.statusCode + ' status code downloading 32-bit iojs.lib')) + done(new Error(res.statusCode + ' status code downloading 32-bit ' + release.name + '.lib')) return } getContentSha(res, function (_, checksum) { - contentShasums['win-x86/iojs.lib'] = checksum - log.verbose('content checksum', 'win-x86/iojs.lib', checksum) + contentShasums[release.libPath32] = checksum + log.verbose('content checksum', release.libPath32, checksum) }) - var ws = fs.createWriteStream(nodeLibPath32) + var ws = fs.createWriteStream(libPath32) ws.on('error', cb) req.pipe(ws) }) @@ -393,23 +356,27 @@ function install (gyp, argv, callback) { }) mkdir(dir64, function (err) { if (err) return done(err) - log.verbose('streaming 64-bit iojs.lib to:', nodeLibPath64) + log.verbose('streaming 64-bit ' + release.name + '.lib to:', libPath64) + + try { + var req = download(gyp, process.env, release.libUrl64, cb) + } catch (e) { + return cb(e) + } - var req = download(nodeLibUrl64) - if (!req) return req.on('error', done) req.on('response', function (res) { if (res.statusCode !== 200) { - done(new Error(res.statusCode + ' status code downloading 64-bit iojs.lib')) + done(new Error(res.statusCode + ' status code downloading 64-bit ' + release.name + '.lib')) return } getContentSha(res, function (_, checksum) { - contentShasums['win-x64/iojs.lib'] = checksum - log.verbose('content checksum', 'win-x64/iojs.lib', checksum) + contentShasums[release.libPath64] = checksum + log.verbose('content checksum', release.libPath64, checksum) }) - var ws = fs.createWriteStream(nodeLibPath64) + var ws = fs.createWriteStream(libPath64) ws.on('error', cb) req.pipe(ws) }) @@ -456,29 +423,47 @@ function install (gyp, argv, callback) { } +function download (gyp, env, url) { + log.http('GET', url) -// pick out 'nightly', 'next-nightly' or 'rc' from the version string if it's there -// adjust URL accordingly -function getDefaultIojsUrl(version) { - var versionMatch = version.match(/^v\d+\.\d+\.\d+-(?:(?:(nightly|next-nightly)\.?\d{8}[0-9a-f]{10})|(?:(rc)\.\d+))$/) - var distType = versionMatch ? versionMatch[1] || versionMatch[2] : 'release' - var defaultUrl = `https://iojs.org/download/${distType}` - return defaultUrl -} + 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 +} -if (require.main === module) { - var assert = require('assert') - console.log('test v2.3.4 -> https://iojs.org/download/release') - assert.equal(getDefaultIojsUrl('v2.3.4'), 'https://iojs.org/download/release') - console.log('test v2.3.4-nightly12345678aaaaaaaaaa -> https://iojs.org/download/nightly') - assert.equal(getDefaultIojsUrl('v2.3.4-nightly12345678aaaaaaaaaa'), 'https://iojs.org/download/nightly') - console.log('test v2.3.4-nightly.12345678aaaaaaaaaa -> https://iojs.org/download/nightly') - assert.equal(getDefaultIojsUrl('v2.3.4-nightly.12345678aaaaaaaaaa'), 'https://iojs.org/download/nightly') - console.log('test v2.3.4-next-nightly12345678aaaaaaaaaa -> https://iojs.org/download/release/next-nightly') - assert.equal(getDefaultIojsUrl('v2.3.4-next-nightly12345678aaaaaaaaaa'), 'https://iojs.org/download/next-nightly') - console.log('test v2.3.4-next-nightly.12345678aaaaaaaaaa -> https://iojs.org/download/release/next-nightly') - assert.equal(getDefaultIojsUrl('v2.3.4-next-nightly.12345678aaaaaaaaaa'), 'https://iojs.org/download/next-nightly') - console.log('test v2.3.4-rc.100 -> https://iojs.org/download/rc') - assert.equal(getDefaultIojsUrl('v2.3.4-rc.100'), 'https://iojs.org/download/rc') +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 6223d4b1943ad9..a5a332885597bf 100644 --- a/deps/npm/node_modules/node-gyp/lib/node-gyp.js +++ b/deps/npm/node_modules/node-gyp/lib/node-gyp.js @@ -48,7 +48,7 @@ function Gyp () { // set the dir where node-gyp dev files get installed // TODO: make this *more* configurable? - // see: https://github.com/TooTallNate/node-gyp/issues/21 + // see: https://github.com/nodejs/node-gyp/issues/21 var homeDir = process.env.HOME || process.env.USERPROFILE if (!homeDir) { throw new Error( @@ -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 new file mode 100644 index 00000000000000..f5a3cca6357b6d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/lib/process-release.js @@ -0,0 +1,153 @@ +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" + +// Captures all the logic required to determine download URLs, local directory and +// file names. Inputs come from command-line switches (--target, --dist-url), +// `process.version` and `process.release` where it exists. +function processRelease (argv, gyp, defaultVersion, defaultRelease) { + var version = (semver.valid(argv[0]) && argv[0]) || gyp.opts.target || defaultVersion + , versionSemver = semver.parse(version) + , overrideDistUrl = gyp.opts['dist-url'] || gyp.opts.disturl + , isDefaultVersion + , isIojs + , name + , distBaseUrl + , baseUrl + , libUrl32 + , libUrl64 + , tarballUrl + , canGetHeaders + + if (!versionSemver) { + // not a valid semver string, nothing we can do + return { version: version } + } + // flatten version into String + version = versionSemver.version + + // defaultVersion should come from process.version so ought to be valid semver + isDefaultVersion = version === semver.parse(defaultVersion).version + + // can't use process.release if we're using --target=x.y.z + if (!isDefaultVersion) + defaultRelease = null + + if (defaultRelease) { + // v3 onward, has process.release + name = defaultRelease.name.replace(/io\.js/, 'iojs') // remove the '.' for directory naming purposes + isIojs = name === 'iojs' + } else { + // old node or alternative --target= + // semver.satisfies() doesn't like prerelease tags so test major directly + isIojs = versionSemver.major >= 1 && versionSemver.major < 4 + name = isIojs ? 'iojs' : 'node' + } + + // check for the nvm.sh standard mirror env variables + if (!overrideDistUrl) { + 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') + } + } + } + + + if (overrideDistUrl) + distBaseUrl = overrideDistUrl.replace(/\/+$/, '') + else + distBaseUrl = isIojs ? 'https://iojs.org/download/release' : 'https://nodejs.org/dist' + distBaseUrl += '/v' + version + '/' + + // new style, based on process.release so we have a lot of the data we need + if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) { + baseUrl = url.resolve(defaultRelease.headersUrl, './') + libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major) + libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major) + + return { + version: version, + semver: versionSemver, + name: name, + baseUrl: baseUrl, + tarballUrl: defaultRelease.headersUrl, + shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'), + versionDir: (name !== 'node' ? name + '-' : '') + version, + libUrl32: libUrl32, + libUrl64: libUrl64, + libPath32: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)), + libPath64: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path)) + } + } + + // older versions without process.release are captured here and we have to make + // a lot of assumptions, additionally if you --target=x.y.z then we can't use the + // current process.release + + baseUrl = distBaseUrl + libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major) + libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major) + // 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 + canGetHeaders = semver.satisfies(versionSemver, headersTarballRange) + tarballUrl = url.resolve(baseUrl, name + '-v' + version + (canGetHeaders ? '-headers' : '') + '.tar.gz') + + return { + version: version, + semver: versionSemver, + name: name, + baseUrl: baseUrl, + tarballUrl: tarballUrl, + shasumsUrl: url.resolve(baseUrl, 'SHASUMS256.txt'), + versionDir: (name !== 'node' ? name + '-' : '') + version, + libUrl32: libUrl32, + libUrl64: libUrl64, + libPath32: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl32).path)), + libPath64: normalizePath(path.relative(url.parse(baseUrl).path, url.parse(libUrl64).path)) + } +} + +function normalizePath (p) { + return path.normalize(p).replace(/\\/g, '/') +} + +function resolveLibUrl (name, defaultUrl, arch, versionMajor) { + var base = url.resolve(defaultUrl, './') + , hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl)) + + if (!hasLibUrl) { + // let's assume it's a baseUrl then + if (versionMajor >= 1) + return url.resolve(base, 'win-' + arch +'/' + name + '.lib') + // prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/ + return url.resolve(base, (arch === 'x64' ? 'x64/' : '') + name + '.lib') + } + + // else we have a proper url to a .lib, just make sure it's the right arch + return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/') +} + +module.exports = processRelease diff --git a/deps/npm/node_modules/node-gyp/lib/remove.js b/deps/npm/node_modules/node-gyp/lib/remove.js index 068d1e3892d0b3..eb80981b88febf 100644 --- a/deps/npm/node_modules/node-gyp/lib/remove.js +++ b/deps/npm/node_modules/node-gyp/lib/remove.js @@ -19,23 +19,19 @@ function remove (gyp, argv, callback) { log.verbose('remove', 'using node-gyp dir:', devDir) // get the user-specified version to remove - var v = argv[0] || gyp.opts.target - log.verbose('remove', 'removing target version:', v) + var version = argv[0] || gyp.opts.target + log.verbose('remove', 'removing target version:', version) - if (!v) { + if (!version) { return callback(new Error('You must specify a version number to remove. Ex: "' + process.version + '"')) } - // parse the version to normalize and make sure it's valid - var version = semver.parse(v) - - if (!version) { - return callback(new Error('Invalid version number: ' + v)) + var versionSemver = semver.parse(version) + if (versionSemver) { + // flatten the version Array into a String + version = versionSemver.version } - // flatten the version Array into a String - version = version.version - var versionPath = path.resolve(gyp.devDir, version) log.verbose('remove', 'removing development files for version:', version) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js index 967b45c0d67eba..7d0515920e5cb3 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js @@ -1,4 +1,4 @@ -(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 one single character var patternListStack = [] + var negativeLists = [] var plType var stateChar var inClass = false @@ -373,9 +374,13 @@ function parse (pattern, isSub) { } plType = stateChar - patternListStack.push({ type: plType, start: i - 1, reStart: re.length }) + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!' : '(?:' + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue @@ -389,12 +394,15 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true re += ')' - plType = patternListStack.pop().type + var pl = patternListStack.pop() + plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) switch (plType) { case '!': - re += '[^/]*?)' + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length break case '?': case '+': @@ -508,7 +516,7 @@ function parse (pattern, isSub) { // 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 (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + 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) { @@ -551,12 +559,49 @@ function parse (pattern, isSub) { 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 (re !== '' && hasMagic) { + re = '(?=.)' + re + } - if (addPatternStart) re = patternStart + re + if (addPatternStart) { + re = patternStart + re + } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { @@ -1110,4 +1155,5 @@ module.exports = function (xs, fn) { return res; }; -},{}]},{},[1]); +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js index 5e13d6d5b2e62b..ec4c05c570c52e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js @@ -272,6 +272,7 @@ function parse (pattern, isSub) { var escaping = false // ? => one single character var patternListStack = [] + var negativeLists = [] var plType var stateChar var inClass = false @@ -372,9 +373,13 @@ function parse (pattern, isSub) { } plType = stateChar - patternListStack.push({ type: plType, start: i - 1, reStart: re.length }) + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!' : '(?:' + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false continue @@ -388,12 +393,15 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true re += ')' - plType = patternListStack.pop().type + var pl = patternListStack.pop() + plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) switch (plType) { case '!': - re += '[^/]*?)' + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length break case '?': case '+': @@ -507,7 +515,7 @@ function parse (pattern, isSub) { // 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 (var pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + 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) { @@ -550,12 +558,49 @@ function parse (pattern, isSub) { 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 (re !== '' && hasMagic) { + re = '(?=.)' + re + } - if (addPatternStart) re = patternStart + re + if (addPatternStart) { + re = patternStart + re + } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { 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..179392978d30fe 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 @@ -4,6 +4,7 @@ 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/index.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index a23104e9550173..932718f9287173 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); } 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/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/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..7eb345779f877e 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,7 +1,7 @@ { "name": "balanced-match", "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.2.0", + "version": "0.3.0", "repository": { "type": "git", "url": "git://github.com/juliangruber/balanced-match.git" @@ -13,7 +13,7 @@ }, "dependencies": {}, "devDependencies": { - "tape": "~1.1.1" + "tape": "~4.2.2" }, "keywords": [ "match", @@ -44,30 +44,30 @@ "android-browser/4.2..latest" ] }, - "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", + "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", "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", + "_id": "balanced-match@0.3.0", + "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "_from": "balanced-match@>=0.3.0 <0.4.0", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.1", "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" }, + "dist": { + "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", + "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + }, "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", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", "readme": "ERROR: No README data found!" } 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/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 5f1866c8b5a29e..b471be30b4e331 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,7 +1,7 @@ { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", - "version": "1.1.0", + "version": "1.1.3", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" @@ -13,11 +13,11 @@ "gentest": "bash test/generate.sh" }, "dependencies": { - "balanced-match": "^0.2.0", + "balanced-match": "^0.3.0", "concat-map": "0.0.1" }, "devDependencies": { - "tape": "^3.0.3" + "tape": "4.4.0" }, "keywords": [], "author": { @@ -42,19 +42,23 @@ "android-browser/4.2..latest" ] }, - "gitHead": "b5fa3b1c74e5e2dba2d0efa19b28335641bc1164", + "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, - "_id": "brace-expansion@1.1.0", - "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", + "_id": "brace-expansion@1.1.3", + "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.10", - "_nodeVersion": "0.10.32", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.5.0", "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" }, + "dist": { + "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + }, "maintainers": [ { "name": "juliangruber", @@ -65,11 +69,11 @@ "email": "isaacs@npmjs.com" } ], - "dist": { - "shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", "readme": "ERROR: No README data found!" } 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/node-gyp/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json index 986de93892aca6..3dc6beb49f684a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json @@ -6,16 +6,16 @@ }, "name": "minimatch", "description": "a glob matcher in javascript", - "version": "2.0.8", + "version": "2.0.10", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" }, "main": "minimatch.js", "scripts": { - "pretest": "standard minimatch.js test/*.js", + "posttest": "standard minimatch.js test/*.js", "test": "tap test/*.js", - "prepublish": "browserify -o browser.js -e minimatch.js --bare" + "prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare" }, "engines": { "node": "*" @@ -26,30 +26,30 @@ "devDependencies": { "browserify": "^9.0.3", "standard": "^3.7.2", - "tap": "" + "tap": "^1.2.0" }, "license": "ISC", "files": [ "minimatch.js", "browser.js" ], - "gitHead": "0bc7d9c4b2bc816502184862b45bd090de3406a3", + "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", "bugs": { "url": "https://github.com/isaacs/minimatch/issues" }, "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@2.0.8", - "_shasum": "0bc20f6bf3570a698ef0ddff902063c6cabda6bf", + "_id": "minimatch@2.0.10", + "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", "_from": "minimatch@>=2.0.1 <3.0.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", + "_npmVersion": "3.1.0", + "_nodeVersion": "2.2.1", "_npmUser": { "name": "isaacs", "email": "isaacs@npmjs.com" }, "dist": { - "shasum": "0bc20f6bf3570a698ef0ddff902063c6cabda6bf", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz" + "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" }, "maintainers": [ { @@ -58,6 +58,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.8.tgz", + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json index 434e4696f8fb15..ad70fb110ce271 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json @@ -67,6 +67,5 @@ "tarball": "http://registry.npmjs.org/glob/-/glob-4.5.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/README.md b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/graceful-fs/package.json b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/package.json deleted file mode 100644 index 9add3d355157f7..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "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" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "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.0 <4.0.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" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/node-gyp/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/node-gyp/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/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore new file mode 100644 index 00000000000000..07e6e472cc75fa --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml new file mode 100644 index 00000000000000..4af02b3d17e64c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/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/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS new file mode 100644 index 00000000000000..4a0bc5033a06e7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/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/fs-write-stream-atomic/node_modules/graceful-fs/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/fs-write-stream-atomic/node_modules/graceful-fs/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..b6ef0521242474 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json @@ -0,0 +1,58 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "2.7.3", + "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": "292048199f6d28b77fbe584279a1898e25e4c714", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "_id": "lru-cache@2.7.3", + "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", + "_from": "lru-cache@>=2.0.0 <3.0.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", + "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.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.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js new file mode 100644 index 00000000000000..b47225f109891f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/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/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js new file mode 100644 index 00000000000000..4190417cbc61d8 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/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/node-gyp/node_modules/minimatch/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 new file mode 100644 index 00000000000000..b5912f6f168e5e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/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/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js new file mode 100644 index 00000000000000..5fe5dc3d371f1e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/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/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/.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..b12c4a074f739b 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 @@ -43,6 +43,5 @@ "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!" + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" } 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..687bfd6a946c67 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 @@ -46,7 +46,7 @@ "_id": "debug@2.2.0", "scripts": {}, "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "_from": "debug@*", + "_from": "debug@>=2.2.0 <3.0.0", "_npmVersion": "2.7.4", "_nodeVersion": "0.12.2", "_npmUser": { 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/tools/eslint/node_modules/escope/node_modules/es6-map/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 similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/d/package.json rename to deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json 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..53ae9c78d55c19 --- /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,66 @@ +{ + "name": "es6-iterator", + "version": "2.0.0", + "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.7", + "es6-symbol": "3" + }, + "devDependencies": { + "event-emitter": "^0.3.4", + "tad": "^0.2.3", + "xlint": "^0.2.2", + "xlint-jslint-medikoo": "^0.1.3" + }, + "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": "4d9445834e87780ab373b14d6791e860899e2d31", + "bugs": { + "url": "https://github.com/medikoo/es6-iterator/issues" + }, + "homepage": "https://github.com/medikoo/es6-iterator#readme", + "_id": "es6-iterator@2.0.0", + "_shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", + "_from": "es6-iterator@>=2.0.0 <3.0.0", + "_npmVersion": "2.11.3", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "dist": { + "shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", + "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz", + "readme": "ERROR: No README data found!" +} 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..bb756e709bda71 --- /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,74 @@ +{ + "name": "es5-ext", + "version": "0.10.11", + "description": "ECMAScript extensions and 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": "2", + "es6-symbol": "~3.0.2" + }, + "devDependencies": { + "tad": "~0.2.4", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "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": "aba94140a6bf79ce1a448a2db8834e8c1842b527", + "bugs": { + "url": "https://github.com/medikoo/es5-ext/issues" + }, + "homepage": "https://github.com/medikoo/es5-ext#readme", + "_id": "es5-ext@0.10.11", + "_shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", + "_from": "es5-ext@>=0.10.10 <0.11.0", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.3", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "dist": { + "shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", + "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.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/#/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..6c17838e0ffe1c --- /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,66 @@ +{ + "name": "es6-symbol", + "version": "3.0.2", + "description": "ECMAScript 6 Symbol polyfill", + "author": { + "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", + "url": "http://www.medikoo.com/" + }, + "keywords": [ + "symbol", + "private", + "property", + "es6", + "ecmascript", + "harmony", + "ponyfill", + "polyfill" + ], + "repository": { + "type": "git", + "url": "git://github.com/medikoo/es6-symbol.git" + }, + "dependencies": { + "d": "~0.1.1", + "es5-ext": "~0.10.10" + }, + "devDependencies": { + "tad": "~0.2.4", + "xlint": "~0.2.2", + "xlint-jslint-medikoo": "~0.1.4" + }, + "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": "b7da6b926c44e3745de69b17c98c00a5c84b4ebe", + "bugs": { + "url": "https://github.com/medikoo/es6-symbol/issues" + }, + "homepage": "https://github.com/medikoo/es6-symbol#readme", + "_id": "es6-symbol@3.0.2", + "_shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", + "_from": "es6-symbol@>=3.0.2 <4.0.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.2.0", + "_npmUser": { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + }, + "dist": { + "shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", + "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz" + }, + "maintainers": [ + { + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz", + "readme": "ERROR: No README data found!" +} 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 8ed83ab2436443..6d7c5e1048be04 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 @@ -8,7 +8,8 @@ "setter", "proxy" ], - "version": "0.1.1", + "version": "1.0.0", + "license": "MIT", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", @@ -23,21 +24,22 @@ "test": "node test" }, "dependencies": { - "debug": "*" + "debug": "^2.2.0", + "es6-symbol": "^3.0.2" }, "engines": { "node": "*" }, - "gitHead": "65a5d884f25b4b7a1608e367d715d713dbd3b3d6", + "gitHead": "4b3cc059c70eefd8ef2a0d4213d681b671eb3d11", "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", + "homepage": "https://github.com/TooTallNate/array-index#readme", + "_id": "array-index@1.0.0", + "_shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", + "_from": "array-index@>=1.0.0 <2.0.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", "_npmUser": { "name": "tootallnate", "email": "nathan@tootallnate.net" @@ -49,9 +51,9 @@ } ], "dist": { - "shasum": "4d5eaf06cc3d925847cd73d1535c217ba306d3e1", - "tarball": "http://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz" + "shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", + "tarball": "http://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/array-index/-/array-index-0.1.1.tgz" + "_resolved": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" } 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 ad8edc9f83eedd..a9604065674615 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,6 +1,6 @@ { "name": "path-array", - "version": "1.0.0", + "version": "1.0.1", "description": "Treat your $PATH like a JavaScript Array", "main": "index.js", "scripts": { @@ -26,16 +26,17 @@ }, "homepage": "https://github.com/TooTallNate/node-path-array", "dependencies": { - "array-index": "~0.1.0" + "array-index": "^1.0.0" }, "devDependencies": { "mocha": "~1.16.1" }, - "gitHead": "5d1fedd54e4413459f67e4a4babb024144cd00d0", - "_id": "path-array@1.0.0", - "_shasum": "6c14130c33084f0150553c657b38397ab67aaa4e", + "gitHead": "d249bd897661ca60720218edabbfeaa73c67778a", + "_id": "path-array@1.0.1", + "_shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", "_from": "path-array@>=1.0.0 <2.0.0", - "_npmVersion": "1.4.28", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", "_npmUser": { "name": "tootallnate", "email": "nathan@tootallnate.net" @@ -47,9 +48,9 @@ } ], "dist": { - "shasum": "6c14130c33084f0150553c657b38397ab67aaa4e", - "tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz" + "shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", + "tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/semver/.npmignore deleted file mode 100644 index 534108e3f481cf..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -coverage/ -.nyc_output/ -nyc_output/ diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/semver/.travis.yml deleted file mode 100644 index 991d04b6e2272b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'iojs' diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/Makefile b/deps/npm/node_modules/node-gyp/node_modules/semver/Makefile deleted file mode 100644 index 71af0e9750cd0a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -files = semver.browser.js \ - semver.min.js \ - semver.browser.js.gz \ - semver.min.js.gz - -all: $(files) - -clean: - rm -f $(files) - -semver.browser.js: head.js.txt semver.js foot.js.txt - ( cat head.js.txt; \ - cat semver.js | \ - egrep -v '^ *\/\* nomin \*\/' | \ - perl -pi -e 's/debug\([^\)]+\)//g'; \ - cat foot.js.txt ) > semver.browser.js - -semver.min.js: semver.browser.js - uglifyjs -m semver.min.js - -%.gz: % - gzip --stdout -9 <$< >$@ - -.PHONY: all clean diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/README.md b/deps/npm/node_modules/node-gyp/node_modules/semver/README.md deleted file mode 100644 index b5e35ff0b5bd95..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/README.md +++ /dev/null @@ -1,303 +0,0 @@ -semver(1) -- The semantic versioner for npm -=========================================== - -## Usage - - $ npm install semver - - semver.valid('1.2.3') // '1.2.3' - semver.valid('a.b.c') // null - semver.clean(' =v1.2.3 ') // '1.2.3' - semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true - semver.gt('1.2.3', '9.8.7') // false - semver.lt('1.2.3', '9.8.7') // true - -As a command-line utility: - - $ semver -h - - Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] - Test if version(s) satisfy the supplied range(s), and sort them. - - Multiple versions or ranges may be supplied, unless increment - option is specified. In that case, only a single version may - be used, and it is incremented by the specified level - - Program exits successfully if any valid version satisfies - all supplied ranges, and prints all satisfying versions. - - If no versions are valid, or ranges are not satisfied, - then exits failure. - - Versions are printed in ascending order, so supplying - multiple versions to the utility will just sort them. - -## Versions - -A "version" is described by the `v2.0.0` specification found at -. - -A leading `"="` or `"v"` character is stripped off and ignored. - -## Ranges - -A `version range` is a set of `comparators` which specify versions -that satisfy the range. - -A `comparator` is composed of an `operator` and a `version`. The set -of primitive `operators` is: - -* `<` Less than -* `<=` Less than or equal to -* `>` Greater than -* `>=` Greater than or equal to -* `=` Equal. If no operator is specified, then equality is assumed, - so this operator is optional, but MAY be included. - -For example, the comparator `>=1.2.7` would match the versions -`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` -or `1.1.0`. - -Comparators can be joined by whitespace to form a `comparator set`, -which is satisfied by the **intersection** of all of the comparators -it includes. - -A range is composed of one or more comparator sets, joined by `||`. A -version matches a range if and only if every comparator in at least -one of the `||`-separated comparator sets is satisfied by the version. - -For example, the range `>=1.2.7 <1.3.0` would match the versions -`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, -or `1.1.0`. - -The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, -`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. - -### Prerelease Tags - -If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then -it will only be allowed to satisfy comparator sets if at least one -comparator with the same `[major, minor, patch]` tuple also has a -prerelease tag. - -For example, the range `>1.2.3-alpha.3` would be allowed to match the -version `1.2.3-alpha.7`, but it would *not* be satisfied by -`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater -than" `1.2.3-alpha.3` according to the SemVer sort rules. The version -range only accepts prerelease tags on the `1.2.3` version. The -version `3.4.5` *would* satisfy the range, because it does not have a -prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. - -The purpose for this behavior is twofold. First, prerelease versions -frequently are updated very quickly, and contain many breaking changes -that are (by the author's design) not yet fit for public consumption. -Therefore, by default, they are excluded from range matching -semantics. - -Second, a user who has opted into using a prerelease version has -clearly indicated the intent to use *that specific* set of -alpha/beta/rc versions. By including a prerelease tag in the range, -the user is indicating that they are aware of the risk. However, it -is still not appropriate to assume that they have opted into taking a -similar risk on the *next* set of prerelease versions. - -#### Prerelease Identifiers - -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') -'1.2.4-beta.0' -``` - -command-line example: - -```shell -$ semver 1.2.3 -i prerelease --preid beta -1.2.4-beta.0 -``` - -Which then can be used to increment further: - -```shell -$ semver 1.2.4-beta.0 -i prerelease -1.2.4-beta.1 -``` - -### Advanced Range Syntax - -Advanced range syntax desugars to primitive comparators in -deterministic ways. - -Advanced ranges may be combined in the same way as primitive -comparators using white space or `||`. - -#### Hyphen Ranges `X.Y.Z - A.B.C` - -Specifies an inclusive set. - -* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` - -If a partial version is provided as the first version in the inclusive -range, then the missing pieces are replaced with zeroes. - -* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` - -If a partial version is provided as the second version in the -inclusive range, then all versions that start with the supplied parts -of the tuple are accepted, but nothing that would be greater than the -provided tuple parts. - -* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` -* `1.2.3 - 2` := `>=1.2.3 <3.0.0` - -#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` - -Any of `X`, `x`, or `*` may be used to "stand in" for one of the -numeric values in the `[major, minor, patch]` tuple. - -* `*` := `>=0.0.0` (Any version satisfies) -* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) -* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) - -A partial version range is treated as an X-Range, so the special -character is in fact optional. - -* `""` (empty string) := `*` := `>=0.0.0` -* `1` := `1.x.x` := `>=1.0.0 <2.0.0` -* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` - -#### Tilde Ranges `~1.2.3` `~1.2` `~1` - -Allows patch-level changes if a minor version is specified on the -comparator. Allows minor-level changes if not. - -* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` -* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) -* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) -* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` -* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) -* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) -* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. - -#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` - -Allows changes that do not modify the left-most non-zero digit in the -`[major, minor, patch]` tuple. In other words, this allows patch and -minor updates for versions `1.0.0` and above, patch updates for -versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. - -Many authors treat a `0.x` version as if the `x` were the major -"breaking-change" indicator. - -Caret ranges are ideal when an author may make breaking changes -between `0.2.4` and `0.3.0` releases, which is a common practice. -However, it presumes that there will *not* be breaking changes between -`0.2.4` and `0.2.5`. It allows for changes that are presumed to be -additive (but non-breaking), according to commonly observed practices. - -* `^1.2.3` := `>=1.2.3 <2.0.0` -* `^0.2.3` := `>=0.2.3 <0.3.0` -* `^0.0.3` := `>=0.0.3 <0.0.4` -* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in - the `1.2.3` version will be allowed, if they are greater than or - equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but - `1.2.4-beta.2` would not, because it is a prerelease of a - different `[major, minor, patch]` tuple. -* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the - `0.0.3` version *only* will be allowed, if they are greater than or - equal to `beta`. So, `0.0.3-pr.2` would be allowed. - -When parsing caret ranges, a missing `patch` value desugars to the -number `0`, but will allow flexibility within that value, even if the -major and minor versions are both `0`. - -* `^1.2.x` := `>=1.2.0 <2.0.0` -* `^0.0.x` := `>=0.0.0 <0.1.0` -* `^0.0` := `>=0.0.0 <0.1.0` - -A missing `minor` and `patch` values will desugar to zero, but also -allow flexibility within those values, even if the major version is -zero. - -* `^1.x` := `>=1.0.0 <2.0.0` -* `^0.x` := `>=0.0.0 <1.0.0` - -## Functions - -All methods and classes take a final `loose` boolean argument that, if -true, will be more forgiving about not-quite-valid semver strings. -The resulting output will always be 100% strict, of course. - -Strict-mode Comparators and Ranges will be strict about the SemVer -strings that they parse. - -* `valid(v)`: Return the parsed version, or null if it's not valid. -* `inc(v, release)`: Return the version incremented by the release - type (`major`, `premajor`, `minor`, `preminor`, `patch`, - `prepatch`, or `prerelease`), or null if it's not valid - * `premajor` in one call will bump the version up to the next major - version and down to a prerelease of that major version. - `preminor`, and `prepatch` work the same way. - * If called from a non-prerelease version, the `prerelease` will work the - same as `prepatch`. It increments the patch version, then makes a - prerelease. If the input version is already a prerelease it simply - increments it. -* `major(v)`: Return the major version number. -* `minor(v)`: Return the minor version number. -* `patch(v)`: Return the patch version number. - -### Comparison - -* `gt(v1, v2)`: `v1 > v2` -* `gte(v1, v2)`: `v1 >= v2` -* `lt(v1, v2)`: `v1 < v2` -* `lte(v1, v2)`: `v1 <= v2` -* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, - even if they're not the exact same string. You already know how to - compare strings. -* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. -* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call - the corresponding function above. `"==="` and `"!=="` do simple - string comparison, but are included for completeness. Throws if an - invalid comparison string is provided. -* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if - `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. -* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions - in descending order when passed to `Array.sort()`. -* `diff(v1, v2)`: Returns difference between two versions by the release type - (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), - or null if the versions are the same. - - -### Ranges - -* `validRange(range)`: Return the valid range or null if it's not valid -* `satisfies(version, range)`: Return true if the version satisfies the - range. -* `maxSatisfying(versions, range)`: Return the highest version in the list - that satisfies the range, or `null` if none of them do. -* `gtr(version, range)`: Return `true` if version is greater than all the - versions possible in the range. -* `ltr(version, range)`: Return `true` if version is less than all the - versions possible in the range. -* `outside(version, range, hilo)`: Return true if the version is outside - the bounds of the range in either the high or low direction. The - `hilo` argument must be either the string `'>'` or `'<'`. (This is - the function called by `gtr` and `ltr`.) - -Note that, since ranges may be non-contiguous, a version might not be -greater than a range, less than a range, *or* satisfy a range! For -example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` -until `2.0.0`, so the version `1.2.10` would not be greater than the -range (because `2.0.1` satisfies, which is higher), nor less than the -range (since `1.2.8` satisfies, which is lower), and it also does not -satisfy the range. - -If you want to know if a version satisfies or does not satisfy a -range, use the `satisfies(version, range)` function. diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/bin/semver b/deps/npm/node_modules/node-gyp/node_modules/semver/bin/semver deleted file mode 100755 index c5f2e857e82790..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/bin/semver +++ /dev/null @@ -1,133 +0,0 @@ -#!/usr/bin/env node -// Standalone semver comparison program. -// Exits successfully and prints matching version(s) if -// any supplied version is valid and passes all tests. - -var argv = process.argv.slice(2) - , versions = [] - , range = [] - , gt = [] - , lt = [] - , eq = [] - , inc = null - , version = require("../package.json").version - , loose = false - , identifier = undefined - , semver = require("../semver") - , reverse = false - -main() - -function main () { - if (!argv.length) return help() - while (argv.length) { - var a = argv.shift() - var i = a.indexOf('=') - if (i !== -1) { - a = a.slice(0, i) - argv.unshift(a.slice(i + 1)) - } - switch (a) { - case "-rv": case "-rev": case "--rev": case "--reverse": - reverse = true - break - case "-l": case "--loose": - loose = true - break - case "-v": case "--version": - versions.push(argv.shift()) - break - case "-i": case "--inc": case "--increment": - switch (argv[0]) { - case "major": case "minor": case "patch": case "prerelease": - case "premajor": case "preminor": case "prepatch": - inc = argv.shift() - break - default: - inc = "patch" - break - } - break - case "--preid": - identifier = argv.shift() - break - case "-r": case "--range": - range.push(argv.shift()) - break - case "-h": case "--help": case "-?": - return help() - default: - versions.push(a) - break - } - } - - versions = versions.filter(function (v) { - return semver.valid(v, loose) - }) - if (!versions.length) return fail() - if (inc && (versions.length !== 1 || range.length)) - return failInc() - - for (var i = 0, l = range.length; i < l ; i ++) { - versions = versions.filter(function (v) { - return semver.satisfies(v, range[i], loose) - }) - if (!versions.length) return fail() - } - return success(versions) -} - -function failInc () { - console.error("--inc can only be used on a single version with no range") - fail() -} - -function fail () { process.exit(1) } - -function success () { - var compare = reverse ? "rcompare" : "compare" - versions.sort(function (a, b) { - return semver[compare](a, b, loose) - }).map(function (v) { - return semver.clean(v, loose) - }).map(function (v) { - return inc ? semver.inc(v, inc, loose, identifier) : v - }).forEach(function (v,i,_) { console.log(v) }) -} - -function help () { - console.log(["SemVer " + version - ,"" - ,"A JavaScript implementation of the http://semver.org/ specification" - ,"Copyright Isaac Z. Schlueter" - ,"" - ,"Usage: semver [options] [ [...]]" - ,"Prints valid versions sorted by SemVer precedence" - ,"" - ,"Options:" - ,"-r --range " - ," Print versions that match the specified range." - ,"" - ,"-i --increment []" - ," Increment a version by the specified level. Level can" - ," be one of: major, minor, patch, premajor, preminor," - ," prepatch, or prerelease. Default level is 'patch'." - ," Only one version may be specified." - ,"" - ,"--preid " - ," Identifier to be used to prefix premajor, preminor," - ," prepatch or prerelease version increments." - ,"" - ,"-l --loose" - ," Interpret versions and ranges loosely" - ,"" - ,"Program exits successfully if any valid version satisfies" - ,"all supplied ranges, and prints all satisfying versions." - ,"" - ,"If no satisfying versions are found, then exits failure." - ,"" - ,"Versions are printed in ascending order, so supplying" - ,"multiple versions to the utility will just sort them." - ].join("\n")) -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/foot.js.txt b/deps/npm/node_modules/node-gyp/node_modules/semver/foot.js.txt deleted file mode 100644 index 8f83c20f8ed5a6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/foot.js.txt +++ /dev/null @@ -1,6 +0,0 @@ - -})( - typeof exports === 'object' ? exports : - typeof define === 'function' && define.amd ? {} : - semver = {} -); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/head.js.txt b/deps/npm/node_modules/node-gyp/node_modules/semver/head.js.txt deleted file mode 100644 index 591afab46f939f..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/head.js.txt +++ /dev/null @@ -1 +0,0 @@ -;(function(exports) { diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/package.json b/deps/npm/node_modules/node-gyp/node_modules/semver/package.json deleted file mode 100644 index e9b6abe3f7e0d8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "semver", - "version": "4.3.6", - "description": "The semantic version parser used by npm.", - "main": "semver.js", - "browser": "semver.browser.js", - "min": "semver.min.js", - "scripts": { - "test": "tap test/*.js", - "prepublish": "make" - }, - "devDependencies": { - "tap": "^1.2.0", - "uglify-js": "~2.3.6" - }, - "license": "ISC", - "repository": { - "type": "git", - "url": "git://github.com/npm/node-semver.git" - }, - "bin": { - "semver": "./bin/semver" - }, - "gitHead": "63c48296ca5da3ba6a88c743bb8c92effc789811", - "bugs": { - "url": "https://github.com/npm/node-semver/issues" - }, - "homepage": "https://github.com/npm/node-semver#readme", - "_id": "semver@4.3.6", - "_shasum": "300bc6e0e86374f7ba61068b5b1ecd57fc6532da", - "_from": "semver@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0||>=4.0.0 <5.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "300bc6e0e86374f7ba61068b5b1ecd57fc6532da", - "tarball": "http://registry.npmjs.org/semver/-/semver-4.3.6.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js b/deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js deleted file mode 100644 index 4b0cfecf2c0312..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js +++ /dev/null @@ -1,1201 +0,0 @@ -;(function(exports) { - -// export the class if we are in a Node-like system. -if (typeof module === 'object' && module.exports === exports) - exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - ; - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - if (version.length > MAX_LENGTH) - return null; - - var r = loose ? re[LOOSE] : re[FULL]; - if (!r.test(version)) - return null; - - try { - return new SemVer(version, loose); - } catch (er) { - return null; - } -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version.trim().replace(/^[=v]+/, ''), loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - ; - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) - throw new TypeError('Invalid major version') - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) - throw new TypeError('Invalid minor version') - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) - throw new TypeError('Invalid patch version') - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) - return num - } - return id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.inspect = function() { - return ''; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - ; - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.length && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - ; - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) - this.major++; - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) - this.minor++; - this.patch = 0; - this.prerelease = []; - break; - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) - this.patch++; - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) - this.prerelease = [identifier, 0]; - } else - this.prerelease = [identifier, 0]; - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - return this; -}; - -exports.inc = inc; -function inc(version, release, loose, identifier) { - if (typeof(loose) === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - if (v1.prerelease.length || v2.prerelease.length) { - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return 'pre'+key; - } - } - } - return 'prerelease'; - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return key; - } - } - } - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(b); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a === b; - break; - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a !== b; - break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - ; - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; - - ; -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - if (this.operator === '=') - this.operator = ''; - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else - this.semver = new SemVer(m[2], this.loose); -}; - -Comparator.prototype.inspect = function() { - return ''; -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - ; - - if (this.semver === ANY) - return true; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - return cmp(version, this.operator, this.semver, this.loose); -}; - - -exports.Range = Range; -function Range(range, loose) { - if ((range instanceof Range) && range.loose === loose) - return range; - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.inspect = function() { - return ''; -}; - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - ; - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - ; - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - ; - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - ; - comp = replaceCarets(comp, loose); - ; - comp = replaceTildes(comp, loose); - ; - comp = replaceXRanges(comp, loose); - ; - comp = replaceStars(comp, loose); - ; - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - ; - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else if (pr) { - ; - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - - ; - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - ; - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - ; - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) { - if (M === '0') - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } else if (pr) { - ; - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0'; - } else { - ; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0'; - } - - ; - return ret; - }); -} - -function replaceXRanges(comp, loose) { - ; - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - ; - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // replace X with 0 - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) - M = +M + 1 - else - m = +m + 1 - } - - ret = gtlt + M + '.' + m + '.' + p; - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } - - ; - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - ; - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - - if (version.prerelease.length) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (var i = 0; i < set.length; i++) { - ; - if (set[i].semver === ANY) - continue; - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) - return true; - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false; - } - - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - return versions.filter(function(version) { - return satisfies(version, range, loose); - }).sort(function(a, b) { - return rcompare(a, b, loose); - })[0] || null; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr; -function ltr(version, range, loose) { - return outside(version, range, '<', loose); -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr; -function gtr(version, range, loose) { - return outside(version, range, '>', loose); -} - -exports.outside = outside; -function outside(version, range, hilo, loose) { - version = new SemVer(version, loose); - range = new Range(range, loose); - - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, loose)) { - return false; - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - - var high = null; - var low = null; - - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, loose)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, loose)) { - low = comparator; - } - }); - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false; - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; -} - -// Use the define() function if we're in AMD land -if (typeof define === 'function' && define.amd) - define(exports); - -})( - typeof exports === 'object' ? exports : - typeof define === 'function' && define.amd ? {} : - semver = {} -); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js.gz b/deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js.gz deleted file mode 100644 index d67009d8ad2cd5..00000000000000 Binary files a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.browser.js.gz and /dev/null differ diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.js b/deps/npm/node_modules/node-gyp/node_modules/semver/semver.js deleted file mode 100644 index cafcc006b06dc0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.js +++ /dev/null @@ -1,1205 +0,0 @@ -// export the class if we are in a Node-like system. -if (typeof module === 'object' && module.exports === exports) - exports = module.exports = SemVer; - -// The debug function is excluded entirely from the minified version. -/* nomin */ var debug; -/* nomin */ if (typeof process === 'object' && - /* nomin */ process.env && - /* nomin */ process.env.NODE_DEBUG && - /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG)) - /* nomin */ debug = function() { - /* nomin */ var args = Array.prototype.slice.call(arguments, 0); - /* nomin */ args.unshift('SEMVER'); - /* nomin */ console.log.apply(console, args); - /* nomin */ }; -/* nomin */ else - /* nomin */ debug = function() {}; - -// Note: this is the semver.org version of the spec that it implements -// Not necessarily the package version of this code. -exports.SEMVER_SPEC_VERSION = '2.0.0'; - -var MAX_LENGTH = 256; -var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991; - -// The actual regexps go on exports.re -var re = exports.re = []; -var src = exports.src = []; -var R = 0; - -// The following Regular Expressions can be used for tokenizing, -// validating, and parsing SemVer version strings. - -// ## Numeric Identifier -// A single `0`, or a non-zero digit followed by zero or more digits. - -var NUMERICIDENTIFIER = R++; -src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'; -var NUMERICIDENTIFIERLOOSE = R++; -src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'; - - -// ## Non-numeric Identifier -// Zero or more digits, followed by a letter or hyphen, and then zero or -// more letters, digits, or hyphens. - -var NONNUMERICIDENTIFIER = R++; -src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'; - - -// ## Main Version -// Three dot-separated numeric identifiers. - -var MAINVERSION = R++; -src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')\\.' + - '(' + src[NUMERICIDENTIFIER] + ')'; - -var MAINVERSIONLOOSE = R++; -src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' + - '(' + src[NUMERICIDENTIFIERLOOSE] + ')'; - -// ## Pre-release Version Identifier -// A numeric identifier, or a non-numeric identifier. - -var PRERELEASEIDENTIFIER = R++; -src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - -var PRERELEASEIDENTIFIERLOOSE = R++; -src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] + - '|' + src[NONNUMERICIDENTIFIER] + ')'; - - -// ## Pre-release Version -// Hyphen, followed by one or more dot-separated pre-release version -// identifiers. - -var PRERELEASE = R++; -src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] + - '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'; - -var PRERELEASELOOSE = R++; -src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] + - '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'; - -// ## Build Metadata Identifier -// Any combination of digits, letters, or hyphens. - -var BUILDIDENTIFIER = R++; -src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'; - -// ## Build Metadata -// Plus sign, followed by one or more period-separated build metadata -// identifiers. - -var BUILD = R++; -src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] + - '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'; - - -// ## Full Version String -// A main version, followed optionally by a pre-release version and -// build metadata. - -// Note that the only major, minor, patch, and pre-release sections of -// the version string are capturing groups. The build metadata is not a -// capturing group, because it should not ever be used in version -// comparison. - -var FULL = R++; -var FULLPLAIN = 'v?' + src[MAINVERSION] + - src[PRERELEASE] + '?' + - src[BUILD] + '?'; - -src[FULL] = '^' + FULLPLAIN + '$'; - -// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. -// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty -// common in the npm registry. -var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] + - src[PRERELEASELOOSE] + '?' + - src[BUILD] + '?'; - -var LOOSE = R++; -src[LOOSE] = '^' + LOOSEPLAIN + '$'; - -var GTLT = R++; -src[GTLT] = '((?:<|>)?=?)'; - -// Something like "2.*" or "1.2.x". -// Note that "x.x" is a valid xRange identifer, meaning "any version" -// Only the first item is strictly required. -var XRANGEIDENTIFIERLOOSE = R++; -src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'; -var XRANGEIDENTIFIER = R++; -src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'; - -var XRANGEPLAIN = R++; -src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:' + src[PRERELEASE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGEPLAINLOOSE = R++; -src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:' + src[PRERELEASELOOSE] + ')?' + - src[BUILD] + '?' + - ')?)?'; - -var XRANGE = R++; -src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; -var XRANGELOOSE = R++; -src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'; - -// Tilde ranges. -// Meaning is "reasonably at or greater than" -var LONETILDE = R++; -src[LONETILDE] = '(?:~>?)'; - -var TILDETRIM = R++; -src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'; -re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g'); -var tildeTrimReplace = '$1~'; - -var TILDE = R++; -src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; -var TILDELOOSE = R++; -src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'; - -// Caret ranges. -// Meaning is "at least and backwards compatible with" -var LONECARET = R++; -src[LONECARET] = '(?:\\^)'; - -var CARETTRIM = R++; -src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'; -re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g'); -var caretTrimReplace = '$1^'; - -var CARET = R++; -src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'; -var CARETLOOSE = R++; -src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'; - -// A simple gt/lt/eq thing, or just "" to indicate "any version" -var COMPARATORLOOSE = R++; -src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'; -var COMPARATOR = R++; -src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'; - - -// An expression to strip any whitespace between the gtlt and the thing -// it modifies, so that `> 1.2.3` ==> `>1.2.3` -var COMPARATORTRIM = R++; -src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] + - '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'; - -// this one has to use the /g flag -re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g'); -var comparatorTrimReplace = '$1$2$3'; - - -// Something like `1.2.3 - 1.2.4` -// Note that these all use the loose form, because they'll be -// checked against either the strict or loose comparator form -// later. -var HYPHENRANGE = R++; -src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAIN] + ')' + - '\\s*$'; - -var HYPHENRANGELOOSE = R++; -src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s+-\\s+' + - '(' + src[XRANGEPLAINLOOSE] + ')' + - '\\s*$'; - -// Star ranges basically just allow anything at all. -var STAR = R++; -src[STAR] = '(<|>)?=?\\s*\\*'; - -// Compile to actual regexp objects. -// All are flag-free, unless they were created above with a flag. -for (var i = 0; i < R; i++) { - debug(i, src[i]); - if (!re[i]) - re[i] = new RegExp(src[i]); -} - -exports.parse = parse; -function parse(version, loose) { - if (version instanceof SemVer) - return version; - - if (typeof version !== 'string') - return null; - - if (version.length > MAX_LENGTH) - return null; - - var r = loose ? re[LOOSE] : re[FULL]; - if (!r.test(version)) - return null; - - try { - return new SemVer(version, loose); - } catch (er) { - return null; - } -} - -exports.valid = valid; -function valid(version, loose) { - var v = parse(version, loose); - return v ? v.version : null; -} - - -exports.clean = clean; -function clean(version, loose) { - var s = parse(version.trim().replace(/^[=v]+/, ''), loose); - return s ? s.version : null; -} - -exports.SemVer = SemVer; - -function SemVer(version, loose) { - if (version instanceof SemVer) { - if (version.loose === loose) - return version; - else - version = version.version; - } else if (typeof version !== 'string') { - throw new TypeError('Invalid Version: ' + version); - } - - if (version.length > MAX_LENGTH) - throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters') - - if (!(this instanceof SemVer)) - return new SemVer(version, loose); - - debug('SemVer', version, loose); - this.loose = loose; - var m = version.trim().match(loose ? re[LOOSE] : re[FULL]); - - if (!m) - throw new TypeError('Invalid Version: ' + version); - - this.raw = version; - - // these are actually numbers - this.major = +m[1]; - this.minor = +m[2]; - this.patch = +m[3]; - - if (this.major > MAX_SAFE_INTEGER || this.major < 0) - throw new TypeError('Invalid major version') - - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) - throw new TypeError('Invalid minor version') - - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) - throw new TypeError('Invalid patch version') - - // numberify any prerelease numeric ids - if (!m[4]) - this.prerelease = []; - else - this.prerelease = m[4].split('.').map(function(id) { - if (/^[0-9]+$/.test(id)) { - var num = +id - if (num >= 0 && num < MAX_SAFE_INTEGER) - return num - } - return id; - }); - - this.build = m[5] ? m[5].split('.') : []; - this.format(); -} - -SemVer.prototype.format = function() { - this.version = this.major + '.' + this.minor + '.' + this.patch; - if (this.prerelease.length) - this.version += '-' + this.prerelease.join('.'); - return this.version; -}; - -SemVer.prototype.inspect = function() { - return ''; -}; - -SemVer.prototype.toString = function() { - return this.version; -}; - -SemVer.prototype.compare = function(other) { - debug('SemVer.compare', this.version, this.loose, other); - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return this.compareMain(other) || this.comparePre(other); -}; - -SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - return compareIdentifiers(this.major, other.major) || - compareIdentifiers(this.minor, other.minor) || - compareIdentifiers(this.patch, other.patch); -}; - -SemVer.prototype.comparePre = function(other) { - if (!(other instanceof SemVer)) - other = new SemVer(other, this.loose); - - // NOT having a prerelease is > having one - if (this.prerelease.length && !other.prerelease.length) - return -1; - else if (!this.prerelease.length && other.prerelease.length) - return 1; - else if (!this.prerelease.length && !other.prerelease.length) - return 0; - - var i = 0; - do { - var a = this.prerelease[i]; - var b = other.prerelease[i]; - debug('prerelease compare', i, a, b); - if (a === undefined && b === undefined) - return 0; - else if (b === undefined) - return 1; - else if (a === undefined) - return -1; - else if (a === b) - continue; - else - return compareIdentifiers(a, b); - } while (++i); -}; - -// preminor will bump the version up to the next minor release, and immediately -// down to pre-release. premajor and prepatch work the same way. -SemVer.prototype.inc = function(release, identifier) { - switch (release) { - case 'premajor': - this.prerelease.length = 0; - this.patch = 0; - this.minor = 0; - this.major++; - this.inc('pre', identifier); - break; - case 'preminor': - this.prerelease.length = 0; - this.patch = 0; - this.minor++; - this.inc('pre', identifier); - break; - case 'prepatch': - // If this is already a prerelease, it will bump to the next version - // drop any prereleases that might already exist, since they are not - // relevant at this point. - this.prerelease.length = 0; - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - // If the input is a non-prerelease version, this acts the same as - // prepatch. - case 'prerelease': - if (this.prerelease.length === 0) - this.inc('patch', identifier); - this.inc('pre', identifier); - break; - - case 'major': - // If this is a pre-major version, bump up to the same major version. - // Otherwise increment major. - // 1.0.0-5 bumps to 1.0.0 - // 1.1.0 bumps to 2.0.0 - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) - this.major++; - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case 'minor': - // If this is a pre-minor version, bump up to the same minor version. - // Otherwise increment minor. - // 1.2.0-5 bumps to 1.2.0 - // 1.2.1 bumps to 1.3.0 - if (this.patch !== 0 || this.prerelease.length === 0) - this.minor++; - this.patch = 0; - this.prerelease = []; - break; - case 'patch': - // If this is not a pre-release version, it will increment the patch. - // If it is a pre-release it will bump up to the same patch version. - // 1.2.0-5 patches to 1.2.0 - // 1.2.0 patches to 1.2.1 - if (this.prerelease.length === 0) - this.patch++; - this.prerelease = []; - break; - // This probably shouldn't be used publicly. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. - case 'pre': - if (this.prerelease.length === 0) - this.prerelease = [0]; - else { - var i = this.prerelease.length; - while (--i >= 0) { - if (typeof this.prerelease[i] === 'number') { - this.prerelease[i]++; - i = -2; - } - } - if (i === -1) // didn't increment anything - this.prerelease.push(0); - } - if (identifier) { - // 1.2.0-beta.1 bumps to 1.2.0-beta.2, - // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) - this.prerelease = [identifier, 0]; - } else - this.prerelease = [identifier, 0]; - } - break; - - default: - throw new Error('invalid increment argument: ' + release); - } - this.format(); - return this; -}; - -exports.inc = inc; -function inc(version, release, loose, identifier) { - if (typeof(loose) === 'string') { - identifier = loose; - loose = undefined; - } - - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; - } -} - -exports.diff = diff; -function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - if (v1.prerelease.length || v2.prerelease.length) { - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return 'pre'+key; - } - } - } - return 'prerelease'; - } - for (var key in v1) { - if (key === 'major' || key === 'minor' || key === 'patch') { - if (v1[key] !== v2[key]) { - return key; - } - } - } - } -} - -exports.compareIdentifiers = compareIdentifiers; - -var numeric = /^[0-9]+$/; -function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - - if (anum && bnum) { - a = +a; - b = +b; - } - - return (anum && !bnum) ? -1 : - (bnum && !anum) ? 1 : - a < b ? -1 : - a > b ? 1 : - 0; -} - -exports.rcompareIdentifiers = rcompareIdentifiers; -function rcompareIdentifiers(a, b) { - return compareIdentifiers(b, a); -} - -exports.major = major; -function major(a, loose) { - return new SemVer(a, loose).major; -} - -exports.minor = minor; -function minor(a, loose) { - return new SemVer(a, loose).minor; -} - -exports.patch = patch; -function patch(a, loose) { - return new SemVer(a, loose).patch; -} - -exports.compare = compare; -function compare(a, b, loose) { - return new SemVer(a, loose).compare(b); -} - -exports.compareLoose = compareLoose; -function compareLoose(a, b) { - return compare(a, b, true); -} - -exports.rcompare = rcompare; -function rcompare(a, b, loose) { - return compare(b, a, loose); -} - -exports.sort = sort; -function sort(list, loose) { - return list.sort(function(a, b) { - return exports.compare(a, b, loose); - }); -} - -exports.rsort = rsort; -function rsort(list, loose) { - return list.sort(function(a, b) { - return exports.rcompare(a, b, loose); - }); -} - -exports.gt = gt; -function gt(a, b, loose) { - return compare(a, b, loose) > 0; -} - -exports.lt = lt; -function lt(a, b, loose) { - return compare(a, b, loose) < 0; -} - -exports.eq = eq; -function eq(a, b, loose) { - return compare(a, b, loose) === 0; -} - -exports.neq = neq; -function neq(a, b, loose) { - return compare(a, b, loose) !== 0; -} - -exports.gte = gte; -function gte(a, b, loose) { - return compare(a, b, loose) >= 0; -} - -exports.lte = lte; -function lte(a, b, loose) { - return compare(a, b, loose) <= 0; -} - -exports.cmp = cmp; -function cmp(a, op, b, loose) { - var ret; - switch (op) { - case '===': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a === b; - break; - case '!==': - if (typeof a === 'object') a = a.version; - if (typeof b === 'object') b = b.version; - ret = a !== b; - break; - case '': case '=': case '==': ret = eq(a, b, loose); break; - case '!=': ret = neq(a, b, loose); break; - case '>': ret = gt(a, b, loose); break; - case '>=': ret = gte(a, b, loose); break; - case '<': ret = lt(a, b, loose); break; - case '<=': ret = lte(a, b, loose); break; - default: throw new TypeError('Invalid operator: ' + op); - } - return ret; -} - -exports.Comparator = Comparator; -function Comparator(comp, loose) { - if (comp instanceof Comparator) { - if (comp.loose === loose) - return comp; - else - comp = comp.value; - } - - if (!(this instanceof Comparator)) - return new Comparator(comp, loose); - - debug('comparator', comp, loose); - this.loose = loose; - this.parse(comp); - - if (this.semver === ANY) - this.value = ''; - else - this.value = this.operator + this.semver.version; - - debug('comp', this); -} - -var ANY = {}; -Comparator.prototype.parse = function(comp) { - var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var m = comp.match(r); - - if (!m) - throw new TypeError('Invalid comparator: ' + comp); - - this.operator = m[1]; - if (this.operator === '=') - this.operator = ''; - - // if it literally is just '>' or '' then allow anything. - if (!m[2]) - this.semver = ANY; - else - this.semver = new SemVer(m[2], this.loose); -}; - -Comparator.prototype.inspect = function() { - return ''; -}; - -Comparator.prototype.toString = function() { - return this.value; -}; - -Comparator.prototype.test = function(version) { - debug('Comparator.test', version, this.loose); - - if (this.semver === ANY) - return true; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - return cmp(version, this.operator, this.semver, this.loose); -}; - - -exports.Range = Range; -function Range(range, loose) { - if ((range instanceof Range) && range.loose === loose) - return range; - - if (!(this instanceof Range)) - return new Range(range, loose); - - this.loose = loose; - - // First, split based on boolean or || - this.raw = range; - this.set = range.split(/\s*\|\|\s*/).map(function(range) { - return this.parseRange(range.trim()); - }, this).filter(function(c) { - // throw out any that are not relevant for whatever reason - return c.length; - }); - - if (!this.set.length) { - throw new TypeError('Invalid SemVer Range: ' + range); - } - - this.format(); -} - -Range.prototype.inspect = function() { - return ''; -}; - -Range.prototype.format = function() { - this.range = this.set.map(function(comps) { - return comps.join(' ').trim(); - }).join('||').trim(); - return this.range; -}; - -Range.prototype.toString = function() { - return this.range; -}; - -Range.prototype.parseRange = function(range) { - var loose = this.loose; - range = range.trim(); - debug('range', range, loose); - // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` - var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug('hyphen replace', range); - // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` - range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace); - debug('comparator trim', range, re[COMPARATORTRIM]); - - // `~ 1.2.3` => `~1.2.3` - range = range.replace(re[TILDETRIM], tildeTrimReplace); - - // `^ 1.2.3` => `^1.2.3` - range = range.replace(re[CARETTRIM], caretTrimReplace); - - // normalize spaces - range = range.split(/\s+/).join(' '); - - // At this point, the range is completely trimmed and - // ready to be split into comparators. - - var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]; - var set = range.split(' ').map(function(comp) { - return parseComparator(comp, loose); - }).join(' ').split(/\s+/); - if (this.loose) { - // in loose mode, throw out any that are not valid comparators - set = set.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set = set.map(function(comp) { - return new Comparator(comp, loose); - }); - - return set; -}; - -// Mostly just for testing and legacy API reasons -exports.toComparators = toComparators; -function toComparators(range, loose) { - return new Range(range, loose).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(' ').trim().split(' '); - }); -} - -// comprised of xranges, tildes, stars, and gtlt's at this point. -// already replaced the hyphen ranges -// turn into a set of JUST comparators. -function parseComparator(comp, loose) { - debug('comp', comp); - comp = replaceCarets(comp, loose); - debug('caret', comp); - comp = replaceTildes(comp, loose); - debug('tildes', comp); - comp = replaceXRanges(comp, loose); - debug('xrange', comp); - comp = replaceStars(comp, loose); - debug('stars', comp); - return comp; -} - -function isX(id) { - return !id || id.toLowerCase() === 'x' || id === '*'; -} - -// ~, ~> --> * (any, kinda silly) -// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0 -// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0 -// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0 -// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0 -// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0 -function replaceTildes(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceTilde(comp, loose); - }).join(' '); -} - -function replaceTilde(comp, loose) { - var r = loose ? re[TILDELOOSE] : re[TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('tilde', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else if (pr) { - debug('replaceTilde pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - // ~1.2.3 == >=1.2.3 <1.3.0 - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - - debug('tilde return', ret); - return ret; - }); -} - -// ^ --> * (any, kinda silly) -// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0 -// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0 -// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0 -// ^1.2.3 --> >=1.2.3 <2.0.0 -// ^1.2.0 --> >=1.2.0 <2.0.0 -function replaceCarets(comp, loose) { - return comp.trim().split(/\s+/).map(function(comp) { - return replaceCaret(comp, loose); - }).join(' '); -} - -function replaceCaret(comp, loose) { - debug('caret', comp, loose); - var r = loose ? re[CARETLOOSE] : re[CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug('caret', comp, _, M, m, p, pr); - var ret; - - if (isX(M)) - ret = ''; - else if (isX(m)) - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - else if (isX(p)) { - if (M === '0') - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - else - ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; - } else if (pr) { - debug('replaceCaret pr', pr); - if (pr.charAt(0) !== '-') - pr = '-' + pr; - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0'; - } else { - debug('no pr'); - if (M === '0') { - if (m === '0') - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + m + '.' + (+p + 1); - else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + M + '.' + (+m + 1) + '.0'; - } else - ret = '>=' + M + '.' + m + '.' + p + - ' <' + (+M + 1) + '.0.0'; - } - - debug('caret return', ret); - return ret; - }); -} - -function replaceXRanges(comp, loose) { - debug('replaceXRanges', comp, loose); - return comp.split(/\s+/).map(function(comp) { - return replaceXRange(comp, loose); - }).join(' '); -} - -function replaceXRange(comp, loose) { - comp = comp.trim(); - var r = loose ? re[XRANGELOOSE] : re[XRANGE]; - return comp.replace(r, function(ret, gtlt, M, m, p, pr) { - debug('xRange', comp, ret, gtlt, M, m, p, pr); - var xM = isX(M); - var xm = xM || isX(m); - var xp = xm || isX(p); - var anyX = xp; - - if (gtlt === '=' && anyX) - gtlt = ''; - - if (xM) { - if (gtlt === '>' || gtlt === '<') { - // nothing is allowed - ret = '<0.0.0'; - } else { - // nothing is forbidden - ret = '*'; - } - } else if (gtlt && anyX) { - // replace X with 0 - if (xm) - m = 0; - if (xp) - p = 0; - - if (gtlt === '>') { - // >1 => >=2.0.0 - // >1.2 => >=1.3.0 - // >1.2.3 => >= 1.2.4 - gtlt = '>='; - if (xm) { - M = +M + 1; - m = 0; - p = 0; - } else if (xp) { - m = +m + 1; - p = 0; - } - } else if (gtlt === '<=') { - // <=0.7.x is actually <0.8.0, since any 0.7.x should - // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' - if (xm) - M = +M + 1 - else - m = +m + 1 - } - - ret = gtlt + M + '.' + m + '.' + p; - } else if (xm) { - ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; - } else if (xp) { - ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; - } - - debug('xRange return', ret); - - return ret; - }); -} - -// Because * is AND-ed with everything else in the comparator, -// and '' means "any version", just remove the *s entirely. -function replaceStars(comp, loose) { - debug('replaceStars', comp, loose); - // Looseness is ignored here. star is always as loose as it gets! - return comp.trim().replace(re[STAR], ''); -} - -// This function is passed to string.replace(re[HYPHENRANGE]) -// M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0 <3.5.0 -function hyphenReplace($0, - from, fM, fm, fp, fpr, fb, - to, tM, tm, tp, tpr, tb) { - - if (isX(fM)) - from = ''; - else if (isX(fm)) - from = '>=' + fM + '.0.0'; - else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0'; - else - from = '>=' + from; - - if (isX(tM)) - to = ''; - else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0'; - else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0'; - else if (tpr) - to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; - else - to = '<=' + to; - - return (from + ' ' + to).trim(); -} - - -// if ANY of the sets match ALL of its comparators, then pass -Range.prototype.test = function(version) { - if (!version) - return false; - - if (typeof version === 'string') - version = new SemVer(version, this.loose); - - for (var i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version)) - return true; - } - return false; -}; - -function testSet(set, version) { - for (var i = 0; i < set.length; i++) { - if (!set[i].test(version)) - return false; - } - - if (version.prerelease.length) { - // Find the set of versions that are allowed to have prereleases - // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 - // That should allow `1.2.3-pr.2` to pass. - // However, `1.2.4-alpha.notready` should NOT be allowed, - // even though it's within the range set by the comparators. - for (var i = 0; i < set.length; i++) { - debug(set[i].semver); - if (set[i].semver === ANY) - continue; - - if (set[i].semver.prerelease.length > 0) { - var allowed = set[i].semver; - if (allowed.major === version.major && - allowed.minor === version.minor && - allowed.patch === version.patch) - return true; - } - } - - // Version has a -pre, but it's not one of the ones we like. - return false; - } - - return true; -} - -exports.satisfies = satisfies; -function satisfies(version, range, loose) { - try { - range = new Range(range, loose); - } catch (er) { - return false; - } - return range.test(version); -} - -exports.maxSatisfying = maxSatisfying; -function maxSatisfying(versions, range, loose) { - return versions.filter(function(version) { - return satisfies(version, range, loose); - }).sort(function(a, b) { - return rcompare(a, b, loose); - })[0] || null; -} - -exports.validRange = validRange; -function validRange(range, loose) { - try { - // Return '*' instead of '' so that truthiness works. - // This will throw if it's invalid anyway - return new Range(range, loose).range || '*'; - } catch (er) { - return null; - } -} - -// Determine if version is less than all the versions possible in the range -exports.ltr = ltr; -function ltr(version, range, loose) { - return outside(version, range, '<', loose); -} - -// Determine if version is greater than all the versions possible in the range. -exports.gtr = gtr; -function gtr(version, range, loose) { - return outside(version, range, '>', loose); -} - -exports.outside = outside; -function outside(version, range, hilo, loose) { - version = new SemVer(version, loose); - range = new Range(range, loose); - - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case '>': - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = '>'; - ecomp = '>='; - break; - case '<': - gtfn = lt; - ltefn = gte; - ltfn = gt; - comp = '<'; - ecomp = '<='; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - - // If it satisifes the range it is not outside - if (satisfies(version, range, loose)) { - return false; - } - - // From now on, variable terms are as if we're in "gtr" mode. - // but note that everything is flipped for the "ltr" function. - - for (var i = 0; i < range.set.length; ++i) { - var comparators = range.set[i]; - - var high = null; - var low = null; - - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator('>=0.0.0') - } - high = high || comparator; - low = low || comparator; - if (gtfn(comparator.semver, high.semver, loose)) { - high = comparator; - } else if (ltfn(comparator.semver, low.semver, loose)) { - low = comparator; - } - }); - - // If the edge version comparator has a operator then our version - // isn't outside it - if (high.operator === comp || high.operator === ecomp) { - return false; - } - - // If the lowest version comparator has an operator and our version - // is less than it then it isn't higher than the range - if ((!low.operator || low.operator === comp) && - ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; - } - } - return true; -} - -// Use the define() function if we're in AMD land -if (typeof define === 'function' && define.amd) - define(exports); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js b/deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js deleted file mode 100644 index dea027b11b8e2f..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=K;e.SEMVER_SPEC_VERSION="2.0.0";var r=256;var t=Number.MAX_SAFE_INTEGER||9007199254740991;var n=e.re=[];var i=e.src=[];var s=0;var o=s++;i[o]="0|[1-9]\\d*";var a=s++;i[a]="[0-9]+";var f=s++;i[f]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=s++;i[u]="("+i[o]+")\\."+"("+i[o]+")\\."+"("+i[o]+")";var l=s++;i[l]="("+i[a]+")\\."+"("+i[a]+")\\."+"("+i[a]+")";var p=s++;i[p]="(?:"+i[o]+"|"+i[f]+")";var c=s++;i[c]="(?:"+i[a]+"|"+i[f]+")";var h=s++;i[h]="(?:-("+i[p]+"(?:\\."+i[p]+")*))";var v=s++;i[v]="(?:-?("+i[c]+"(?:\\."+i[c]+")*))";var m=s++;i[m]="[0-9A-Za-z-]+";var g=s++;i[g]="(?:\\+("+i[m]+"(?:\\."+i[m]+")*))";var w=s++;var y="v?"+i[u]+i[h]+"?"+i[g]+"?";i[w]="^"+y+"$";var d="[v=\\s]*"+i[l]+i[v]+"?"+i[g]+"?";var j=s++;i[j]="^"+d+"$";var b=s++;i[b]="((?:<|>)?=?)";var E=s++;i[E]=i[a]+"|x|X|\\*";var $=s++;i[$]=i[o]+"|x|X|\\*";var k=s++;i[k]="[v=\\s]*("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:"+i[h]+")?"+i[g]+"?"+")?)?";var R=s++;i[R]="[v=\\s]*("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:"+i[v]+")?"+i[g]+"?"+")?)?";var S=s++;i[S]="^"+i[b]+"\\s*"+i[k]+"$";var x=s++;i[x]="^"+i[b]+"\\s*"+i[R]+"$";var I=s++;i[I]="(?:~>?)";var T=s++;i[T]="(\\s*)"+i[I]+"\\s+";n[T]=new RegExp(i[T],"g");var V="$1~";var A=s++;i[A]="^"+i[I]+i[k]+"$";var C=s++;i[C]="^"+i[I]+i[R]+"$";var M=s++;i[M]="(?:\\^)";var N=s++;i[N]="(\\s*)"+i[M]+"\\s+";n[N]=new RegExp(i[N],"g");var _="$1^";var z=s++;i[z]="^"+i[M]+i[k]+"$";var P=s++;i[P]="^"+i[M]+i[R]+"$";var X=s++;i[X]="^"+i[b]+"\\s*("+d+")$|^$";var Z=s++;i[Z]="^"+i[b]+"\\s*("+y+")$|^$";var q=s++;i[q]="(\\s*)"+i[b]+"\\s*("+d+"|"+i[k]+")";n[q]=new RegExp(i[q],"g");var L="$1$2$3";var F=s++;i[F]="^\\s*("+i[k]+")"+"\\s+-\\s+"+"("+i[k]+")"+"\\s*$";var G=s++;i[G]="^\\s*("+i[R]+")"+"\\s+-\\s+"+"("+i[R]+")"+"\\s*$";var O=s++;i[O]="(<|>)?=?\\s*\\*";for(var B=0;Br)return null;var i=t?n[j]:n[w];if(!i.test(e))return null;try{return new K(e,t)}catch(s){return null}}e.valid=H;function H(e,r){var t=D(e,r);return t?t.version:null}e.clean=J;function J(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=K;function K(e,i){if(e instanceof K){if(e.loose===i)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof K))return new K(e,i);this.loose=i;var s=e.trim().match(i?n[j]:n[w]);if(!s)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+s[1];this.minor=+s[2];this.patch=+s[3];if(this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");if(!s[4])this.prerelease=[];else this.prerelease=s[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r'};K.prototype.toString=function(){return this.version};K.prototype.compare=function(e){if(!(e instanceof K))e=new K(e,this.loose);return this.compareMain(e)||this.comparePre(e)};K.prototype.compareMain=function(e){if(!(e instanceof K))e=new K(e,this.loose);return Y(this.major,e.major)||Y(this.minor,e.minor)||Y(this.patch,e.patch)};K.prototype.comparePre=function(e){if(!(e instanceof K))e=new K(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Y(t,n)}while(++r)};K.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=Q;function Q(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new K(e,t).inc(r,n).version}catch(i){return null}}e.diff=U;function U(e,r){if(pr(e,r)){return null}else{var t=D(e);var n=D(r);if(t.prerelease.length||n.prerelease.length){for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return"pre"+i}}}return"prerelease"}for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return i}}}}}e.compareIdentifiers=Y;var W=/^[0-9]+$/;function Y(e,r){var t=W.test(e);var n=W.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=er;function er(e,r){return Y(r,e)}e.major=rr;function rr(e,r){return new K(e,r).major}e.minor=tr;function tr(e,r){return new K(e,r).minor}e.patch=nr;function nr(e,r){return new K(e,r).patch}e.compare=ir;function ir(e,r,t){return new K(e,t).compare(r)}e.compareLoose=sr;function sr(e,r){return ir(e,r,true)}e.rcompare=or;function or(e,r,t){return ir(r,e,t)}e.sort=ar;function ar(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=fr;function fr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=ur;function ur(e,r,t){return ir(e,r,t)>0}e.lt=lr;function lr(e,r,t){return ir(e,r,t)<0}e.eq=pr;function pr(e,r,t){return ir(e,r,t)===0}e.neq=cr;function cr(e,r,t){return ir(e,r,t)!==0}e.gte=hr;function hr(e,r,t){return ir(e,r,t)>=0}e.lte=vr;function vr(e,r,t){return ir(e,r,t)<=0}e.cmp=mr;function mr(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=pr(e,t,n);break;case"!=":i=cr(e,t,n);break;case">":i=ur(e,t,n);break;case">=":i=hr(e,t,n);break;case"<":i=lr(e,t,n);break;case"<=":i=vr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=gr;function gr(e,r){if(e instanceof gr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof gr))return new gr(e,r);this.loose=r;this.parse(e);if(this.semver===wr)this.value="";else this.value=this.operator+this.semver.version}var wr={};gr.prototype.parse=function(e){var r=this.loose?n[X]:n[Z];var t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=t[1];if(this.operator==="=")this.operator="";if(!t[2])this.semver=wr;else this.semver=new K(t[2],this.loose)};gr.prototype.inspect=function(){return''};gr.prototype.toString=function(){return this.value};gr.prototype.test=function(e){if(this.semver===wr)return true;if(typeof e==="string")e=new K(e,this.loose);return mr(e,this.operator,this.semver,this.loose)};e.Range=yr;function yr(e,r){if(e instanceof yr&&e.loose===r)return e;if(!(this instanceof yr))return new yr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}yr.prototype.inspect=function(){return''};yr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};yr.prototype.toString=function(){return this.range};yr.prototype.parseRange=function(e){var r=this.loose;e=e.trim();var t=r?n[G]:n[F];e=e.replace(t,Tr);e=e.replace(n[q],L);e=e.replace(n[T],V);e=e.replace(n[N],_);e=e.split(/\s+/).join(" ");var i=r?n[X]:n[Z];var s=e.split(" ").map(function(e){return jr(e,r)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new gr(e,r)});return s};e.toComparators=dr;function dr(e,r){return new yr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function jr(e,r){e=kr(e,r);e=Er(e,r);e=Sr(e,r);e=Ir(e,r);return e}function br(e){return!e||e.toLowerCase()==="x"||e==="*"}function Er(e,r){return e.trim().split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,r){var t=r?n[C]:n[A];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function kr(e,r){return e.trim().split(/\s+/).map(function(e){return Rr(e,r)}).join(" ")}function Rr(e,r){var t=r?n[P]:n[z];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function Sr(e,r){return e.split(/\s+/).map(function(e){return xr(e,r)}).join(" ")}function xr(e,r){e=e.trim();var t=r?n[x]:n[S];return e.replace(t,function(e,r,t,n,i,s){var o=br(t);var a=o||br(n);var f=a||br(i);var u=f;if(r==="="&&u)r="";if(o){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(a)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(a){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function Ir(e,r){return e.trim().replace(n[O],"")}function Tr(e,r,t,n,i,s,o,a,f,u,l,p,c){if(br(t))r="";else if(br(n))r=">="+t+".0.0";else if(br(i))r=">="+t+"."+n+".0";else r=">="+r;if(br(f))a="";else if(br(u))a="<"+(+f+1)+".0.0";else if(br(l))a="<"+f+"."+(+u+1)+".0";else if(p)a="<="+f+"."+u+"."+l+"-"+p;else a="<="+a;return(r+" "+a).trim()}yr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new K(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=Ar;function Ar(e,r,t){try{r=new yr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Cr;function Cr(e,r,t){return e.filter(function(e){return Ar(e,r,t)}).sort(function(e,r){return or(e,r,t)})[0]||null}e.validRange=Mr;function Mr(e,r){try{return new yr(e,r).range||"*"}catch(t){return null}}e.ltr=Nr;function Nr(e,r,t){return zr(e,r,"<",t)}e.gtr=_r;function _r(e,r,t){return zr(e,r,">",t)}e.outside=zr;function zr(e,r,t,n){e=new K(e,n);r=new yr(r,n);var i,s,o,a,f;switch(t){case">":i=ur;s=vr;o=lr;a=">";f=">=";break;case"<":i=lr;s=hr;o=ur;a="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ar(e,r,n)){return false}for(var u=0;u=0.0.0")}p=p||e;c=c||e;if(i(e.semver,p.semver,n)){p=e}else if(o(e.semver,c.semver,n)){c=e}});if(p.operator===a||p.operator===f){return false}if((!c.operator||c.operator===a)&&s(e,c.semver)){return false}else if(c.operator===f&&o(e,c.semver)){return false}}return true}if(typeof define==="function"&&define.amd)define(e)})(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={}); \ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js.gz b/deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js.gz deleted file mode 100644 index cbbc16188002f2..00000000000000 Binary files a/deps/npm/node_modules/node-gyp/node_modules/semver/semver.min.js.gz and /dev/null differ diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/amd.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/amd.js deleted file mode 100644 index a6041341b37ee9..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/amd.js +++ /dev/null @@ -1,15 +0,0 @@ -var tap = require('tap'); -var test = tap.test; - -test('amd', function(t) { - global.define = define; - define.amd = true; - var defined = null; - function define(stuff) { - defined = stuff; - } - var fromRequire = require('../'); - t.ok(defined, 'amd function called'); - t.equal(fromRequire, defined, 'amd stuff same as require stuff'); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/big-numbers.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/big-numbers.js deleted file mode 100644 index c051864bc978c2..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/big-numbers.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tap').test -var semver = require('../') - -test('long version is too long', function (t) { - var v = '1.2.' + new Array(256).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('big number is like too long version', function (t) { - var v = '1.2.' + new Array(100).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('parsing null does not throw', function (t) { - t.equal(semver.parse(null), null) - t.equal(semver.parse({}), null) - t.equal(semver.parse(new semver.SemVer('1.2.3')).version, '1.2.3') - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/clean.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/clean.js deleted file mode 100644 index 9e268de950ce8c..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var clean = semver.clean; - -test('\nclean tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', '1.2.3'], - [' 1.2.3 ', '1.2.3'], - [' 1.2.3-4 ', '1.2.3-4'], - [' 1.2.3-pre ', '1.2.3-pre'], - [' =v1.2.3 ', '1.2.3'], - ['v1.2.3', '1.2.3'], - [' v1.2.3 ', '1.2.3'], - ['\t1.2.3', '1.2.3'], - ['>1.2.3', null], - ['~1.2.3', null], - ['<=1.2.3', null], - ['1.2.x', null] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var msg = 'clean(' + range + ') = ' + version; - t.equal(clean(range), version, msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/gtr.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/gtr.js deleted file mode 100644 index bbb87896c64fbb..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/gtr.js +++ /dev/null @@ -1,173 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var gtr = semver.gtr; - -test('\ngtr tests', function(t) { - // [range, version, loose] - // Version should be greater than range - [ - ['~1.2.2', '1.3.0'], - ['~0.6.1-1', '0.7.1-1'], - ['1.0.0 - 2.0.0', '2.0.1'], - ['1.0.0', '1.0.1-beta1'], - ['1.0.0', '2.0.0'], - ['<=2.0.0', '2.1.1'], - ['<=2.0.0', '3.2.9'], - ['<2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '1.2.5'], - ['2.x.x', '3.0.0'], - ['1.2.x', '1.3.0'], - ['1.2.x || 2.x', '3.0.0'], - ['2.*.*', '5.0.1'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '4.0.0'], - ['2', '3.0.0'], - ['2.3', '2.4.2'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.5.5'], - ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.4'], - ['~> 1', '3.2.3'], - ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.1.0'], - ['<1.2', '1.2.0'], - ['< 1.2', '1.2.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-pre', '0.6.0'], - ['~v0.5.4-pre', '0.6.1-pre'], - ['=0.7.x', '0.8.0'], - ['=0.7.x', '0.8.0-asdf'], - ['<0.7.x', '0.7.0'], - ['~1.2.2', '1.3.0'], - ['1.0.0 - 2.0.0', '2.2.3'], - ['1.0.0', '1.0.1'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['2', '3.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['1', '2.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['=0.7.x', '0.8.2'], - ['<0.7.x', '0.7.2'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(gtr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative gtr tests', function(t) { - // [range, version, loose] - // Version should NOT be greater than range - [ - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '0.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['*', 'v1.2.3-foo'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^1', '0.0.0-0'], - ['^3.0.0', '2.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(gtr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/index.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/index.js deleted file mode 100644 index c256c79479c144..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/index.js +++ /dev/null @@ -1,685 +0,0 @@ -'use strict'; - -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var eq = semver.eq; -var gt = semver.gt; -var lt = semver.lt; -var neq = semver.neq; -var cmp = semver.cmp; -var gte = semver.gte; -var lte = semver.lte; -var satisfies = semver.satisfies; -var validRange = semver.validRange; -var inc = semver.inc; -var diff = semver.diff; -var replaceStars = semver.replaceStars; -var toComparators = semver.toComparators; -var SemVer = semver.SemVer; -var Range = semver.Range; - -test('\ncomparison tests', function(t) { - // [version1, version2] - // version1 should be greater than version2 - [['0.0.0', '0.0.0-foo'], - ['0.0.1', '0.0.0'], - ['1.0.0', '0.9.9'], - ['0.10.0', '0.9.0'], - ['0.99.0', '0.10.0'], - ['2.0.0', '1.2.3'], - ['v0.0.0', '0.0.0-foo', true], - ['v0.0.1', '0.0.0', true], - ['v1.0.0', '0.9.9', true], - ['v0.10.0', '0.9.0', true], - ['v0.99.0', '0.10.0', true], - ['v2.0.0', '1.2.3', true], - ['0.0.0', 'v0.0.0-foo', true], - ['0.0.1', 'v0.0.0', true], - ['1.0.0', 'v0.9.9', true], - ['0.10.0', 'v0.9.0', true], - ['0.99.0', 'v0.10.0', true], - ['2.0.0', 'v1.2.3', true], - ['1.2.3', '1.2.3-asdf'], - ['1.2.3', '1.2.3-4'], - ['1.2.3', '1.2.3-4-foo'], - ['1.2.3-5-foo', '1.2.3-5'], - ['1.2.3-5', '1.2.3-4'], - ['1.2.3-5-foo', '1.2.3-5-Foo'], - ['3.0.0', '2.7.2+asdf'], - ['1.2.3-a.10', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a'], - ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'], - ['1.2.3-r2', '1.2.3-r100'], - ['1.2.3-r100', '1.2.3-R2'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); - t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); - t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); - t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); - t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); - t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); - t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); - t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); - }); - t.end(); -}); - -test('\nequality tests', function(t) { - // [version1, version2] - // version1 should be equivalent to version2 - [['1.2.3', 'v1.2.3', true], - ['1.2.3', '=1.2.3', true], - ['1.2.3', 'v 1.2.3', true], - ['1.2.3', '= 1.2.3', true], - ['1.2.3', ' v1.2.3', true], - ['1.2.3', ' =1.2.3', true], - ['1.2.3', ' v 1.2.3', true], - ['1.2.3', ' = 1.2.3', true], - ['1.2.3-0', 'v1.2.3-0', true], - ['1.2.3-0', '=1.2.3-0', true], - ['1.2.3-0', 'v 1.2.3-0', true], - ['1.2.3-0', '= 1.2.3-0', true], - ['1.2.3-0', ' v1.2.3-0', true], - ['1.2.3-0', ' =1.2.3-0', true], - ['1.2.3-0', ' v 1.2.3-0', true], - ['1.2.3-0', ' = 1.2.3-0', true], - ['1.2.3-1', 'v1.2.3-1', true], - ['1.2.3-1', '=1.2.3-1', true], - ['1.2.3-1', 'v 1.2.3-1', true], - ['1.2.3-1', '= 1.2.3-1', true], - ['1.2.3-1', ' v1.2.3-1', true], - ['1.2.3-1', ' =1.2.3-1', true], - ['1.2.3-1', ' v 1.2.3-1', true], - ['1.2.3-1', ' = 1.2.3-1', true], - ['1.2.3-beta', 'v1.2.3-beta', true], - ['1.2.3-beta', '=1.2.3-beta', true], - ['1.2.3-beta', 'v 1.2.3-beta', true], - ['1.2.3-beta', '= 1.2.3-beta', true], - ['1.2.3-beta', ' v1.2.3-beta', true], - ['1.2.3-beta', ' =1.2.3-beta', true], - ['1.2.3-beta', ' v 1.2.3-beta', true], - ['1.2.3-beta', ' = 1.2.3-beta', true], - ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], - ['1.2.3+build', ' = 1.2.3+otherbuild', true], - ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], - ['1.2.3+build', '1.2.3+otherbuild'], - [' v1.2.3+build', '1.2.3+otherbuild'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); - t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); - t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); - t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); - t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); - t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); - t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); - }); - t.end(); -}); - - -test('\nrange tests', function(t) { - // [range, version] - // version should be included by range - [['1.0.0 - 2.0.0', '1.2.3'], - ['^1.2.3+build', '1.2.3'], - ['^1.2.3+build', '1.3.0'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], - ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0'], - ['*', '1.2.3'], - ['*', 'v1.2.3', true], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97', true], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, - ['~ 1.0', '1.0.2'], - ['~ 1.0.3', '1.0.12'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['<=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['~1.2.1 >=1.2.3', '1.2.3'], - ['~1.2.1 =1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], - ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['>=1.2.1 1.2.3', '1.2.3'], - ['1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.1 >=1.2.3', '1.2.3'], - ['>=1.2', '1.2.8'], - ['^1.2.3', '1.8.1'], - ['^0.1.2', '0.1.2'], - ['^0.1', '0.1.2'], - ['^1.2', '1.4.2'], - ['^1.2 ^1', '1.4.2'], - ['^1.2.3-alpha', '1.2.3-pre'], - ['^1.2.0-alpha', '1.2.0-pre'], - ['^0.0.1-alpha', '0.0.1-beta'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); - }); - t.end(); -}); - -test('\nnegative range tests', function(t) { - // [range, version] - // version should not be included by range - [['1.0.0 - 2.0.0', '2.2.3'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], - ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], - ['^1.2.3+build', '2.0.0'], - ['^1.2.3+build', '1.2.0'], - ['^1.2.3', '1.2.3-pre'], - ['^1.2', '1.2.0-pre'], - ['>1.2', '1.3.0-beta'], - ['<=1.2.3', '1.2.3-beta'], - ['^1.2.3', '1.2.3-beta'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['1.0.0', '1.0.1'], - ['>=1.0.0', '0.0.0'], - ['>=1.0.0', '0.0.1'], - ['>=1.0.0', '0.1.0'], - ['>1.0.0', '0.0.1'], - ['>1.0.0', '0.1.0'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['>=0.1.97', 'v0.1.93', true], - ['>=0.1.97', '0.1.93'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['>=0.2.3 || <0.0.1', '0.0.3'], - ['>=0.2.3 || <0.0.1', '0.2.2'], - ['2.x.x', '1.1.3'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.9'], - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['>=1.2', '1.1.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-beta', '0.5.4-alpha'], - ['=0.7.x', '0.8.2'], - ['>=0.7.x', '0.6.2'], - ['<0.7.x', '0.7.2'], - ['<1.2.3', '1.2.3-beta'], - ['=1.2.3', '1.2.3-beta'], - ['>1.2', '1.2.8'], - ['^1.2.3', '2.0.0-alpha'], - ['^1.2.3', '1.2.2'], - ['^1.2', '1.1.9'], - ['*', 'v1.2.3-foo', true], - // invalid ranges never satisfied! - ['blerg', '1.2.3'], - ['git+https://user:password0123@github.com/foo', '123.0.0', true], - ['^1.2.3', '2.0.0-pre'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - var found = satisfies(ver, range, loose); - t.ok(!found, ver + ' not satisfied by ' + range); - }); - t.end(); -}); - -test('\nincrement versions test', function(t) { -// [version, inc, result, identifier] -// inc(version, inc) -> result - [['1.2.3', 'major', '2.0.0'], - ['1.2.3', 'minor', '1.3.0'], - ['1.2.3', 'patch', '1.2.4'], - ['1.2.3tag', 'major', '2.0.0', true], - ['1.2.3-tag', 'major', '2.0.0'], - ['1.2.3', 'fake', null], - ['1.2.0-0', 'patch', '1.2.0'], - ['fake', 'major', null], - ['1.2.3-4', 'major', '2.0.0'], - ['1.2.3-4', 'minor', '1.3.0'], - ['1.2.3-4', 'patch', '1.2.3'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], - ['1.2.4', 'prerelease', '1.2.5-0'], - ['1.2.3-0', 'prerelease', '1.2.3-1'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], - ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], - ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], - ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], - ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], - ['1.2.0', 'prepatch', '1.2.1-0'], - ['1.2.0-1', 'prepatch', '1.2.1-0'], - ['1.2.0', 'preminor', '1.3.0-0'], - ['1.2.3-1', 'preminor', '1.3.0-0'], - ['1.2.0', 'premajor', '2.0.0-0'], - ['1.2.3-1', 'premajor', '2.0.0-0'], - ['1.2.0-1', 'minor', '1.2.0'], - ['1.0.0-1', 'major', '1.0.0'], - - ['1.2.3', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'minor', '1.3.0', false, 'dev'], - ['1.2.3', 'patch', '1.2.4', false, 'dev'], - ['1.2.3tag', 'major', '2.0.0', true, 'dev'], - ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'fake', null, false, 'dev'], - ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], - ['fake', 'major', null, false, 'dev'], - ['1.2.3-4', 'major', '2.0.0', false, 'dev'], - ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], - ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], - ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], - ['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'], - ['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'], - ['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'], - ['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'], - ['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'], - ['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'], - ['1.2.0-1', 'minor', '1.2.0', 'dev'], - ['1.0.0-1', 'major', '1.0.0', 'dev'], - ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] - - ].forEach(function(v) { - var pre = v[0]; - var what = v[1]; - var wanted = v[2]; - var loose = v[3]; - var id = v[4]; - var found = inc(pre, what, loose, id); - var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - }); - - t.end(); -}); - -test('\ndiff versions test', function(t) { -// [version1, version2, result] -// diff(version1, version2) -> result - [['1.2.3', '0.2.3', 'major'], - ['1.4.5', '0.2.3', 'major'], - ['1.2.3', '2.0.0-pre', 'premajor'], - ['1.2.3', '1.3.3', 'minor'], - ['1.0.1', '1.1.0-pre', 'preminor'], - ['1.2.3', '1.2.4', 'patch'], - ['1.2.3', '1.2.4-pre', 'prepatch'], - ['0.0.1', '0.0.1-pre', 'prerelease'], - ['0.0.1', '0.0.1-pre-2', 'prerelease'], - ['1.1.0', '1.1.0-pre', 'prerelease'], - ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], - ['1.0.0', '1.0.0', null] - - ].forEach(function(v) { - var version1 = v[0]; - var version2 = v[1]; - var wanted = v[2]; - var found = diff(version1, version2); - var cmd = 'diff(' + version1 + ', ' + version2 + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - }); - - t.end(); -}); - -test('\nvalid range test', function(t) { - // [range, result] - // validRange(range) -> result - // translate ranges into their canonical form - [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], - ['1.0.0', '1.0.0'], - ['>=*', '*'], - ['', '*'], - ['*', '*'], - ['*', '*'], - ['>=1.0.0', '>=1.0.0'], - ['>1.0.0', '>1.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['1', '>=1.0.0 <2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<2.0.0', '<2.0.0'], - ['<2.0.0', '<2.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['>=0.1.97', '>=0.1.97'], - ['>=0.1.97', '>=0.1.97'], - ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['||', '||'], - ['2.x.x', '>=2.0.0 <3.0.0'], - ['1.2.x', '>=1.2.0 <1.3.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['x', '*'], - ['2.*.*', '>=2.0.0 <3.0.0'], - ['1.2.*', '>=1.2.0 <1.3.0'], - ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['*', '*'], - ['2', '>=2.0.0 <3.0.0'], - ['2.3', '>=2.3.0 <2.4.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~>3.2.1', '>=3.2.1 <3.3.0'], - ['~1', '>=1.0.0 <2.0.0'], - ['~>1', '>=1.0.0 <2.0.0'], - ['~> 1', '>=1.0.0 <2.0.0'], - ['~1.0', '>=1.0.0 <1.1.0'], - ['~ 1.0', '>=1.0.0 <1.1.0'], - ['^0', '>=0.0.0 <1.0.0'], - ['^ 1', '>=1.0.0 <2.0.0'], - ['^0.1', '>=0.1.0 <0.2.0'], - ['^1.0', '>=1.0.0 <2.0.0'], - ['^1.2', '>=1.2.0 <2.0.0'], - ['^0.0.1', '>=0.0.1 <0.0.2'], - ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], - ['^0.1.2', '>=0.1.2 <0.2.0'], - ['^1.2.3', '>=1.2.3 <2.0.0'], - ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], - ['<1', '<1.0.0'], - ['< 1', '<1.0.0'], - ['>=1', '>=1.0.0'], - ['>= 1', '>=1.0.0'], - ['<1.2', '<1.2.0'], - ['< 1.2', '<1.2.0'], - ['1', '>=1.0.0 <2.0.0'], - ['>01.02.03', '>1.2.3', true], - ['>01.02.03', null], - ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], - ['~1.2.3beta', null], - ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var loose = v[2]; - var found = validRange(pre, loose); - - t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); - }); - - t.end(); -}); - -test('\ncomparators test', function(t) { - // [range, comparators] - // turn range into a set of individual comparators - [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], - ['1.0.0', [['1.0.0']]], - ['>=*', [['']]], - ['', [['']]], - ['*', [['']]], - ['*', [['']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['< 2.0.0', [['<2.0.0']]], - ['<\t2.0.0', [['<2.0.0']]], - ['>=0.1.97', [['>=0.1.97']]], - ['>=0.1.97', [['>=0.1.97']]], - ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['||', [[''], ['']]], - ['2.x.x', [['>=2.0.0', '<3.0.0']]], - ['1.2.x', [['>=1.2.0', '<1.3.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['x', [['']]], - ['2.*.*', [['>=2.0.0', '<3.0.0']]], - ['1.2.*', [['>=1.2.0', '<1.3.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['*', [['']]], - ['2', [['>=2.0.0', '<3.0.0']]], - ['2.3', [['>=2.3.0', '<2.4.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], - ['~1', [['>=1.0.0', '<2.0.0']]], - ['~>1', [['>=1.0.0', '<2.0.0']]], - ['~> 1', [['>=1.0.0', '<2.0.0']]], - ['~1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['<1', [['<1.0.0']]], - ['< 1', [['<1.0.0']]], - ['>=1', [['>=1.0.0']]], - ['>= 1', [['>=1.0.0']]], - ['<1.2', [['<1.2.0']]], - ['< 1.2', [['<1.2.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], - ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], - ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], - ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], - ['>*', [['<0.0.0']]], - ['<*', [['<0.0.0']]] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var found = toComparators(v[0]); - var jw = JSON.stringify(wanted); - t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); - }); - - t.end(); -}); - -test('\ninvalid version numbers', function(t) { - ['1.2.3.4', - 'NOT VALID', - 1.2, - null, - 'Infinity.NaN.Infinity' - ].forEach(function(v) { - t.throws(function() { - new SemVer(v); - }, {name:'TypeError', message:'Invalid Version: ' + v}); - }); - - t.end(); -}); - -test('\nstrict vs loose version numbers', function(t) { - [['=1.2.3', '1.2.3'], - ['01.02.03', '1.2.3'], - ['1.2.3-beta.01', '1.2.3-beta.1'], - [' =1.2.3', '1.2.3'], - ['1.2.3foo', '1.2.3-foo'] - ].forEach(function(v) { - var loose = v[0]; - var strict = v[1]; - t.throws(function() { - new SemVer(loose); - }); - var lv = new SemVer(loose, true); - t.equal(lv.version, strict); - t.ok(eq(loose, strict, true)); - t.throws(function() { - eq(loose, strict); - }); - t.throws(function() { - new SemVer(strict).compare(loose); - }); - }); - t.end(); -}); - -test('\nstrict vs loose ranges', function(t) { - [['>=01.02.03', '>=1.2.3'], - ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] - ].forEach(function(v) { - var loose = v[0]; - var comps = v[1]; - t.throws(function() { - new Range(loose); - }); - t.equal(new Range(loose, true).range, comps); - }); - t.end(); -}); - -test('\nmax satisfying', function(t) { - [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], - [['1.2.4', '1.2.3'], '1.2', '1.2.4'], - [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], - [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] - ].forEach(function(v) { - var versions = v[0]; - var range = v[1]; - var expect = v[2]; - var loose = v[3]; - var actual = semver.maxSatisfying(versions, range, loose); - t.equal(actual, expect); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/ltr.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/ltr.js deleted file mode 100644 index 0f7167d6589258..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/ltr.js +++ /dev/null @@ -1,181 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var ltr = semver.ltr; - -test('\nltr tests', function(t) { - // [range, version, loose] - // Version should be less than range - [ - ['~1.2.2', '1.2.1'], - ['~0.6.1-1', '0.6.1-0'], - ['1.0.0 - 2.0.0', '0.0.1'], - ['1.0.0-beta.2', '1.0.0-beta.1'], - ['1.0.0', '0.0.0'], - ['>=2.0.0', '1.1.1'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '0.1.5'], - ['2.x.x', '1.0.0'], - ['1.2.x', '1.1.0'], - ['1.2.x || 2.x', '1.0.0'], - ['2.*.*', '1.0.1'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.9999'], - ['2', '1.0.0'], - ['2.3', '2.2.2'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.5'], - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.4'], - ['~> 1', '0.2.3'], - ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '0.1.0'], - ['>1.2', '1.2.0'], - ['> 1.2', '1.2.1'], - ['1', '0.0.0beta', true], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['=0.7.x', '0.6.0'], - ['=0.7.x', '0.6.0-asdf'], - ['>=0.7.x', '0.6.0'], - ['~1.2.2', '1.2.1'], - ['1.0.0 - 2.0.0', '0.2.3'], - ['1.0.0', '0.0.1'], - ['>=2.0.0', '1.0.0'], - ['>=2.0.0', '1.9999.9999'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['>2.0.0', '1.2.9'], - ['2.x.x', '1.1.3'], - ['1.2.x', '1.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.9999.9999'], - ['2.3', '2.2.1'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.3'], - ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0 - ['>1', '1.0.0'], - ['2', '1.0.0beta', true], - ['>1', '1.0.0beta', true], - ['> 1', '1.0.0beta', true], - ['=0.7.x', '0.6.2'], - ['=0.7.x', '0.7.0-asdf'], - ['^1', '1.0.0-0'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['>=0.7.x', '0.6.2'], - ['>1.2.3', '1.3.0-alpha'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(ltr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative ltr tests', function(t) { - // [range, version, loose] - // Version should NOT be less than range - [ - ['~ 1.0', '1.1.0'], - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '2.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^3.0.0', '4.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], - ['^1.0.0alpha', '1.0.0beta', true], - ['~1.0.0alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0beta', true], - ['~1.0.0-alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0-beta'], - ['~1.0.0-alpha', '1.0.0-beta'], - ['=0.1.0', '1.0.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(ltr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/major-minor-patch.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/major-minor-patch.js deleted file mode 100644 index e9d4039c8be629..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/major-minor-patch.js +++ /dev/null @@ -1,72 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); - -test('\nmajor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', 1], - [' 1.2.3 ', 1], - [' 2.2.3-4 ', 2], - [' 3.2.3-pre ', 3], - ['v5.2.3', 5], - [' v8.2.3 ', 8], - ['\t13.2.3', 13], - ['=21.2.3', 21, true], - ['v=34.2.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'major(' + range + ') = ' + version; - t.equal(semver.major(range, loose), version, msg); - }); - t.end(); -}); - -test('\nminor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.1.3', 1], - [' 1.1.3 ', 1], - [' 1.2.3-4 ', 2], - [' 1.3.3-pre ', 3], - ['v1.5.3', 5], - [' v1.8.3 ', 8], - ['\t1.13.3', 13], - ['=1.21.3', 21, true], - ['v=1.34.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'minor(' + range + ') = ' + version; - t.equal(semver.minor(range, loose), version, msg); - }); - t.end(); -}); - -test('\npatch tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.1', 1], - [' 1.2.1 ', 1], - [' 1.2.2-4 ', 2], - [' 1.2.3-pre ', 3], - ['v1.2.5', 5], - [' v1.2.8 ', 8], - ['\t1.2.13', 13], - ['=1.2.21', 21, true], - ['v=1.2.34', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'patch(' + range + ') = ' + version; - t.equal(semver.patch(range, loose), version, msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/semver/test/no-module.js b/deps/npm/node_modules/node-gyp/node_modules/semver/test/no-module.js deleted file mode 100644 index 274f63d1bbc823..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/semver/test/no-module.js +++ /dev/null @@ -1,18 +0,0 @@ -var tap = require('tap'); -var test = tap.test; - -test('no module system', function(t) { - var fs = require('fs'); - var vm = require('vm'); - var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); - var src = fs.readFileSync(require.resolve('../'), 'utf8'); - var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); - vm.runInThisContext(head + src + foot, 'semver.js'); - - // just some basic poking to see if it did some stuff - t.type(global.semver, 'object'); - t.type(global.semver.SemVer, 'function'); - t.type(global.semver.Range, 'function'); - t.ok(global.semver.satisfies('1.2.3', '1.2')); - t.end(); -}); 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 5aa78aec301062..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/tar/package.json +++ /dev/null @@ -1,60 +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" -} 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 2191b9c55dabc7..2c285300a89fe3 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -11,7 +11,7 @@ "bindings", "gyp" ], - "version": "2.0.2", + "version": "3.3.0", "installVersion": 9, "author": { "name": "Nathan Rajlich", @@ -20,7 +20,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/TooTallNate/node-gyp.git" + "url": "git://github.com/nodejs/node-gyp.git" }, "preferGlobal": true, "bin": { @@ -30,36 +30,41 @@ "dependencies": { "fstream": "^1.0.0", "glob": "3 || 4", - "graceful-fs": "3", + "graceful-fs": "^4.1.2", "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", - "tar": "^1.0.0", + "semver": "2.x || 3.x || 4 || 5", + "tar": "^2.0.0", "which": "1" }, "engines": { "node": ">= 0.8.0" }, - "gitHead": "f403e263b87f6a8ad130add248c90565d49427f7", + "devDependencies": { + "tape": "~4.2.0" + }, + "scripts": { + "test": "tape test/test-*" + }, + "gitHead": "7b10467b57dc632d358917decbeea94fd1172282", "bugs": { - "url": "https://github.com/TooTallNate/node-gyp/issues" + "url": "https://github.com/nodejs/node-gyp/issues" }, - "homepage": "https://github.com/TooTallNate/node-gyp#readme", - "_id": "node-gyp@2.0.2", - "scripts": {}, - "_shasum": "6350760aaba74ba108fdc368afd8864e14b6ad91", - "_from": "node-gyp@latest", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.6", + "homepage": "https://github.com/nodejs/node-gyp", + "_id": "node-gyp@3.3.0", + "_shasum": "7cc676b72d0be31dc977fb3c93539cab7adeff1e", + "_from": "node-gyp@3.3.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.3.0", "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" + "name": "rvagg", + "email": "rod@vagg.org" }, "maintainers": [ { @@ -67,18 +72,34 @@ "email": "nathan@tootallnate.net" }, { - "name": "tootallnate", - "email": "nathan@tootallnate.net" + "name": "bnoordhuis", + "email": "info@bnoordhuis.nl" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" }, { "name": "isaacs", "email": "i@izs.me" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" } ], "dist": { - "shasum": "6350760aaba74ba108fdc368afd8864e14b6ad91", - "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-2.0.2.tgz" + "shasum": "7cc676b72d0be31dc977fb3c93539cab7adeff1e", + "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-3.3.0.tgz" + }, + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/node-gyp-3.3.0.tgz_1455598883163_0.7978834484238178" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-2.0.2.tgz" + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.3.0.tgz" } 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 new file mode 100755 index 00000000000000..ac21aa8d75c989 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/docker.sh @@ -0,0 +1,164 @@ +#!/bin/bash + +#set -e + +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/ + +# borrows from https://github.com/rvagg/dnt/ + +# Simple setup function for a container: +# setup_container(image id, base image, commands to run to set up) +setup_container() { + local container_id="$1" + local base_container="$2" + local run_cmd="$3" + + # Does this image exist? If yes, ignore + docker inspect "$container_id" &> /dev/null + if [[ $? -eq 0 ]]; then + echo "Found existing container [$container_id]" + else + # No such image, so make it + echo "Did not find container [$container_id], creating..." + docker run -i $base_container /bin/bash -c "$run_cmd" + sleep 2 + docker commit $(docker ps -l -q) $container_id + fi +} + +# Run tests inside each of the versioned containers, copy cwd into npm's copy of node-gyp +# so it'll be invoked by npm when a compile is needed +# run_tests(version, test-commands) +run_tests() { + local version="$1" + local run_cmd="$2" + + run_cmd="rsync -aAXx --delete --exclude .git --exclude build /node-gyp-src/ /usr/lib/node_modules/npm/node_modules/node-gyp/; + /bin/su -s /bin/bash node-gyp -c 'cd && ${run_cmd}'" + + rm -rf $dot_node_gyp + mkdir $dot_node_gyp + + docker run \ + --rm -i \ + -v ~/.npm/:/node-gyp/.npm/ \ + -v ${dot_node_gyp}:/node-gyp/.node-gyp/ \ + -v $(pwd):/node-gyp-src/:ro \ + node-gyp-test/${version} /bin/bash -c "${run_cmd}" +} + +# 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 +" + +# An image on top of the base containing clones of repos we want to use for testing +setup_container "node-gyp-test/clones" "node-gyp-test/base" " + cd /node-gyp/ && git clone https://github.com/justmoon/node-bignum.git && + cd /node-gyp/ && git clone https://github.com/bnoordhuis/node-buffertools.git && + chown -R node-gyp.node-gyp /node-gyp/ +" + +# An image for each of the node versions we want to test with that version installed and the latest npm +for v in $test_node_versions; do + setup_container "node-gyp-test/${v}" "node-gyp-test/clones" " + curl -sL https://nodejs.org/dist/v${v}/node-v${v}-linux-x64.tar.gz | tar -zxv --strip-components=1 -C /usr/ && + npm install npm@latest -g && + node -v && npm -v + " +done + +# An image for each of the io.js versions we want to test with that version installed and the latest npm +for v in $test_iojs_versions; do + setup_container "node-gyp-test/${v}" "node-gyp-test/clones" " + curl -sL https://iojs.org/dist/v${v}/iojs-v${v}-linux-x64.tar.gz | tar -zxv --strip-components=1 -C /usr/ && + npm install npm@latest -g && + node -v && npm -v + " +done + +# Run the tests for all of the test images we've created, +# we should see node-gyp doing its download, configure and run thing +# _NOTE: bignum doesn't compile on 0.8 currently so it'll fail for that version only_ +for v in $test_node_versions $test_iojs_versions; do + run_tests $v " + cd node-buffertools && npm install --loglevel=info && npm test && cd + " + # removed for now, too noisy: cd node-bignum && npm install --loglevel=info && npm test +done + +# Test use of --target=x.y.z to compile against alternate versions +test_download_node_version() { + local run_with_ver="$1" + local expected_dir="$2" + local expected_ver="$3" + run_tests $run_with_ver "cd node-buffertools && npm install --loglevel=info --target=${expected_ver}" + local node_ver=$(cat "${dot_node_gyp}${expected_dir}/node_version.h" | grep '#define NODE_\w*_VERSION [0-9]*$') + node_ver=$(echo $node_ver | sed 's/#define NODE_[A-Z]*_VERSION //g' | sed 's/ /./g') + if [ "X$(echo $node_ver)" != "X${expected_ver}" ]; then + echo "Did not download v${expected_ver} using --target, instead got: $(echo $node_ver)" + exit 1 + fi + echo "Verified correct download of [v${node_ver}]" +} + +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.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 + +# testing --dist-url, using simple-proxy.js to make localhost work as a distribution +# point for tarballs +# we can test whether it uses the proxy because after 2 connections the proxy will +# die and therefore should not be running at the end of the test, `nc` can tell us this +run_tests "3.3.0" " + (node /node-gyp-src/test/simple-proxy.js 8080 /foobar/ https://iojs.org/dist/ &) && + cd node-buffertools && + /node-gyp-src/bin/node-gyp.js --loglevel=info --dist-url=http://localhost:8080/foobar/ rebuild && + 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 && + NVM_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\" +" + +# 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 && + NVM_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\" +" + +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/simple-proxy.js b/deps/npm/node_modules/node-gyp/test/simple-proxy.js new file mode 100644 index 00000000000000..e55330c445bf6e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/simple-proxy.js @@ -0,0 +1,24 @@ +var http = require('http') + , https = require('https') + , server = http.createServer(handler) + , port = +process.argv[2] + , prefix = process.argv[3] + , upstream = process.argv[4] + , calls = 0 + +server.listen(port) + +function handler (req, res) { + if (req.url.indexOf(prefix) != 0) + throw new Error('request url [' + req.url + '] does not start with [' + prefix + ']') + + var upstreamUrl = upstream + req.url.substring(prefix.length) + console.log(req.url + ' -> ' + upstreamUrl) + https.get(upstreamUrl, function (ures) { + ures.on('end', function () { + if (++calls == 2) + server.close() + }) + ures.pipe(res) + }) +} 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 new file mode 100644 index 00000000000000..48411ae0a7d5a9 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-process-release.js @@ -0,0 +1,637 @@ +var test = require('tape') +var processRelease = require('../lib/process-release') + +test('test process release - process.version = 0.8.20', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.8.20', null) + + t.equal(release.semver.version, '0.8.20') + delete release.semver + + t.deepEqual(release, { + version: '0.8.20', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.8.20/', + tarballUrl: 'https://nodejs.org/dist/v0.8.20/node-v0.8.20.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.8.20/SHASUMS256.txt', + versionDir: '0.8.20', + libUrl32: 'https://nodejs.org/dist/v0.8.20/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.8.20/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +test('test process release - process.version = 0.10.21', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v0.10.21', null) + + t.equal(release.semver.version, '0.10.21') + delete release.semver + + t.deepEqual(release, { + version: '0.10.21', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.21/', + tarballUrl: 'https://nodejs.org/dist/v0.10.21/node-v0.10.21.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.21/SHASUMS256.txt', + versionDir: '0.10.21', + libUrl32: 'https://nodejs.org/dist/v0.10.21/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.21/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +// 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.9', null) + + t.equal(release.semver.version, '0.12.9') + delete release.semver + + t.deepEqual(release, { + version: '0.12.9', + name: 'node', + 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' + }) +}) + +test('test process release - process.release ~ node@4.1.23', function (t) { + t.plan(2) + + 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: 'https://nodejs.org/dist/v4.1.23/', + tarballUrl: 'https://nodejs.org/dist/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'https://nodejs.org/dist/v4.1.23/win-x86/node.lib', + libUrl64: 'https://nodejs.org/dist/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 / corp build', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'node', + headersUrl: 'https://some.custom.location/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: 'https://some.custom.location/', + tarballUrl: 'https://some.custom.location/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://some.custom.location/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'https://some.custom.location/win-x86/node.lib', + libUrl64: 'https://some.custom.location/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + +test('test process release - process.version = 1.8.4', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v1.8.4', null) + + t.equal(release.semver.version, '1.8.4') + delete release.semver + + t.deepEqual(release, { + version: '1.8.4', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v1.8.4/', + tarballUrl: 'https://iojs.org/download/release/v1.8.4/iojs-v1.8.4.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v1.8.4/SHASUMS256.txt', + versionDir: 'iojs-1.8.4', + libUrl32: 'https://iojs.org/download/release/v1.8.4/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v1.8.4/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.2.24', function (t) { + t.plan(2) + + 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: 'https://iojs.org/download/release/v3.2.24/', + tarballUrl: 'https://iojs.org/download/release/v3.2.24/iojs-v3.2.24-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.24/SHASUMS256.txt', + versionDir: 'iojs-3.2.24', + libUrl32: 'https://iojs.org/download/release/v3.2.24/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.24/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.2.11 +libUrl32', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v3.2.11', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.11/iojs-v3.2.11-headers.tar.gz', + libUrl: 'https://iojs.org/download/release/v3.2.11/win-x86/iojs.lib' // custom + }) + + t.equal(release.semver.version, '3.2.11') + delete release.semver + + t.deepEqual(release, { + version: '3.2.11', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v3.2.11/', + tarballUrl: 'https://iojs.org/download/release/v3.2.11/iojs-v3.2.11-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.11/SHASUMS256.txt', + versionDir: 'iojs-3.2.11', + libUrl32: 'https://iojs.org/download/release/v3.2.11/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.11/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.2.101 +libUrl64', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v3.2.101', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + libUrl: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib' // custom + }) + + t.equal(release.semver.version, '3.2.101') + delete release.semver + + t.deepEqual(release, { + version: '3.2.101', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v3.2.101/', + tarballUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.101/SHASUMS256.txt', + versionDir: 'iojs-3.2.101', + libUrl32: 'https://iojs.org/download/release/v3.2.101/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ iojs@3.3.0 - borked win-ia32', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v3.2.101', { + name: 'io.js', + headersUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + libUrl: 'https://iojs.org/download/release/v3.2.101/win-ia32/iojs.lib' // custom + }) + + t.equal(release.semver.version, '3.2.101') + delete release.semver + + t.deepEqual(release, { + version: '3.2.101', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v3.2.101/', + tarballUrl: 'https://iojs.org/download/release/v3.2.101/iojs-v3.2.101-headers.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v3.2.101/SHASUMS256.txt', + versionDir: 'iojs-3.2.101', + libUrl32: 'https://iojs.org/download/release/v3.2.101/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v3.2.101/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 --target=0.10.40', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { target: '0.10.40' } }, '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, '0.10.40') + delete release.semver + + t.deepEqual(release, { + version: '0.10.40', + name: 'node', + baseUrl: 'https://nodejs.org/dist/v0.10.40/', + tarballUrl: 'https://nodejs.org/dist/v0.10.40/node-v0.10.40.tar.gz', + shasumsUrl: 'https://nodejs.org/dist/v0.10.40/SHASUMS256.txt', + versionDir: '0.10.40', + libUrl32: 'https://nodejs.org/dist/v0.10.40/node.lib', + libUrl64: 'https://nodejs.org/dist/v0.10.40/x64/node.lib', + libPath32: 'node.lib', + libPath64: 'x64/node.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 --target=1.8.4', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { target: '1.8.4' } }, '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, '1.8.4') + delete release.semver + + t.deepEqual(release, { + version: '1.8.4', + name: 'iojs', + baseUrl: 'https://iojs.org/download/release/v1.8.4/', + tarballUrl: 'https://iojs.org/download/release/v1.8.4/iojs-v1.8.4.tar.gz', + shasumsUrl: 'https://iojs.org/download/release/v1.8.4/SHASUMS256.txt', + versionDir: 'iojs-1.8.4', + libUrl32: 'https://iojs.org/download/release/v1.8.4/win-x86/iojs.lib', + libUrl64: 'https://iojs.org/download/release/v1.8.4/win-x64/iojs.lib', + libPath32: 'win-x86/iojs.lib', + libPath64: 'win-x64/iojs.lib' + }) +}) + +test('test process release - process.release ~ node@4.1.23 --dist-url=https://foo.bar/baz', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { 'dist-url': 'https://foo.bar/baz' } }, '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: 'https://foo.bar/baz/v4.1.23/', + tarballUrl: 'https://foo.bar/baz/v4.1.23/node-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://foo.bar/baz/v4.1.23/SHASUMS256.txt', + versionDir: '4.1.23', + libUrl32: 'https://foo.bar/baz/v4.1.23/win-x86/node.lib', + libUrl64: 'https://foo.bar/baz/v4.1.23/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + +test('test process release - process.release ~ frankenstein@4.1.23', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v4.1.23', { + name: 'frankenstein', + headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-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: 'frankenstein', + baseUrl: 'https://frankensteinjs.org/dist/v4.1.23/', + tarballUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', + shasumsUrl: 'https://frankensteinjs.org/dist/v4.1.23/SHASUMS256.txt', + versionDir: 'frankenstein-4.1.23', + libUrl32: 'https://frankensteinjs.org/dist/v4.1.23/win-x86/frankenstein.lib', + libUrl64: 'https://frankensteinjs.org/dist/v4.1.23/win-x64/frankenstein.lib', + libPath32: 'win-x86/frankenstein.lib', + libPath64: 'win-x64/frankenstein.lib' + }) +}) + + +test('test process release - process.release ~ frankenstein@4.1.23 --dist-url=http://foo.bar/baz/', function (t) { + t.plan(2) + + var release = processRelease([], { opts: { 'dist-url': 'http://foo.bar/baz/' } }, 'v4.1.23', { + name: 'frankenstein', + headersUrl: 'https://frankensteinjs.org/dist/v4.1.23/frankenstein-v4.1.23.tar.gz' + }) + + t.equal(release.semver.version, '4.1.23') + delete release.semver + + t.deepEqual(release, { + version: '4.1.23', + name: 'frankenstein', + baseUrl: 'http://foo.bar/baz/v4.1.23/', + tarballUrl: 'http://foo.bar/baz/v4.1.23/frankenstein-v4.1.23-headers.tar.gz', + shasumsUrl: 'http://foo.bar/baz/v4.1.23/SHASUMS256.txt', + versionDir: 'frankenstein-4.1.23', + libUrl32: 'http://foo.bar/baz/v4.1.23/win-x86/frankenstein.lib', + libUrl64: 'http://foo.bar/baz/v4.1.23/win-x64/frankenstein.lib', + libPath32: 'win-x86/frankenstein.lib', + libPath64: 'win-x64/frankenstein.lib' + }) +}) + +test('test process release - process.release ~ node@4.0.0-rc.4', function (t) { + t.plan(2) + + var release = processRelease([], { opts: {} }, 'v4.0.0-rc.4', { + name: 'node', + headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.0.0-rc.4') + delete release.semver + + t.deepEqual(release, { + version: '4.0.0-rc.4', + name: 'node', + baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', + tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', + versionDir: '4.0.0-rc.4', + libUrl32: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', + libUrl64: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + + +test('test process release - process.release ~ node@4.0.0-rc.4 passed as argv[0]', function (t) { + t.plan(2) + + // note the missing 'v' on the arg, it should normalise when checking + // whether we're on the default or not + var release = processRelease([ '4.0.0-rc.4' ], { opts: {} }, 'v4.0.0-rc.4', { + name: 'node', + headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.0.0-rc.4') + delete release.semver + + t.deepEqual(release, { + version: '4.0.0-rc.4', + name: 'node', + baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', + tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', + versionDir: '4.0.0-rc.4', + libUrl32: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', + libUrl64: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + libPath64: 'win-x64/node.lib' + }) +}) + + +test('test process release - process.release ~ node@4.0.0-rc.4 - bogus string passed as argv[0]', function (t) { + t.plan(2) + + // additional arguments can be passed in on the commandline that should be ignored if they + // are not specifying a valid version @ position 0 + var release = processRelease([ 'this is no version!' ], { opts: {} }, 'v4.0.0-rc.4', { + name: 'node', + headersUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz' + }) + + t.equal(release.semver.version, '4.0.0-rc.4') + delete release.semver + + t.deepEqual(release, { + version: '4.0.0-rc.4', + name: 'node', + baseUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/', + tarballUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/node-v4.0.0-rc.4-headers.tar.gz', + shasumsUrl: 'https://nodejs.org/download/rc/v4.0.0-rc.4/SHASUMS256.txt', + versionDir: '4.0.0-rc.4', + libUrl32: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x86/node.lib', + libUrl64: 'https://nodejs.org/download/rc/v4.0.0-rc.4/win-x64/node.lib', + libPath32: 'win-x86/node.lib', + 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/README.md b/deps/npm/node_modules/nopt/README.md index 22c50ec406ebe2..f21a4b31c5d482 100644 --- a/deps/npm/node_modules/nopt/README.md +++ b/deps/npm/node_modules/nopt/README.md @@ -29,7 +29,8 @@ nice option parser. , "bloo" : [ "big", "medium", "small" ] , "flag" : Boolean , "pick" : Boolean - , "many" : [String, Array] + , "many1" : [String, Array] + , "many2" : [path] } , shortHands = { "foofoo" : ["--foo", "Mr. Foo"] , "b7" : ["--bar", "7"] @@ -78,11 +79,11 @@ $ node my-program.js --baz b/a/z # known paths are resolved. # values, and will always be an array. The other types provided # specify what types are allowed in the list. -$ node my-program.js --many 1 --many null --many foo -{ many: ["1", "null", "foo"] } +$ node my-program.js --many1 5 --many1 null --many1 foo +{ many1: ["5", "null", "foo"] } -$ node my-program.js --many foo -{ many: ["foo"] } +$ node my-program.js --many2 foo --many2 bar +{ many2: ["/path/to/foo", "path/to/bar"] } ``` Read the tests at the bottom of `lib/nopt.js` for more examples of @@ -138,8 +139,8 @@ config object and remove its invalid properties. ## Error Handling -By default, nopt outputs a warning to standard error when invalid -options are found. You can change this behavior by assigning a method +By default, nopt outputs a warning to standard error when invalid values for +known options are found. You can change this behavior by assigning a method to `nopt.invalidHandler`. This method will be called with the offending `nopt.invalidHandler(key, val, types)`. 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 c44afa1a269526..f9ff8d88261032 100644 --- a/deps/npm/node_modules/nopt/package.json +++ b/deps/npm/node_modules/nopt/package.json @@ -1,6 +1,6 @@ { "name": "nopt", - "version": "3.0.3", + "version": "3.0.6", "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", "author": { "name": "Isaac Z. Schlueter", @@ -13,7 +13,7 @@ }, "repository": { "type": "git", - "url": "git+ssh://git@github.com/isaacs/nopt.git" + "url": "git+https://github.com/npm/nopt.git" }, "bin": { "nopt": "./bin/nopt.js" @@ -25,30 +25,14 @@ "devDependencies": { "tap": "^1.2.0" }, - "gitHead": "f64a64cd48d9f2660dd4e59191ff46a26397d6b1", + "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": "10a750c9bb99c1950160353459e733ac2aa18cb6", "bugs": { - "url": "https://github.com/isaacs/nopt/issues" + "url": "https://github.com/npm/nopt/issues" }, - "homepage": "https://github.com/isaacs/nopt#readme", - "_id": "nopt@3.0.3", - "_shasum": "0e9978f33016bae0b75e3748c03bbbb71da5c530", - "_from": "nopt@>=3.0.3 <3.1.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "0e9978f33016bae0b75e3748c03bbbb71da5c530", - "tarball": "http://registry.npmjs.org/nopt/-/nopt-3.0.3.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.3.tgz" + "homepage": "https://github.com/npm/nopt#readme", + "_id": "nopt@3.0.6", + "_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9", + "_from": "nopt@>=3.0.6 <3.1.0" } 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-package-data/README.md b/deps/npm/node_modules/normalize-package-data/README.md index da4d9f6519b6fd..526745ef6923f9 100644 --- a/deps/npm/node_modules/normalize-package-data/README.md +++ b/deps/npm/node_modules/normalize-package-data/README.md @@ -72,7 +72,7 @@ If the supplied data has an invalid name or version vield, `normalizeData` will * 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. * 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`. * If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`. -* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to https://github.com/[owner-name]/[repo-name] +* 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 * If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value. * 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. * 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. @@ -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/core_module_names.json b/deps/npm/node_modules/normalize-package-data/lib/core_module_names.json deleted file mode 100644 index 637c2f07341cd6..00000000000000 --- a/deps/npm/node_modules/normalize-package-data/lib/core_module_names.json +++ /dev/null @@ -1,29 +0,0 @@ -[ -"http", -"events", -"util", -"domain", -"cluster", -"buffer", -"stream", -"crypto", -"tls", -"fs", -"string_decoder", -"path", -"net", -"dgram", -"dns", -"https", -"url", -"punycode", -"readline", -"repl", -"vm", -"child_process", -"assert", -"zlib", -"tty", -"os", -"querystring" -] 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 c96f0bcc4f1484..1409c69c9dd43e 100644 --- a/deps/npm/node_modules/normalize-package-data/lib/fixer.js +++ b/deps/npm/node_modules/normalize-package-data/lib/fixer.js @@ -1,11 +1,11 @@ var semver = require("semver") var validateLicense = require('validate-npm-package-license'); var hostedGitInfo = require("hosted-git-info") +var isBuiltinModule = require("is-builtin-module") var depTypes = ["dependencies","devDependencies","optionalDependencies"] var extractDescription = require("./extract_description") var url = require("url") var typos = require("./typos") -var coreModuleNames = require("./core_module_names") var fixer = module.exports = { // default warning function @@ -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 } } @@ -208,7 +213,7 @@ var fixer = module.exports = { if (!strict) data.name = data.name.trim() ensureValidName(data.name, strict, options.allowLegacyCase) - if (coreModuleNames.indexOf(data.name) !== -1) + if (isBuiltinModule(data.name)) this.warn("conflictingName", data.name) } diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/index.js b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/index.js new file mode 100644 index 00000000000000..b6cfa616ae85cf --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/index.js @@ -0,0 +1,10 @@ +'use strict'; +var builtinModules = require('builtin-modules'); + +module.exports = function (str) { + if (typeof str !== 'string') { + throw new TypeError('Expected a string'); + } + + return builtinModules.indexOf(str) !== -1; +}; 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/normalize-package-data/node_modules/is-builtin-module/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/normalize-package-data/node_modules/is-builtin-module/license diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/builtin-modules.json b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/builtin-modules.json new file mode 100644 index 00000000000000..72670f6bf5cf54 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/builtin-modules.json @@ -0,0 +1,35 @@ +[ + "assert", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "dns", + "domain", + "events", + "fs", + "http", + "https", + "module", + "net", + "os", + "path", + "process", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "string_decoder", + "timers", + "tls", + "tty", + "url", + "util", + "v8", + "vm", + "zlib" +] 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 new file mode 100644 index 00000000000000..df3474a10f3f12 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var blacklist = [ + 'freelist', + 'sys' +]; + +module.exports = Object.keys(process.binding('natives')).filter(function (el) { + return !/^_|^internal/.test(el) && blacklist.indexOf(el) === -1; +}).sort(); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/license similarity index 100% rename from deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/license rename to deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/license 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 new file mode 100644 index 00000000000000..453d1632197a53 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json @@ -0,0 +1,70 @@ +{ + "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" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "xo && ava", + "make": "node make.js" + }, + "files": [ + "index.js", + "static.js", + "builtin-modules.json" + ], + "keywords": [ + "builtin", + "built-in", + "builtins", + "node", + "modules", + "core", + "bundled", + "list", + "array", + "names" + ], + "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" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/readme.md b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/readme.md new file mode 100644 index 00000000000000..f1894b1896530b --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/readme.md @@ -0,0 +1,41 @@ +# builtin-modules [![Build Status](https://travis-ci.org/sindresorhus/builtin-modules.svg?branch=master)](https://travis-ci.org/sindresorhus/builtin-modules) + +> List of the Node.js builtin modules + +The list is just a [JSON file](builtin-modules.json) and can be used wherever. + + +## Install + +``` +$ npm install --save builtin-modules +``` + + +## Usage + +```js +var builtinModules = require('builtin-modules'); + +console.log(builinModules); +//=> ['assert', 'buffer', ...] +``` + + +## API + +Returns an array of builtin modules fetched from the running Node.js version. + +### Static list + +This module also comes bundled with a static array of builtin modules generated from the latest Node.js version. You can get it with `require('builtin-modules/static');` + + +## Related + +- [is-builtin-module](https://github.com/sindresorhus/is-builtin-module) - Check if a string matches the name of a Node.js builtin module + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/static.js b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/static.js new file mode 100644 index 00000000000000..9508f8f4ec4212 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/static.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./builtin-modules.json'); 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 new file mode 100644 index 00000000000000..3e0bf21f85c0c7 --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json @@ -0,0 +1,73 @@ +{ + "name": "is-builtin-module", + "version": "1.0.0", + "description": "Check if a string matches the name of a Node.js builtin module", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-builtin-module.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "builtin", + "built-in", + "builtins", + "node", + "modules", + "core", + "bundled", + "list", + "array", + "names", + "is", + "detect", + "check", + "match" + ], + "dependencies": { + "builtin-modules": "^1.0.0" + }, + "devDependencies": { + "ava": "0.0.4" + }, + "gitHead": "da55ebf031f3864c5d309e25e49ed816957d70a2", + "bugs": { + "url": "https://github.com/sindresorhus/is-builtin-module/issues" + }, + "homepage": "https://github.com/sindresorhus/is-builtin-module", + "_id": "is-builtin-module@1.0.0", + "_shasum": "540572d34f7ac3119f8f76c30cbc1b1e037affbe", + "_from": "is-builtin-module@>=1.0.0 <2.0.0", + "_npmVersion": "2.7.4", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "dist": { + "shasum": "540572d34f7ac3119f8f76c30cbc1b1e037affbe", + "tarball": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "directories": {}, + "_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/node_modules/is-builtin-module/readme.md b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/readme.md new file mode 100644 index 00000000000000..798dcf4371799b --- /dev/null +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/readme.md @@ -0,0 +1,33 @@ +# is-builtin-module [![Build Status](https://travis-ci.org/sindresorhus/is-builtin-module.svg?branch=master)](https://travis-ci.org/sindresorhus/is-builtin-module) + +> Check if a string matches the name of a Node.js builtin module + + +## Install + +``` +$ npm install --save is-builtin-module +``` + + +## Usage + +```js +var isBuiltinModule = require('is-builtin-module'); + +isBuiltinModule('fs'); +//=> true + +isBuiltinModule('unicorn'); +//=> false :( +``` + + +## Related + +- [builtin-modules](https://github.com/sindresorhus/builtin-modules) - List of the Node.js builtin modules + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json index 0ea7c5418084cf..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.1", + "version": "2.3.5", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -16,14 +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": "^2.0.0" + "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": [ { @@ -39,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 https://github.com/[owner-name]/[repo-name]\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": "43b844bd37aac28d204be7567b731d9c55025871", + "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.1", - "_shasum": "e2d24a5ab38a90b22cd697753407d8564f49a890", - "_from": "normalize-package-data@>=2.3.1 <2.4.0" + "_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-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index 3e7203c6fa549d..9ebfc027bfd877 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,10 +1,10 @@ { "name": "npm-install-checks", - "version": "1.0.6", + "version": "1.0.7", "description": "checks that npm runs during the installation of a module", "main": "index.js", "dependencies": { - "npmlog": "0.1 || 1", + "npmlog": "0.1 || 1 || 2", "semver": "^2.3.0 || 3.x || 4 || 5" }, "devDependencies": { @@ -32,10 +32,46 @@ "bugs": { "url": "https://github.com/npm/npm-install-checks/issues" }, - "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" + "gitHead": "4882a47d954ceeec567db87219bbc31f64af191e", + "_id": "npm-install-checks@1.0.7", + "_shasum": "6d91aeda0ac96801f1ed7aadee116a6c0a086a57", + "_from": "npm-install-checks@1.0.7", + "_npmVersion": "2.14.19", + "_nodeVersion": "4.2.4", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "6d91aeda0ac96801f1ed7aadee116a6c0a086a57", + "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.7.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/npm-install-checks-1.0.7.tgz_1455329001145_0.8577833492308855" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.7.tgz" } 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..2a57f73bc4ed9a 100644 --- a/deps/npm/node_modules/npm-package-arg/package.json +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -1,6 +1,6 @@ { "name": "npm-package-arg", - "version": "4.0.2", + "version": "4.1.0", "description": "Parse the things that can be arguments to `npm install`", "main": "npa.js", "directories": { @@ -30,10 +30,33 @@ "url": "https://github.com/npm/npm-package-arg/issues" }, "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" + "gitHead": "383b4783a076b825815be51eb1ab2e4bb8a1e1fc", + "_id": "npm-package-arg@4.1.0", + "_shasum": "2e015f8ac00737cb97f997c9cbf059f42a74527d", + "_from": "npm-package-arg@>=4.1.0 <4.2.0", + "_npmVersion": "3.4.0", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "2e015f8ac00737cb97f997c9cbf059f42a74527d", + "tarball": "http://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-4.1.0.tgz" } 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/.travis.yml b/deps/npm/node_modules/npm-registry-client/.travis.yml index 686d9aecaf6450..3669bc76e06c05 100644 --- a/deps/npm/node_modules/npm-registry-client/.travis.yml +++ b/deps/npm/node_modules/npm-registry-client/.travis.yml @@ -2,9 +2,11 @@ language: node_js node_js: - "0.12" - "0.10" + - "0.8" - iojs -before_install: - - "npm install -g npm@^2" script: "npm test" +sudo: false +before_install: + - "npm install -g npm@latest" notifications: slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 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 b671f6b5f219c1..ff01e95e282d83 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/access.js +++ b/deps/npm/node_modules/npm-registry-client/lib/access.js @@ -1,30 +1,153 @@ module.exports = access var assert = require('assert') +var url = require('url') +var npa = require('npm-package-arg') +var subcommands = {} -function access (uri, params, cb) { - assert(typeof uri === 'string', 'must pass registry URI to access') - assert(params && typeof params === 'object', 'must pass params to access') - assert(typeof cb === 'function', 'muss pass callback to access') - - assert(typeof params.level === 'string', 'must pass level to access') - assert( - ['public', 'restricted'].indexOf(params.level) !== -1, - "access level must be either 'public' or 'restricted'" - ) - assert( - params.auth && typeof params.auth === 'object', - 'must pass auth to access' - ) - - var body = { - access: params.level - } +function access (sub, uri, params, cb) { + accessAssertions(sub, uri, params, cb) + return subcommands[sub].call(this, uri, params, cb) +} + +subcommands.public = function (uri, params, cb) { + return setAccess.call(this, 'public', uri, params, cb) +} +subcommands.restricted = function (uri, params, cb) { + return setAccess.call(this, 'restricted', uri, params, cb) +} - var options = { +function setAccess (access, uri, params, cb) { + return this.request(apiUri(uri, 'package', params.package, 'access'), { method: 'POST', - body: JSON.stringify(body), + auth: params.auth, + body: JSON.stringify({ access: access }) + }, cb) +} + +subcommands.grant = function (uri, params, cb) { + var reqUri = apiUri(uri, 'team', params.scope, params.team, 'package') + return this.request(reqUri, { + method: 'PUT', + auth: params.auth, + body: JSON.stringify({ + permissions: params.permissions, + package: params.package + }) + }, cb) +} + +subcommands.revoke = function (uri, params, cb) { + var reqUri = apiUri(uri, 'team', params.scope, params.team, 'package') + return this.request(reqUri, { + method: 'DELETE', + auth: params.auth, + body: JSON.stringify({ + package: params.package + }) + }, cb) +} + +subcommands['ls-packages'] = function (uri, params, cb, type) { + type = type || (params.team ? 'team' : 'org') + var client = this + var uriParams = '?format=cli' + var reqUri = apiUri(uri, type, params.scope, params.team, 'package') + return client.request(reqUri + uriParams, { + method: 'GET', + auth: params.auth + }, function (err, perms) { + if (err && err.statusCode === 404 && type === 'org') { + subcommands['ls-packages'].call(client, uri, params, cb, 'user') + } else { + cb(err, perms && translatePermissions(perms)) + } + }) +} + +subcommands['ls-collaborators'] = function (uri, params, cb) { + var uriParams = '?format=cli' + if (params.user) { + uriParams += ('&user=' + encodeURIComponent(params.user)) + } + var reqUri = apiUri(uri, 'package', params.package, 'collaborators') + return this.request(reqUri + uriParams, { + method: 'GET', auth: params.auth + }, function (err, perms) { + cb(err, perms && translatePermissions(perms)) + }) +} + +subcommands.edit = function () { + throw new Error('edit subcommand is not implemented yet') +} + +function apiUri (registryUri) { + var path = Array.prototype.slice.call(arguments, 1) + .filter(function (x) { return x }) + .map(encodeURIComponent) + .join('/') + return url.resolve(registryUri, '-/' + path) +} + +function accessAssertions (subcommand, uri, params, cb) { + assert(subcommands.hasOwnProperty(subcommand), + 'access subcommand must be one of ' + + Object.keys(subcommands).join(', ')) + typeChecks({ + 'uri': [uri, 'string'], + 'params': [params, 'object'], + 'auth': [params.auth, 'object'], + 'callback': [cb, 'function'] + }) + if (contains([ + 'public', 'restricted' + ], subcommand)) { + 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'] }) + } + if (contains(['grant', 'revoke'], subcommand)) { + typeChecks({ 'team': [params.team, 'string'] }) + } + if (subcommand === 'grant') { + typeChecks({ 'permissions': [params.permissions, 'string'] }) + assert(params.permissions === 'read-only' || + params.permissions === 'read-write', + 'permissions must be either read-only or read-write') + } +} + +function typeChecks (specs) { + Object.keys(specs).forEach(function (key) { + var checks = specs[key] + assert(typeof checks[0] === checks[1], + key + ' is required and must be of type ' + checks[1]) + }) +} + +function contains (arr, item) { + return arr.indexOf(item) !== -1 +} + +function translatePermissions (perms) { + var newPerms = {} + for (var key in perms) { + if (perms.hasOwnProperty(key)) { + if (perms[key] === 'read') { + newPerms[key] = 'read-only' + } else if (perms[key] === 'write') { + newPerms[key] = 'read-write' + } else { + // This shouldn't happen, but let's not break things + // if the API starts returning different things. + newPerms[key] = perms[key] + } + } } - this.request(uri, options, cb) + return newPerms } diff --git a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js index 04d311cc0c8bf2..5ff3a8891f5e2d 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js @@ -1,7 +1,6 @@ module.exports = deprecate var assert = require('assert') -var url = require('url') var semver = require('semver') function deprecate (uri, params, cb) { @@ -38,6 +37,6 @@ function deprecate (uri, params, cb) { body: data, auth: auth } - this.request(url.resolve(uri, data._id), options, cb) + this.request(uri, options, cb) }.bind(this)) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 168a9d160af215..567fc8dbe42b16 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -9,6 +9,7 @@ var assert = require('assert') var url = require('url') var zlib = require('zlib') var Stream = require('stream').Stream +var STATUS_CODES = require('http').STATUS_CODES var request = require('request') var once = require('once') @@ -63,6 +64,13 @@ function regRequest (uri, params, cb_) { var self = this this.attempt(function (operation) { makeRequest.call(self, uri, params, function (er, parsed, raw, response) { + if (response) { + self.log.verbose('headers', response.headers) + if (response.headers['npm-notice']) { + self.log.warn('notice', response.headers['npm-notice']) + } + } + if (!er || (er.message && er.message.match(/^SSL Error/))) { if (er) er.code = 'ESSL' return cb(er, parsed, raw, response) @@ -78,12 +86,6 @@ function regRequest (uri, params, cb_) { self.log.info('retry', 'will retry, error on last attempt: ' + er) return undefined } - if (response) { - self.log.verbose('headers', response.headers) - if (response.headers['npm-notice']) { - self.log.warn('notice', response.headers['npm-notice']) - } - } cb.apply(null, arguments) }) }) @@ -208,8 +210,9 @@ function requestDone (method, where, cb) { // expect data with any error codes if (!data && response.statusCode >= 400) { + var code = response.statusCode return cb( - response.statusCode + ' ' + require('http').STATUS_CODES[response.statusCode], + makeError(code + ' ' + STATUS_CODES[code], null, code), null, data, response @@ -236,22 +239,33 @@ function requestDone (method, where, cb) { } if (!parsed.error) { - er = new Error( + er = makeError( 'Registry returned ' + response.statusCode + ' for ' + method + - ' on ' + where + ' on ' + where, + name, + response.statusCode ) } else if (name && parsed.error === 'not_found') { - er = new Error('404 Not Found: ' + name) + er = makeError('404 Not Found: ' + name, name, response.statusCode) } else { - er = new Error( - parsed.error + ' ' + (parsed.reason || '') + ': ' + (name || w) + er = makeError( + parsed.error + ' ' + (parsed.reason || '') + ': ' + (name || w), + name, + response.statusCode ) } - if (name) er.pkgid = name - er.statusCode = response.statusCode - er.code = 'E' + er.statusCode } return cb(er, parsed, data, response) }.bind(this) } + +function makeError (message, name, code) { + var er = new Error(message) + if (name) er.pkgid = name + if (code) { + er.statusCode = code + er.code = 'E' + code + } + return er +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/team.js b/deps/npm/node_modules/npm-registry-client/lib/team.js new file mode 100644 index 00000000000000..3e3794e0477688 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/team.js @@ -0,0 +1,105 @@ +module.exports = team + +var assert = require('assert') +var url = require('url') + +var subcommands = {} + +function team (sub, uri, params, cb) { + teamAssertions(sub, uri, params, cb) + return subcommands[sub].call(this, uri, params, cb) +} + +subcommands.create = function (uri, params, cb) { + return this.request(apiUri(uri, 'org', params.scope, 'team'), { + method: 'PUT', + auth: params.auth, + body: JSON.stringify({ + name: params.team + }) + }, cb) +} + +subcommands.destroy = function (uri, params, cb) { + return this.request(apiUri(uri, 'team', params.scope, params.team), { + method: 'DELETE', + auth: params.auth + }, cb) +} + +subcommands.add = function (uri, params, cb) { + return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { + method: 'PUT', + auth: params.auth, + body: JSON.stringify({ + user: params.user + }) + }, cb) +} + +subcommands.rm = function (uri, params, cb) { + return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { + method: 'DELETE', + auth: params.auth, + body: JSON.stringify({ + user: params.user + }) + }, cb) +} + +subcommands.ls = function (uri, params, cb) { + var uriParams = '?format=cli' + if (params.team) { + var reqUri = apiUri( + uri, 'team', params.scope, params.team, 'user') + uriParams + return this.request(reqUri, { + method: 'GET', + auth: params.auth + }, cb) + } else { + return this.request(apiUri(uri, 'org', params.scope, 'team') + uriParams, { + method: 'GET', + auth: params.auth + }, cb) + } +} + +// TODO - we punted this to v2 +// subcommands.edit = function (uri, params, cb) { +// return this.request(apiUri(uri, 'team', params.scope, params.team, 'user'), { +// method: 'POST', +// auth: params.auth, +// body: JSON.stringify({ +// users: params.users +// }) +// }, cb) +// } + +function apiUri (registryUri) { + var path = Array.prototype.slice.call(arguments, 1) + .map(encodeURIComponent) + .join('/') + return url.resolve(registryUri, '-/' + path) +} + +function teamAssertions (subcommand, uri, params, cb) { + assert(subcommand, 'subcommand is required') + assert(subcommands.hasOwnProperty(subcommand), + 'team subcommand must be one of ' + Object.keys(subcommands)) + assert(typeof uri === 'string', 'registry URI is required') + assert(typeof params === 'object', 'params are required') + assert(typeof params.auth === 'object', 'auth is required') + assert(typeof params.scope === 'string', 'scope is required') + assert(!cb || typeof cb === 'function', 'callback must be a function') + if (subcommand !== 'ls') { + assert(typeof params.team === 'string', 'team name is required') + } + if (subcommand === 'rm' || subcommand === 'add') { + assert(typeof params.user === 'string', 'user is required') + } + if (subcommand === 'edit') { + assert(typeof params.users === 'object' && + params.users.length != null, + 'users is required') + } +} 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 index a2870dfb162343..cfe1c9439388b6 100644 --- 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 @@ -1,6 +1,7 @@ sudo: false language: node_js before_install: + - npm install -g npm@2 - npm install -g npm notifications: email: false @@ -14,23 +15,33 @@ matrix: env: TASK=test - node_js: '0.12' env: TASK=test - - node_js: 'iojs' + - node_js: 1 env: TASK=test - - node_js: 'iojs' + - 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: node + env: TASK=test + - node_js: node env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" - - node_js: 'iojs' + - node_js: node 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' + - node_js: node + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="41..beta" + - node_js: node + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="36..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="['6.1', '7.1', '8.2']" + - node_js: node + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="['6.1', '7.1', '8.2']" + - node_js: node env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" - - node_js: 'iojs' + - node_js: node env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" script: "npm run $TASK" env: 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 index a2270c88057950..bf544f9f2565f3 100644 --- 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 @@ -3,8 +3,8 @@ 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 +Node.js. For example a [request to an HTTP +server](https://iojs.org/dist/v5.0.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][] @@ -47,8 +47,8 @@ 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: +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: ```javascript var http = require('http'); @@ -136,9 +136,9 @@ 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) +* [http responses, on the client](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage) +* [http requests, on the server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage) +* [fs read streams](https://iojs.org/dist/v5.0.0/doc/api/fs.html#fs_class_fs_readstream) * [zlib streams][] * [crypto streams][] * [tcp sockets][] @@ -164,6 +164,34 @@ readable.on('readable', function() { 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, `.read()` will return that data. In the latter case, +`.read()` will return null. For instance, in the following example, `foo.txt` +is an empty file: + +```javascript +var fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', function() { + console.log('readable:', rr.read()); +}); +rr.on('end', function() { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +bash-3.2$ node test.js +readable: null +end +``` + #### Event: 'data' * `chunk` {Buffer | String} The chunk of data. @@ -202,8 +230,11 @@ readable.on('end', function() { #### Event: 'close' -Emitted when the underlying resource (for example, the backing file -descriptor) has been closed. Not all streams will emit this. +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: 'error' @@ -221,7 +252,9 @@ 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`. +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. @@ -243,6 +276,9 @@ readable.on('readable', function() { If this method returns a data chunk, then it will also trigger the emission of a [`'data'` event][]. +Note that calling `readable.read([size])` after the `end` event has been +triggered will return `null`. No runtime error will be raised. + #### readable.setEncoding(encoding) * `encoding` {String} The encoding to use. @@ -414,6 +450,9 @@ 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, below.) @@ -452,6 +491,13 @@ function parseHeader(stream, callback) { } } ``` +Note that, unlike `stream.push(chunk)`, `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 `_read` implementation on a custom stream). Following +the call to `unshift` with an immediate `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) @@ -461,13 +507,13 @@ 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 +If you are using an older Node.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. +as a convenience for interacting with old Node.js programs and libraries. For example: @@ -492,13 +538,13 @@ 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) +* [http requests, on the client](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_class_http_clientrequest) +* [http responses, on the server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_class_http_serverresponse) +* [fs write streams](https://iojs.org/dist/v5.0.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) +* [child process stdin](https://iojs.org/dist/v5.0.0/doc/api/child_process.html#child_process_child_stdin) * [process.stdout][], [process.stderr][] #### writable.write(chunk[, encoding][, callback]) @@ -527,7 +573,7 @@ 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. +// 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; @@ -883,6 +929,10 @@ SimpleProtocol.prototype._read = function(n) { // 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); @@ -922,24 +972,22 @@ initialized. * `size` {Number} Number of bytes to read asynchronously -Note: **Implement this function, but do NOT call it directly.** +Note: **Implement this method, 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. +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. -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, `_read` should +start pushing that data into the read queue by calling `this.push(dataChunk)`. +`_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. -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. +Note: once the `_read()` method is called, it will not be called again until +the `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 @@ -955,19 +1003,16 @@ becomes available. There is no need, for example to "wait" until 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 +Note: **This method 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. +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 `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). +The data added with `push` can be pulled out by calling the `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 @@ -1173,19 +1218,19 @@ 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 +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: ```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 @@ -1235,7 +1280,7 @@ 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 +would be piped into the parser, which is a more idiomatic Node.js stream approach. ```javascript @@ -1395,8 +1440,8 @@ var transform = new stream.Transform({ Both Writable and Readable streams will buffer data on an internal -object called `_writableState.buffer` or `_readableState.buffer`, -respectively. +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. @@ -1424,8 +1469,8 @@ 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 +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('')` @@ -1442,7 +1487,7 @@ 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 +[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. @@ -1462,7 +1507,7 @@ simpler, but also less powerful and less useful. 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. +In 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 @@ -1492,7 +1537,7 @@ net.createServer(function(socket) { ``` 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, +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 `resume()` method to @@ -1539,7 +1584,7 @@ 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 +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 @@ -1605,24 +1650,24 @@ JSONParseStream.prototype._flush = function(cb) { ``` -[EventEmitter]: https://iojs.org/dist/v2.3.0/doc/api/events.html#events_class_events_eventemitter +[EventEmitter]: https://iojs.org/dist/v5.0.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 +[tcp sockets]: https://iojs.org/dist/v5.0.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 +[tls.CryptoStream]: https://iojs.org/dist/v5.0.0/doc/api/tls.html#tls_class_cryptostream +[process.stdin]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdin +[stdout]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdout +[process.stdout]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdout +[process.stderr]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stderr +[child process stdout and stderr]: https://iojs.org/dist/v5.0.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 @@ -1641,7 +1686,7 @@ JSONParseStream.prototype._flush = function(cb) { [`_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 +[`util.inherits`]: https://iojs.org/dist/v5.0.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 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 index eef3d825d7a084..90068ea249d998 100644 --- 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 @@ -18,10 +18,10 @@ 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; }; /**/ @@ -48,9 +48,10 @@ util.inherits = require('inherits'); /**/ -var debug = require('util'); -if (debug && debug.debuglog) { - debug = debug.debuglog('stream'); +var debugUtil = require('util'); +var debug; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); } else { debug = function () {}; } @@ -219,7 +220,6 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) { } - // 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, @@ -243,15 +243,19 @@ Readable.prototype.setEncoding = function(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; @@ -280,7 +284,7 @@ function howMuchToRead(n, state) { // power of 2, to prevent increasing it excessively in tiny // amounts. if (n > state.highWaterMark) - state.highWaterMark = roundUpToNextPowerOf2(n); + state.highWaterMark = computeNewHighWaterMark(n); // don't have that much. return null, unless we've ended. if (n > state.length) { @@ -546,6 +550,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 @@ -558,6 +563,8 @@ 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. @@ -573,9 +580,16 @@ 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(); } } @@ -586,7 +600,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); - if (EE.listenerCount(dest, 'error') === 0) + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); } // This is a brutally ugly hack to make sure that our error handler @@ -599,7 +613,6 @@ Readable.prototype.pipe = function(dest, pipeOpts) { dest._events.error = [onerror, dest._events.error]; - // Both close and finish should trigger unpipe, but only once. function onclose() { dest.removeListener('finish', onfinish); @@ -636,7 +649,7 @@ function pipeOnDrain(src) { debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { state.flowing = true; flow(src); } @@ -852,7 +865,6 @@ Readable.prototype.wrap = function(stream) { }; - // exposed for testing purposes only. Readable._fromList = fromList; @@ -877,6 +889,8 @@ function fromList(n, state) { // 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; 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 index b232952016a9c1..23a2ba295df2f1 100644 --- 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 @@ -1,5 +1,5 @@ // 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'; @@ -24,6 +24,13 @@ util.inherits = require('inherits'); /**/ +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + + /**/ var Stream; @@ -149,10 +156,10 @@ WritableState.prototype.getBuffer = function writableStateGetBuffer() { (function (){try { Object.defineProperty(WritableState.prototype, 'buffer', { - get: require('util-deprecate')(function() { + get: internalUtil.deprecate(function() { return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use ' + - '_writableState.getBuffer() instead.') + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + + 'instead.') }); }catch(_){}}()); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000000000..d8d7f9437dbf5a --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/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 index 9074e8ebcb61e9..ff4c851c075a2f 100644 --- 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 @@ -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/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 index b67333380c265e..83e519e7b464a5 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "core-util-is", - "version": "1.0.1", + "version": "1.0.2", "description": "The `util.is*` functions introduced in Node v0.12.", "main": "lib/util.js", "repository": { @@ -27,11 +27,17 @@ "bugs": { "url": "https://github.com/isaacs/core-util-is/issues" }, + "scripts": { + "test": "tap test.js" + }, + "devDependencies": { + "tap": "^2.3.0" + }, "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#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", + "_id": "core-util-is@1.0.2", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "_from": "core-util-is@>=1.0.0 <1.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/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/npm-registry-client/node_modules/concat-stream/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/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 index fb1eb3786d8168..19228ab6fdcaaf 100644 --- 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 @@ -26,13 +26,28 @@ "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" - }, "_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", - "_from": "isarray@0.0.1" + "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 index 5ac98855343cee..36201b10017a5e 100644 --- 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 @@ -4,4 +4,9 @@ node_js: - "0.10" - "0.11" - "0.12" - - "iojs" + - "1.7.1" + - 1 + - 2 + - 3 + - 4 + - 5 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 index 3eb2f33d0cee43..571c276783c779 100644 --- 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 @@ -1,10 +1,17 @@ 'use strict'; -module.exports = nextTick; + +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 < arguments.length) { + while (i < args.length) { args[i++] = arguments[i]; } process.nextTick(function afterTick() { 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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md new file mode 100644 index 00000000000000..c67e3532b54245 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# 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/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 index 9be9ed5b5cf375..4019a28addcd88 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "process-nextick-args", - "version": "1.0.2", + "version": "1.0.6", "description": "process.nextTick but always with args", "main": "index.js", "scripts": { @@ -19,19 +19,19 @@ "devDependencies": { "tap": "~0.2.6" }, - "gitHead": "295707643b4ed6667c1afb71ffb6101669b5dac2", - "_id": "process-nextick-args@1.0.2", - "_shasum": "8b4d3fc586668bd5b6573e732edf2b71c1c1d8aa", + "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78", + "_id": "process-nextick-args@1.0.6", + "_shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.1", "_npmUser": { "name": "cwmma", "email": "calvin.metcalf@gmail.com" }, "dist": { - "shasum": "8b4d3fc586668bd5b6573e732edf2b71c1c1d8aa", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.2.tgz" + "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", + "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" }, "maintainers": [ { @@ -40,6 +40,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.2.tgz", + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.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/process-nextick-args/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js index 729f775ff5094c..ef15721584ac99 100644 --- 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/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js @@ -15,3 +15,10 @@ test('should work', function (t) { 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/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 index ec010299b1b259..acc8675372e980 100644 --- 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 @@ -1,4 +1,9 @@ +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + 1.0.1 / 2014-11-25 ================== 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 index 55fa5a4bc6056a..549ae2f065ea5a 100644 --- 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 @@ -55,7 +55,12 @@ function deprecate (fn, msg) { */ function config (name) { - if (!global.localStorage) return false; + // 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/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json index ea487da0e43000..f68d8bb958657f 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "util-deprecate", - "version": "1.0.1", + "version": "1.0.2", "description": "The Node.js `util.deprecate()` function with browser support", "main": "node.js", "browser": "browser.js", @@ -28,26 +28,10 @@ "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!" + "readme": "util-deprecate\n==============\n### The Node.js `util.deprecate()` function with browser support\n\nIn Node.js, this module simply re-exports the `util.deprecate()` function.\n\nIn the web browser (i.e. via browserify), a browser-specific implementation\nof the `util.deprecate()` function is used.\n\n\n## API\n\nA `deprecate()` function is the only thing exposed by this module.\n\n``` javascript\n// setup:\nexports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');\n\n\n// users see:\nfoo();\n// foo() is deprecated, use bar() instead\nfoo();\nfoo();\n```\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 Nathan Rajlich \n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "_id": "util-deprecate@1.0.2", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "_from": "util-deprecate@>=1.0.1 <1.1.0" } 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 index 70ad998cae2d45..c0698efcb36108 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "readable-stream", - "version": "2.0.2", + "version": "2.0.4", "description": "Streams3, a user-land copy of the stream library from iojs v2.x", "main": "readable.js", "dependencies": { @@ -18,7 +18,8 @@ }, "scripts": { "test": "tap test/parallel/*.js", - "browser": "zuul --browser-name $BROWSER_NAME --browser-version $BROWSER_VERSION -- test/browser.js" + "browser": "npm run write-zuul && zuul -- test/browser.js", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" }, "repository": { "type": "git", @@ -33,43 +34,14 @@ "util": false }, "license": "MIT", - "gitHead": "1a70134a71196eeabb5e27bc7580faaa68d30513", + "readme": "# readable-stream\n\n***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core, including [documentation](doc/stream.markdown).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode 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).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning. \n\n# Streams WG Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>\n - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>\n - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>\n - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>\n", + "readmeFilename": "README.md", "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!" + "_id": "readable-stream@2.0.4", + "_shasum": "2523ef27ffa339d7ba9da8603f2d0599d06edbd8", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz", + "_from": "readable-stream@>=2.0.0 <2.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json index b8b59f5c303991..f946a953af73c6 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json @@ -52,28 +52,13 @@ "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", - "dist": { - "shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", - "tarball": "http://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" - }, - "_from": "typedarray@>=0.0.5 <0.1.0", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "readme": "ERROR: No README data found!" + "_from": "typedarray@>=0.0.5 <0.1.0" } 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..53820bc0b2ce94 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,11 @@ "android-browser/4.2..latest" ] }, - "gitHead": "7cb37c8ddc0fd2ea03c104d07d44d84b83a31185", + "readme": "# concat-stream\n\nWritable 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.\n\n[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream)\n\n[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/)\n\n### description\n\nStreams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you.\n\nOnly use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM).\n\nThere are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details.\n\n## Related\n\n`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.\n\n### examples\n\n#### Buffers\n\n```js\nvar fs = require('fs')\nvar concat = require('concat-stream')\n\nvar readStream = fs.createReadStream('cat.png')\nvar concatStream = concat(gotPicture)\n\nreadStream.on('error', handleError)\nreadStream.pipe(concatStream)\n\nfunction gotPicture(imageBuffer) {\n // imageBuffer is all of `cat.png` as a node.js Buffer\n}\n\nfunction handleError(err) {\n // handle your error appropriately here, e.g.:\n console.error(err) // print the error to STDERR\n process.exit(1) // exit program with non-zero exit code\n}\n\n```\n\n#### Arrays\n\n```js\nvar write = concat(function(data) {})\nwrite.write([1,2,3])\nwrite.write([4,5,6])\nwrite.end()\n// data will be [1,2,3,4,5,6] in the above callback\n```\n\n#### Uint8Arrays\n\n```js\nvar write = concat(function(data) {})\nvar a = new Uint8Array(3)\na[0] = 97; a[1] = 98; a[2] = 99\nwrite.write(a)\nwrite.write('!')\nwrite.end(Buffer('!!1'))\n```\n\nSee `test/` for more examples\n\n# methods\n\n```js\nvar concat = require('concat-stream')\n```\n\n## var writable = concat(opts={}, cb)\n\nReturn a `writable` stream that will fire `cb(data)` with all of the data that\nwas written to the stream. Data can be written to `writable` as strings,\nBuffers, arrays of byte integers, and Uint8Arrays. \n\nBy 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.\n\n* `string` - get a string\n* `buffer` - get back a Buffer\n* `array` - get an array of byte integers\n* `uint8array`, `u8`, `uint8` - get back a Uint8Array\n* `object`, get back an array of Objects\n\nIf you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`.\n\n# error handling\n\n`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.\n\nWe recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code.\n\n# license\n\nMIT LICENSE\n", + "readmeFilename": "readme.md", "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" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz", - "readme": "ERROR: No README data found!" + "_id": "concat-stream@1.5.1", + "_shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz", + "_from": "concat-stream@>=1.4.6 <2.0.0" } 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..1a16af94c40736 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 @@ -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/graceful-fs/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/npm-registry-client/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/npm-registry-client/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/npm-registry-client/node_modules/graceful-fs/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/package.json deleted file mode 100644 index 9add3d355157f7..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "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" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "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.0 <4.0.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" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/npm-registry-client/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/npm-registry-client/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/npm-registry-client/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/npm-registry-client/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/npm-registry-client/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/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..dea2f3b175605c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json @@ -0,0 +1,54 @@ +{ + "author": { + "name": "Tim Koschützki", + "email": "tim@debuggable.com", + "url": "http://debuggable.com/" + }, + "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" + }, + "directories": { + "lib": "./lib" + }, + "main": "index", + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd", + "bugs": { + "url": "https://github.com/tim-kos/node-retry/issues" + }, + "_id": "retry@0.8.0", + "scripts": {}, + "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", + "_from": "retry@>=0.8.0 <0.9.0", + "_npmVersion": "2.1.7", + "_nodeVersion": "0.10.33", + "_npmUser": { + "name": "tim-kos", + "email": "tim@debuggable.com" + }, + "maintainers": [ + { + "name": "tim-kos", + "email": "tim@debuggable.com" + } + ], + "dist": { + "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", + "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz", + "readme": "ERROR: No README data found!" +} 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 ffcccd85dd3358..7ead37785b2d14 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -6,47 +6,77 @@ }, "name": "npm-registry-client", "description": "Client for the npm registry", - "version": "6.5.1", + "version": "7.0.9", "repository": { - "url": "git://github.com/isaacs/npm-registry-client.git" + "url": "git+https://github.com/npm/npm-registry-client.git" }, "main": "index.js", "scripts": { "test": "standard && tap test/*.js" }, "dependencies": { - "chownr": "0", + "chownr": "^1.0.1", "concat-stream": "^1.4.6", - "graceful-fs": "^3.0.0", + "graceful-fs": "^4.1.2", "mkdirp": "^0.5.0", "normalize-package-data": "~1.0.1 || ^2.0.0", "npm-package-arg": "^3.0.0 || ^4.0.0", "once": "^1.3.0", "request": "^2.47.0", - "retry": "^0.6.1", + "retry": "^0.8.0", "rimraf": "2", "semver": "2 >=2.2.1 || 3.x || 4 || 5", "slide": "^1.1.3", - "npmlog": "" + "npmlog": "~2.0.0" }, "devDependencies": { "negotiator": "^0.4.9", "nock": "^0.56.0", + "readable-stream": "^2.0.2", "standard": "^4.0.0", "tap": "^1.2.0" }, "optionalDependencies": { - "npmlog": "" + "npmlog": "~2.0.0" }, "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": "dbb351ae906f40be03f21bbe28bd392a380dc7bb", + "gitHead": "2c0c83149edb270829582a234703404b2ba1c410", "bugs": { - "url": "https://github.com/isaacs/npm-registry-client/issues" + "url": "https://github.com/npm/npm-registry-client/issues" }, - "homepage": "https://github.com/isaacs/npm-registry-client#readme", - "_id": "npm-registry-client@6.5.1", - "_shasum": "328d2088252b69fa541c3dd9f7690288661592a1", - "_from": "npm-registry-client@>=6.5.1 <6.6.0" + "homepage": "https://github.com/npm/npm-registry-client#readme", + "_id": "npm-registry-client@7.0.9", + "_shasum": "1baf86ee5285c4e6d38d4556208ded56049231bb", + "_from": "npm-registry-client@>=7.0.9 <7.1.0", + "_npmVersion": "3.4.1", + "_nodeVersion": "5.1.0", + "_npmUser": { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + "dist": { + "shasum": "1baf86ee5285c4e6d38d4556208ded56049231bb", + "tarball": "http://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.0.9.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.0.9.tgz", + "readme": "ERROR: No README data found!" } 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 4081c329f7fb44..78b00017f18512 100644 --- a/deps/npm/node_modules/npm-registry-client/test/access.js +++ b/deps/npm/node_modules/npm-registry-client/test/access.js @@ -6,91 +6,365 @@ var client = common.freshClient() function nop () {} -var URI = 'http://localhost:1337/-/package/underscore/access' -var TOKEN = 'foo' -var AUTH = { - token: TOKEN -} -var LEVEL = 'public' +var URI = 'http://localhost:1337' var PARAMS = { - level: LEVEL, - auth: AUTH + auth: { token: 'foo' }, + scope: 'myorg', + team: 'myteam', + package: '@foo/bar', + permissions: 'read-write' +} +var UNSCOPED = { + auth: { token: 'foo' }, + scope: 'myorg', + team: 'myteam', + package: 'bar', + permissions: 'read-write' } -test('access call contract', function (t) { - t.throws(function () { - client.access(undefined, AUTH, nop) - }, 'requires a URI') - - t.throws(function () { - client.access([], PARAMS, nop) - }, 'requires URI to be a string') - - t.throws(function () { - client.access(URI, undefined, nop) - }, 'requires params object') - - t.throws(function () { - client.access(URI, '', nop) - }, 'params must be object') - - t.throws(function () { - client.access(URI, PARAMS, undefined) - }, 'requires callback') - - t.throws(function () { - client.access(URI, PARAMS, 'callback') - }, 'callback must be function') - - t.throws( - function () { - var params = { - auth: AUTH - } - client.access(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass level to access' }, - 'access must include level' - ) - - t.throws( - function () { - var params = { - level: LEVEL - } - client.access(URI, params, nop) - }, - { name: 'AssertionError', message: 'must pass auth to access' }, - 'access must include auth' - ) +var commands = [ + 'public', 'restricted', 'grant', 'revoke', 'ls-packages', 'ls-collaborators' +] - t.end() +test('access public', function (t) { + server.expect('POST', '/-/package/%40foo%2Fbar/access', function (req, res) { + t.equal(req.method, 'POST') + onJsonReq(req, function (json) { + t.deepEqual(json, { access: 'public' }) + res.statusCode = 200 + res.json({ accessChanged: true }) + }) + }) + var params = Object.create(PARAMS) + params.package = '@foo/bar' + client.access('public', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) }) -test('set access level on a package', function (t) { - server.expect('POST', '/-/package/underscore/access', function (req, res) { +test('access restricted', function (t) { + server.expect('POST', '/-/package/%40foo%2Fbar/access', function (req, res) { t.equal(req.method, 'POST') - - var b = '' - req.setEncoding('utf8') - req.on('data', function (d) { - b += d + onJsonReq(req, function (json) { + t.deepEqual(json, { access: 'restricted' }) + res.statusCode = 200 + res.json({ accessChanged: true }) }) + }) + client.access('restricted', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) - req.on('end', function () { - var updated = JSON.parse(b) - - t.deepEqual(updated, { access: 'public' }) +test('access grant basic', 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: PARAMS.permissions, + package: PARAMS.package + }) + res.statusCode = 201 + res.json({ accessChanged: true }) + }) + }) + client.access('grant', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) +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') + onJsonReq(req, function (json) { + t.deepEqual(json, { + package: PARAMS.package + }) + res.statusCode = 200 + res.json({ accessChanged: true }) + }) + }) + client.access('revoke', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.ok(data.accessChanged, 'access level set') + t.end() + }) +}) - client.access(URI, PARAMS, function (error, data) { +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', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + var uri = '/-/team/myorg/myteam/package?format=cli' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverPackages) + }) + client.access('ls-packages', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientPackages) t.end() }) }) + +test('ls-packages on org', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + var uri = '/-/org/myorg/package?format=cli' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverPackages) + }) + var params = Object.create(PARAMS) + params.team = null + client.access('ls-packages', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientPackages) + t.end() + }) +}) + +test('ls-packages on user', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + var firstUri = '/-/org/myorg/package?format=cli' + server.expect('GET', firstUri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 404 + res.json({error: 'not found'}) + }) + var secondUri = '/-/user/myorg/package?format=cli' + server.expect('GET', secondUri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverPackages) + }) + var params = Object.create(PARAMS) + params.team = null + client.access('ls-packages', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientPackages) + t.end() + }) +}) + +test('ls-collaborators', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + var uri = '/-/package/%40foo%2Fbar/collaborators?format=cli' + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + res.statusCode = 200 + res.json(serverCollaborators) + }) + client.access('ls-collaborators', URI, PARAMS, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientCollaborators) + t.end() + }) +}) + +test('ls-collaborators w/scope', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + var uri = '/-/package/%40foo%2Fbar/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(PARAMS) + params.user = 'zkat' + client.access('ls-collaborators', URI, params, function (error, data) { + t.ifError(error, 'no errors') + t.same(data, clientCollaborators) + t.end() + }) +}) + +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) + }, 'command is required') + t.throws(function () { + client.access('whoops', URI, PARAMS, nop) + }, 'command must be a valid subcommand') + commands.forEach(function (cmd) { + t.throws(function () { + client.access(cmd, undefined, PARAMS, nop) + }, 'registry URI is required') + t.throws(function () { + client.access(cmd, URI, undefined, nop) + }, 'params is required') + t.throws(function () { + client.access(cmd, URI, '', nop) + }, 'params must be an object') + t.throws(function () { + client.access(cmd, URI, {scope: 'o', team: 't'}, nop) + }, 'auth is required') + t.throws(function () { + client.access(cmd, URI, {auth: 5, scope: 'o', team: 't'}, nop) + }, 'auth must be an object') + t.throws(function () { + client.access(cmd, URI, PARAMS, {}) + }, 'callback must be a function') + t.throws(function () { + client.access(cmd, URI, PARAMS, undefined) + }, 'callback is required') + if (contains([ + 'public', 'restricted' + ], cmd)) { + t.throws(function () { + var params = Object.create(PARAMS) + params.package = null + client.access(cmd, URI, params, nop) + }, 'package is required') + t.throws(function () { + var params = Object.create(PARAMS) + params.package = 'underscore' + client.access(cmd, URI, params, nop) + }, 'only scoped packages are allowed') + } + if (contains(['grant', 'revoke', 'ls-packages'], cmd)) { + t.throws(function () { + var params = Object.create(PARAMS) + params.scope = null + client.access(cmd, URI, params, nop) + }, 'scope is required') + } + if (contains(['grant', 'revoke'], cmd)) { + t.throws(function () { + var params = Object.create(PARAMS) + params.team = null + client.access(cmd, URI, params, nop) + }, 'team is required') + } + if (cmd === 'grant') { + t.throws(function () { + var params = Object.create(PARAMS) + params.permissions = null + client.access(cmd, URI, params, nop) + }, 'permissions are required') + t.throws(function () { + var params = Object.create(PARAMS) + params.permissions = 'idkwhat' + client.access(cmd, URI, params, nop) + }, 'permissions must be either read-only or read-write') + } + }) + t.end() +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) + +function onJsonReq (req, cb) { + var buffer = '' + req.setEncoding('utf8') + req.on('data', function (data) { buffer += data }) + req.on('end', function () { cb(buffer ? JSON.parse(buffer) : undefined) }) +} + +function contains (arr, item) { + return arr.indexOf(item) !== -1 +} diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js b/deps/npm/node_modules/npm-registry-client/test/adduser-new.js index d8c415bc5f6572..a834841de40887 100644 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js +++ b/deps/npm/node_modules/npm-registry-client/test/adduser-new.js @@ -51,6 +51,7 @@ tap.test('create new user account', function (t) { function (er, data) { if (er) throw er t.deepEqual(data, auth, 'received expected auth data') + server.close() t.end() } ) diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js index 18aad3ebe4b947..03d5f468f18f98 100644 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js +++ b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js @@ -61,6 +61,7 @@ tap.test('update a user acct', function (t) { function (er, data) { if (er) throw er t.deepEqual(data, auth, 'got expected auth data') + server.close() t.end() } ) diff --git a/deps/npm/node_modules/npm-registry-client/test/deprecate.js b/deps/npm/node_modules/npm-registry-client/test/deprecate.js index d49f71215cf0db..4407d7c97bd8c5 100644 --- a/deps/npm/node_modules/npm-registry-client/test/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/test/deprecate.js @@ -154,3 +154,63 @@ test('deprecate a package', function (t) { } ) }) + +test('deprecate a scoped package', function (t) { + server.expect('GET', '/@test%2funderscore?write=true', function (req, res) { + t.equal(req.method, 'GET') + + res.json(cache) + }) + + server.expect('PUT', '/@test%2funderscore', function (req, res) { + t.equal(req.method, 'PUT') + + var b = '' + req.setEncoding('utf8') + req.on('data', function (d) { + b += d + }) + + req.on('end', function () { + var updated = JSON.parse(b) + + var undeprecated = [ + '1.0.3', '1.0.4', '1.1.0', '1.1.1', '1.1.2', '1.1.3', '1.1.4', '1.1.5', '1.1.6', + '1.1.7', '1.2.0', '1.2.1', '1.2.2', '1.2.3', '1.2.4', '1.3.0', '1.3.1', '1.3.3' + ] + for (var i = 0; i < undeprecated.length; i++) { + var current = undeprecated[i] + t.notEqual( + updated.versions[current].deprecated, + MESSAGE, + current + ' not deprecated' + ) + } + + t.equal( + updated.versions[VERSION].deprecated, + MESSAGE, + VERSION + ' deprecated' + ) + res.statusCode = 201 + res.json({ deprecated: true }) + }) + }) + + client.deprecate( + common.registry + '/@test%2funderscore', + PARAMS, + function (er, data) { + t.ifError(er) + t.ok(data.deprecated, 'was deprecated') + + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + t.ok(true) + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js index e66d80a3e3298b..00f43b0f283699 100644 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js +++ b/deps/npm/node_modules/npm-registry-client/test/dist-tags-add.js @@ -136,6 +136,7 @@ test('add a new dist-tag to a package', function (t) { t.ifError(error, 'no errors') t.ok(data.test, 'dist-tag added') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js index ef0901ea7fc547..cde338cf183806 100644 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js +++ b/deps/npm/node_modules/npm-registry-client/test/dist-tags-fetch.js @@ -93,6 +93,7 @@ test('fetch dist-tags for a package', function (t) { t.ifError(error, 'no errors') t.same(data, { a: '1.0.0', b: '2.0.0' }, 'etag filtered from response') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js index a035014dc67918..2076eb931201ed 100644 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js +++ b/deps/npm/node_modules/npm-registry-client/test/dist-tags-rm.js @@ -112,6 +112,7 @@ test('remove a dist-tag from a package', function (t) { t.ifError(error, 'no errors') t.notOk(data.test, 'dist-tag removed') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js index 691aef13ea113f..cb595f6d21de17 100644 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js +++ b/deps/npm/node_modules/npm-registry-client/test/dist-tags-set.js @@ -116,6 +116,7 @@ test('set dist-tags for a package', function (t) { t.ifError(error, 'no errors') t.ok(data.a && data.b, 'dist-tags set') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js b/deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js index 4a829c85d18556..37508fc074bf9e 100644 --- a/deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js +++ b/deps/npm/node_modules/npm-registry-client/test/dist-tags-update.js @@ -107,6 +107,7 @@ test('update dist-tags for a package', function (t) { t.ifError(error, 'no errors') t.ok(data.a && data.b, 'dist-tags set') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js index e05e36f26cd833..fa400cd5cc80b7 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js @@ -1,9 +1,7 @@ var resolve = require('path').resolve var createReadStream = require('graceful-fs').createReadStream -var readFileSync = require('graceful-fs').readFileSync var tap = require('tap') -var cat = require('concat-stream') var server = require('./lib/server.js') var common = require('./lib/common.js') @@ -14,10 +12,7 @@ tap.test('fetch with a 404 response', function (t) { server.expect('/underscore/-/underscore-1.3.3.tgz', function (req, res) { t.equal(req.method, 'GET', 'got expected method') - res.writeHead(200, { - 'content-type': 'application/x-tar', - 'content-encoding': 'gzip' - }) + res.writeHead(404) createReadStream(tgz).pipe(res) }) @@ -27,19 +22,14 @@ tap.test('fetch with a 404 response', function (t) { client.fetch( 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', defaulted, - function (er, res) { - t.ifError(er, 'loaded successfully') - - var sink = cat(function (data) { - t.deepEqual(data, readFileSync(tgz)) - t.end() - }) - - res.on('error', function (error) { - t.ifError(error, 'no errors on stream') - }) - - res.pipe(sink) + function (err, res) { + t.equal( + err.message, + 'fetch failed with status code 404', + 'got expected error message' + ) + server.close() + t.end() } ) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js index d49b149f636489..422376ef3d8e59 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js @@ -40,6 +40,7 @@ tap.test('fetch with retry on timeout', function (t) { var sink = cat(function (data) { t.deepEqual(data, readFileSync(tgz)) + server.close() t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js index 04f5901e8c824e..6dff11558236b8 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js @@ -40,6 +40,7 @@ tap.test('fetch with retry on server error', function (t) { var sink = cat(function (data) { t.deepEqual(data, readFileSync(tgz)) + server.close() t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js b/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js index ccfd4b77f20431..d516deb379a01a 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-authed.js @@ -44,6 +44,7 @@ tap.test('basic fetch with scoped always-auth enabled', function (t) { var sink = cat(function (data) { t.deepEqual(data, readFileSync(tgz)) + server.close() t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js index 7bf4d1bd1a3dd0..31ad17edd5f739 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js @@ -79,6 +79,7 @@ test('basic fetch', function (t) { var sink = concat(function (data) { t.deepEqual(data, readFileSync(tgz)) + server.close() t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js b/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js index 43f25f1ad7b81b..688c91d2718f46 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-github-api-json.js @@ -54,6 +54,7 @@ tap.test("fetch accepts github api's json", function (t) { var sink = cat(function (data) { t.deepEqual(data, readFileSync(tgz)) + server.close() t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js b/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js index 2fb92c2c207ce4..6a397cc5e9ba56 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-not-authed.js @@ -40,6 +40,7 @@ tap.test('basic fetch with scoped always-auth disabled', function (t) { var sink = cat(function (data) { t.deepEqual(data, readFileSync(tgz)) + server.close() t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-403.js b/deps/npm/node_modules/npm-registry-client/test/get-403.js index 0b8592e50c2c11..004de207f87112 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-403.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-403.js @@ -23,6 +23,7 @@ tap.test('get returns 403', function (t) { t.equal(er.statusCode, 403, 'status code was attached to error as expected') t.equal(er.code, 'E403', 'error code was formatted as expected') + server.close() t.end() } ) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-basic.js b/deps/npm/node_modules/npm-registry-client/test/get-basic.js index a2ab27fe0f18a4..031309c92bd963 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-basic.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-basic.js @@ -78,3 +78,8 @@ test('basic request', function (t) { t.deepEqual(data, usroot) }) }) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js index c9c96d354e0ee1..73ef4361161933 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js @@ -27,6 +27,7 @@ tap.test('get fails with 403', function (t) { 'got error message' ) + server.close() t.end() } ) diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js index 8b7875d4c080ed..78e543f699a168 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/common.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/common.js @@ -2,6 +2,14 @@ var server = require('./server.js') var RC = require('../../') var REGISTRY = 'http://localhost:' + server.port +// cheesy hackaround for test deps (read: nock) that rely on setImmediate +if (!global.setImmediate || !require('timers').setImmediate) { + require('timers').setImmediate = global.setImmediate = function () { + var args = [arguments[0], 0].concat([].slice.call(arguments, 1)) + setTimeout.apply(this, args) + } +} + module.exports = { port: server.port, registry: REGISTRY, diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/server.js b/deps/npm/node_modules/npm-registry-client/test/lib/server.js index 60b116d80f91bc..06bebdc139306d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/server.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/server.js @@ -29,11 +29,6 @@ function handler (req, res) { var fn = server._expect[k].shift() if (!fn) throw Error('unexpected request: ' + req.method + ' ' + req.url) - var remain = (Object.keys(server._expect).reduce(function (s, k) { - return s + server._expect[k].length - }, 0)) - if (remain === 0) server.close() - else this.log.info('fake-registry', 'TEST SERVER: %d reqs remain', remain) this.log.info('fake-registry', Object.keys(server._expect).map(function (k) { return [k, server._expect[k].length] }).reduce(function (acc, kv) { diff --git a/deps/npm/node_modules/npm-registry-client/test/ping.js b/deps/npm/node_modules/npm-registry-client/test/ping.js index 002d8ba8f2763a..1b30b90520e9f8 100644 --- a/deps/npm/node_modules/npm-registry-client/test/ping.js +++ b/deps/npm/node_modules/npm-registry-client/test/ping.js @@ -70,6 +70,7 @@ test('ping', function (t) { username: DEP_USER } t.same(found, wanted) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js index 42f67272138f36..611a852cd88697 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js @@ -17,7 +17,7 @@ tap.test('publish again', function (t) { // not really a tarball, but doesn't matter var bodyPath = require.resolve('../package.json') var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath, 'base64') + var pd = fs.readFileSync(bodyPath) var pkg = require('../package.json') var lastTime = null @@ -36,7 +36,7 @@ tap.test('publish again', function (t) { t.has(o.versions[pkg.version], pkg) t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd) + t.same(att.data, pd.toString('base64')) res.statusCode = 409 res.json({reason: 'must supply latest _rev to update existing package'}) }) @@ -85,6 +85,7 @@ tap.test('publish again', function (t) { client.publish('http://localhost:1337/', params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js index 5beec90e4a0a82..4a895205ea2845 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again.js @@ -17,7 +17,7 @@ tap.test('publish again', function (t) { // not really a tarball, but doesn't matter var bodyPath = require.resolve('../package.json') var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath, 'base64') + var pd = fs.readFileSync(bodyPath) var pkg = require('../package.json') var lastTime = null @@ -36,7 +36,7 @@ tap.test('publish again', function (t) { t.has(o.versions[pkg.version], pkg) t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd) + t.same(att.data, pd.toString('base64')) res.statusCode = 409 res.json({reason: 'must supply latest _rev to update existing package'}) }) @@ -83,6 +83,7 @@ tap.test('publish again', function (t) { client.publish('http://localhost:1337/', params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js b/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js index 5cb66d1e077f03..d2641e85c11e6b 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-failed-no-message.js @@ -38,6 +38,7 @@ test('publish with a 500 response but no message', function (t) { t.ok(er, 'got expected error') t.notOk(data, 'no payload on failure') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js b/deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js index f2cc1d66813086..5f2c44e697de6a 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-mixcase-name.js @@ -17,7 +17,7 @@ tap.test('publish mixcase name', function (t) { // not really a tarball, but doesn't matter var bodyPath = require.resolve('../package.json') var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath, 'base64') + var pd = fs.readFileSync(bodyPath) var pkg = require('../package.json') var lastTime = null @@ -39,7 +39,7 @@ tap.test('publish mixcase name', function (t) { t.has(o.versions[pkg.version], pkg) t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd) + t.same(att.data, pd.toString('base64')) res.statusCode = 409 res.json({reason: 'must supply latest _rev to update existing package'}) }) @@ -86,6 +86,7 @@ tap.test('publish mixcase name', function (t) { client.publish('http://localhost:1337/', params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js b/deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js index 5b0e47655c20e6..e3e8ed23242816 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-new-mixcase-name.js @@ -28,7 +28,7 @@ var PARAMS = { } test('publish-new-mixcase-name', function (t) { - var pd = fs.readFileSync(BODY_PATH, 'base64') + var pd = fs.readFileSync(BODY_PATH) // change to mixed-case name METADATA.name = 'npm-Registry-Client' @@ -51,9 +51,9 @@ test('publish-new-mixcase-name', function (t) { t.same(o.maintainers, o.versions[METADATA.version].maintainers) var att = o._attachments[METADATA.name + '-' + METADATA.version + '.tgz'] - t.same(att.data, pd) + t.same(att.data, pd.toString('base64')) - var hash = crypto.createHash('sha1').update(pd, 'base64').digest('hex') + var hash = crypto.createHash('sha1').update(pd).digest('hex') t.equal(o.versions[METADATA.version].dist.shasum, hash) res.statusCode = 403 @@ -67,6 +67,7 @@ test('publish-new-mixcase-name', function (t) { // TODO: need a test that ensures useful error message // t.similar(data.error, /must be lower-case/) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js index d4704ca491d013..a9c5768e582c98 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js @@ -13,7 +13,7 @@ tap.test('publish', function (t) { // not really a tarball, but doesn't matter var bodyPath = require.resolve('../package.json') var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath, 'base64') + var pd = fs.readFileSync(bodyPath) var pkg = require('../package.json') pkg.name = '@npm/npm-registry-client' @@ -34,8 +34,8 @@ tap.test('publish', function (t) { t.has(o.versions[pkg.version], pkg) t.same(o.maintainers, o.versions[pkg.version].maintainers) var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd) - var hash = crypto.createHash('sha1').update(pd, 'base64').digest('hex') + t.same(att.data, pd.toString('base64')) + var hash = crypto.createHash('sha1').update(pd).digest('hex') t.equal(o.versions[pkg.version].dist.shasum, hash) res.statusCode = 201 res.json({ created: true }) @@ -51,6 +51,7 @@ tap.test('publish', function (t) { client.publish(common.registry, params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js index 7758c3c12b9723..347364ea99e24b 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js @@ -19,7 +19,7 @@ tap.test('publish', function (t) { // not really a tarball, but doesn't matter var bodyPath = require.resolve('../package.json') var tarball = fs.createReadStream(bodyPath) - var pd = fs.readFileSync(bodyPath, 'base64') + var pd = fs.readFileSync(bodyPath) var pkg = require('../package.json') pkg.name = '@npm/npm-registry-client' @@ -41,8 +41,8 @@ tap.test('publish', function (t) { t.same(o.maintainers, [ { name: 'username', email: 'ogd@aoaioxxysz.net' } ]) t.same(o.maintainers, o.versions[pkg.version].maintainers) var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] - t.same(att.data, pd) - var hash = crypto.createHash('sha1').update(pd, 'base64').digest('hex') + t.same(att.data, pd.toString('base64')) + var hash = crypto.createHash('sha1').update(pd).digest('hex') t.equal(o.versions[pkg.version].dist.shasum, hash) res.statusCode = 201 res.json({ created: true }) @@ -58,6 +58,7 @@ tap.test('publish', function (t) { client.publish(common.registry, params, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish.js b/deps/npm/node_modules/npm-registry-client/test/publish.js index f2c257e95c35d3..07c8bb4617ff67 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish.js @@ -164,7 +164,7 @@ test('publish call contract', function (t) { }) test('publish', function (t) { - var pd = fs.readFileSync(BODY_PATH, 'base64') + var pd = fs.readFileSync(BODY_PATH) server.expect('/npm-registry-client', function (req, res) { t.equal(req.method, 'PUT') @@ -184,9 +184,9 @@ test('publish', function (t) { t.same(o.maintainers, o.versions[METADATA.version].maintainers) var att = o._attachments[METADATA.name + '-' + METADATA.version + '.tgz'] - t.same(att.data, pd) + t.same(att.data, pd.toString('base64')) - var hash = crypto.createHash('sha1').update(pd, 'base64').digest('hex') + var hash = crypto.createHash('sha1').update(pd).digest('hex') t.equal(o.versions[METADATA.version].dist.shasum, hash) res.statusCode = 201 @@ -198,6 +198,7 @@ test('publish', function (t) { if (er) throw er t.deepEqual(data, { created: true }) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/redirects.js b/deps/npm/node_modules/npm-registry-client/test/redirects.js index d589f161a63eeb..2da565769bc888 100644 --- a/deps/npm/node_modules/npm-registry-client/test/redirects.js +++ b/deps/npm/node_modules/npm-registry-client/test/redirects.js @@ -1,4 +1,4 @@ -var tap = require('tap') +var test = require('tap').test var server = require('./lib/server.js') var common = require('./lib/common.js') @@ -10,7 +10,7 @@ var pkg = { version: '1.2.3' } -tap.test('basic request', function (t) { +test('basic request', function (t) { // Expect one request for { follow : false } server.expect('/-/some-package/1.2.3', function (req, res) { res.writeHead(301, { @@ -49,3 +49,8 @@ tap.test('basic request', function (t) { } ) }) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js index 27a76b8a81a283..5e25214f2527fd 100644 --- a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js +++ b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js @@ -1,5 +1,5 @@ var zlib = require('zlib') -var tap = require('tap') +var test = require('tap').test var server = require('./lib/server.js') var common = require('./lib/common.js') @@ -20,7 +20,7 @@ var pkg = { } zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { - tap.test('request gzip package content', function (t) { + test('request gzip package content', function (t) { t.ifError(err, 'example package compressed') server.expect('GET', '/some-package-gzip/1.2.3', function (req, res) { @@ -37,7 +37,7 @@ zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { }) }) - tap.test('request wrong gzip package content', function (t) { + test('request wrong gzip package content', function (t) { // will retry 3 times for (var i = 0; i < 3; i++) { server.expect('GET', '/some-package-gzip/1.2.3', function (req, res) { @@ -53,4 +53,9 @@ zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { t.end() }) }) + + test('cleanup', function (t) { + server.close() + t.end() + }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/request.js b/deps/npm/node_modules/npm-registry-client/test/request.js index 68af9bcca2baf9..ed02f19722fa06 100644 --- a/deps/npm/node_modules/npm-registry-client/test/request.js +++ b/deps/npm/node_modules/npm-registry-client/test/request.js @@ -1,4 +1,4 @@ -var Readable = require('stream').Readable +var Readable = require('readable-stream').Readable var inherits = require('util').inherits var test = require('tap').test @@ -81,7 +81,7 @@ test('request call contract', function (t) { }) test('run request through its paces', function (t) { - t.plan(29) + t.plan(34) server.expect('/request-defaults', function (req, res) { t.equal(req.method, 'GET', 'uses GET by default') @@ -173,6 +173,13 @@ test('run request through its paces', function (t) { })) }) + server.expect('GET', '/not-found-no-body', function (req, res) { + req.pipe(concat(function () { + res.statusCode = 404 + res.end() + })) + }) + var defaults = {} client.request( common.registry + '/request-defaults', @@ -260,4 +267,51 @@ test('run request through its paces', function (t) { client.request(common.registry + '/@scoped%2Fpackage-failing', defaults, function (er) { t.equals(er.message, 'payment required : @scoped/package-failing') }) + + client.request(common.registry + '/not-found-no-body', defaults, function (er) { + t.equals(er.message, '404 Not Found') + t.equals(er.statusCode, 404, 'got back 404 as .statusCode') + t.equals(er.code, 'E404', 'got back expected string code') + t.notOk(er.pkgid, "no package name returned when there's no body on response") + t.ok(typeof er !== 'string', "Error shouldn't be returned as string.") + }) +}) + +test('outputs notice if npm-notice header is set', function (t) { + var client = common.freshClient({ + log: { + error: noop, + warn: function (prefix, msg) { + warnings.push(msg) + }, + info: noop, + verbose: noop, + silly: noop, + http: noop, + pause: noop, + resume: noop + } + }) + var message = 'notice me!' + var warnings = [] + + function noop () {} + + server.expect('GET', '/npm-notice', function (req, res) { + req.pipe(concat(function () { + res.statusCode = 200 + res.setHeader('npm-notice', message) + res.end() + })) + }) + + client.request(common.registry + '/npm-notice', {}, function (er) { + t.notEqual(warnings.indexOf(message), -1, 'notice not printed') + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/retries.js b/deps/npm/node_modules/npm-registry-client/test/retries.js index 3101a5d576068a..a75cbf7e020296 100644 --- a/deps/npm/node_modules/npm-registry-client/test/retries.js +++ b/deps/npm/node_modules/npm-registry-client/test/retries.js @@ -46,6 +46,7 @@ tap.test('create new user account', function (t) { client.get('http://localhost:1337/some-package/1.2.3', {}, function (er, data) { if (er) throw er t.deepEqual(data, pkg) + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/star.js b/deps/npm/node_modules/npm-registry-client/test/star.js index ff00bab1c8e020..e9e60266da0b85 100644 --- a/deps/npm/node_modules/npm-registry-client/test/star.js +++ b/deps/npm/node_modules/npm-registry-client/test/star.js @@ -112,13 +112,13 @@ test('if password auth, only sets authorization on put', function (t) { .reply(200, {}) var starPut = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Basic ' + new Buffer(AUTH.username + ':' + - AUTH.password).toString('base64') - } - }) - .put('/underscore') - .reply(200) + reqheaders: { + authorization: 'Basic ' + new Buffer(AUTH.username + ':' + + AUTH.password).toString('base64') + } + }) + .put('/underscore') + .reply(200) var params = { starred: STARRED, auth: AUTH } @@ -132,28 +132,28 @@ test('if password auth, only sets authorization on put', function (t) { test('if token auth, sets bearer on get and put', function (t) { var starGet = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Bearer foo' - } - }) - .get('/underscore?write=true') - .reply(200, {}) + reqheaders: { + authorization: 'Bearer foo' + } + }) + .get('/underscore?write=true') + .reply(200, {}) var getUser = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Bearer foo' - } - }) - .get('/-/whoami') - .reply(200, { username: 'bcoe' }) + reqheaders: { + authorization: 'Bearer foo' + } + }) + .get('/-/whoami') + .reply(200, { username: 'bcoe' }) var starPut = nock('http://localhost:1010', { - reqheaders: { - authorization: 'Bearer foo' - } - }) - .put('/underscore') - .reply(200) + reqheaders: { + authorization: 'Bearer foo' + } + }) + .put('/underscore') + .reply(200) var params = { starred: STARRED, @@ -169,3 +169,8 @@ test('if token auth, sets bearer on get and put', function (t) { t.end() }) }) + +test('cleanup', function (t) { + server.close() + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/stars.js b/deps/npm/node_modules/npm-registry-client/test/stars.js index d990e05c5ee601..a5e713c58ed293 100644 --- a/deps/npm/node_modules/npm-registry-client/test/stars.js +++ b/deps/npm/node_modules/npm-registry-client/test/stars.js @@ -75,6 +75,7 @@ test('get the stars for a package', function (t) { t.ifError(er, 'no errors') t.deepEqual(info, USERS, 'got the list of users') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/tag.js b/deps/npm/node_modules/npm-registry-client/test/tag.js index 2ab5134e4e07ce..e10490ee6c51c6 100644 --- a/deps/npm/node_modules/npm-registry-client/test/tag.js +++ b/deps/npm/node_modules/npm-registry-client/test/tag.js @@ -102,6 +102,7 @@ test('tag a package', function (t) { t.ifError(error, 'no errors') t.ok(data.tagged, 'was tagged') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/team.js b/deps/npm/node_modules/npm-registry-client/test/team.js new file mode 100644 index 00000000000000..ffbd18fc837638 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/team.js @@ -0,0 +1,215 @@ +var test = require('tap').test + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +function nop () {} + +var URI = 'http://localhost:1337' +var PARAMS = { + auth: { + token: 'foo' + }, + scope: 'myorg', + team: 'myteam' +} + +var commands = ['create', 'destroy', 'add', 'rm', 'ls'] + +test('team create basic', function (t) { + var teamData = { + name: PARAMS.team, + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: null + } + server.expect('PUT', '/-/org/myorg/team', function (req, res) { + t.equal(req.method, 'PUT') + onJsonReq(req, function (json) { + t.same(json, { name: PARAMS.team }) + res.statusCode = 200 + res.json(teamData) + }) + }) + client.team('create', URI, PARAMS, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, teamData) + t.end() + }) +}) + +test('team destroy', function (t) { + var teamData = { + name: 'myteam', + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: '2015-07-23T18:27:27.178Z' + } + server.expect('DELETE', '/-/team/myorg/myteam', function (req, res) { + t.equal(req.method, 'DELETE') + onJsonReq(req, function (json) { + t.same(json, undefined) + res.statusCode = 200 + res.json(teamData) + }) + }) + client.team('destroy', URI, PARAMS, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, teamData) + t.end() + }) +}) + +test('team add basic', function (t) { + var params = Object.create(PARAMS) + params.user = 'zkat' + server.expect('PUT', '/-/team/myorg/myteam/user', function (req, res) { + t.equal(req.method, 'PUT') + onJsonReq(req, function (json) { + t.same(json, { user: params.user }) + res.statusCode = 200 + res.json(undefined) + }) + }) + client.team('add', URI, params, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, undefined) + t.end() + }) +}) + +test('team add user not in org', function (t) { + var params = Object.create(PARAMS) + params.user = 'zkat' + var errMsg = 'user is already in team' + server.expect('PUT', '/-/team/myorg/myteam/user', function (req, res) { + t.equal(req.method, 'PUT') + res.statusCode = 400 + res.json({ + error: errMsg + }) + }) + client.team('add', URI, params, function (err, data) { + t.equal(err.message, errMsg + ' : ' + '-/team/myorg/myteam/user') + t.same(data, {error: errMsg}) + t.end() + }) +}) + +test('team rm basic', function (t) { + var params = Object.create(PARAMS) + params.user = 'bcoe' + server.expect('DELETE', '/-/team/myorg/myteam/user', function (req, res) { + t.equal(req.method, 'DELETE') + onJsonReq(req, function (json) { + t.same(json, params) + res.statusCode = 200 + res.json(undefined) + }) + }) + client.team('rm', URI, params, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, undefined) + t.end() + }) +}) + +test('team ls (on org)', function (t) { + var params = Object.create(PARAMS) + params.team = null + var teams = ['myorg:team1', 'myorg:team2', 'myorg:team3'] + server.expect('GET', '/-/org/myorg/team?format=cli', function (req, res) { + t.equal(req.method, 'GET') + onJsonReq(req, function (json) { + t.same(json, undefined) + res.statusCode = 200 + res.json(teams) + }) + }) + client.team('ls', URI, params, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, teams) + t.end() + }) +}) + +test('team ls (on team)', function (t) { + var uri = '/-/team/myorg/myteam/user?format=cli' + var users = ['zkat', 'bcoe'] + server.expect('GET', uri, function (req, res) { + t.equal(req.method, 'GET') + onJsonReq(req, function (json) { + t.same(json, undefined) + res.statusCode = 200 + res.json(users) + }) + }) + client.team('ls', URI, PARAMS, function (err, data) { + t.ifError(err, 'no errors') + t.same(data, users) + t.end() + }) +}) + +// test('team edit', function (t) { +// server.expect('PUT', '/-/org/myorg/team', function (req, res) { +// t.equal(req.method, 'PUT') +// res.statusCode = 201 +// res.json({}) +// }) +// client.team('create', URI, PARAMS, function (err, data) { +// t.ifError(err, 'no errors') +// t.end() +// }) +// }) + +test('team command base validation', function (t) { + t.throws(function () { + client.team(undefined, URI, PARAMS, nop) + }, 'command is required') + commands.forEach(function (cmd) { + t.throws(function () { + client.team(cmd, undefined, PARAMS, nop) + }, 'registry URI is required') + t.throws(function () { + client.team(cmd, URI, undefined, nop) + }, 'params is required') + t.throws(function () { + client.team(cmd, URI, {scope: 'o', team: 't'}, nop) + }, 'auth is required') + t.throws(function () { + client.team(cmd, URI, {auth: {token: 'f'}, team: 't'}, nop) + }, 'scope is required') + t.throws(function () { + client.team(cmd, URI, PARAMS, {}) + }, 'callback must be a function') + if (cmd !== 'ls') { + t.throws(function () { + client.team( + cmd, URI, {auth: {token: 'f'}, scope: 'o'}, nop) + }, 'team name is required') + } + if (cmd === 'add' || cmd === 'rm') { + t.throws(function () { + client.team( + cmd, URI, PARAMS, nop) + }, 'user is required') + } + }) + t.end() +}) + +test('cleanup', function (t) { + server.close() + t.end() +}) + +function onJsonReq (req, cb) { + var buffer = '' + req.setEncoding('utf8') + req.on('data', function (data) { buffer += data }) + req.on('end', function () { cb(buffer ? JSON.parse(buffer) : undefined) }) +} diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js index d3222de4706b8e..26d4ac7b1685ef 100644 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js @@ -1,4 +1,4 @@ -var tap = require('tap') +var test = require('tap').test var server = require('./lib/server.js') var common = require('./lib/common.js') @@ -19,7 +19,7 @@ var PARAMS = { auth: AUTH } -tap.test('unpublish a package', function (t) { +test('unpublish a package', function (t) { server.expect('GET', '/@npm%2fnpm-registry-client?write=true', function (req, res) { t.equal(req.method, 'GET') @@ -62,6 +62,7 @@ tap.test('unpublish a package', function (t) { client.unpublish(URI, PARAMS, function (er) { t.ifError(er, 'no errors') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish.js b/deps/npm/node_modules/npm-registry-client/test/unpublish.js index afb16b78773a7a..8a114c899be2b1 100644 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish.js @@ -98,6 +98,7 @@ test('unpublish a package', function (t) { client.unpublish(URI, PARAMS, function (error) { t.ifError(error, 'no errors') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/whoami.js b/deps/npm/node_modules/npm-registry-client/test/whoami.js index 764fc0c30469e1..80979ee97802a8 100644 --- a/deps/npm/node_modules/npm-registry-client/test/whoami.js +++ b/deps/npm/node_modules/npm-registry-client/test/whoami.js @@ -64,6 +64,7 @@ test('whoami', function (t) { t.ifError(error, 'no errors') t.equal(wombat, WHOIAM, 'im a wombat') + server.close() t.end() }) }) diff --git a/deps/npm/node_modules/npmlog/.npmrc b/deps/npm/node_modules/npmlog/.npmrc deleted file mode 100644 index ca0bc48dd5524f..00000000000000 --- a/deps/npm/node_modules/npmlog/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -save-prefix = ~ -proprietary-attribs = false 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..d70004d2ec252c 100644 --- a/deps/npm/node_modules/npmlog/log.js +++ b/deps/npm/node_modules/npmlog/log.js @@ -245,3 +245,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/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/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..ef2476e79f2eca 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 @@ -128,7 +128,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..9e7711935a32c0 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,21 +1,21 @@ "use strict" -var stream = require("readable-stream"); +var stream = require("readable-stream") var EventEmitter = require("events").EventEmitter var util = require("util") var delegate = require("delegates") +function noteChange (trackerGroup) { + return function (name) { + trackerGroup.emit('change', name || trackerGroup.name); + } +} + 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) - }) + this.noteChange = noteChange(this) } util.inherits(TrackerGroup, EventEmitter) @@ -23,9 +23,10 @@ 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() - }) + for (var i = 0, len = this.trackGroup.length; i < len; i++){ + var group = this.trackGroup[i]; + completed += valPerWeight * group.weight * group.completed() + } return completed } @@ -33,6 +34,7 @@ TrackerGroup.prototype.addUnit = function (unit, weight, noChange) { unit.weight = weight || 1 this.totalWeight += unit.weight this.trackGroup.push(unit) + // Bubble events back up unit.on("change", this.noteChange) if (! noChange) this.emit("change", this.name) return unit @@ -51,12 +53,12 @@ TrackerGroup.prototype.newStream = function (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() - }) + if (! this.trackGroup.length) this.addUnit(new Tracker(), 1, true) + for (var i = 0, len = this.trackGroup.length; i < len; i++) { + var group = this.trackGroup[i] + group.removeListener("change", this.noteChange) + group.finish() + } this.emit("change", this.name) } @@ -85,7 +87,7 @@ var Tracker = exports.Tracker = function (name,todo) { util.inherits(Tracker, EventEmitter) Tracker.prototype.completed = function () { - return this.workTodo==0 ? 0 : this.workDone / this.workTodo + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo } Tracker.prototype.addWork = function (work) { 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..52014b75679dee 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,9 +1,9 @@ { "name": "delegates", - "version": "0.1.0", + "version": "1.0.0", "repository": { "type": "git", - "url": "git://github.com/visionmedia/node-delegates.git" + "url": "git+https://github.com/visionmedia/node-delegates.git" }, "description": "delegate methods and accessors to another property", "keywords": [ @@ -16,17 +16,20 @@ "should": "*" }, "license": "MIT", + "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49", "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", + "homepage": "https://github.com/visionmedia/node-delegates#readme", + "_id": "delegates@1.0.0", + "scripts": {}, + "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "_from": "delegates@>=1.0.0 <2.0.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "4.2.1", "_npmUser": { - "name": "dominicbarnes", - "email": "dominic@dbarnes.info" + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" }, "maintainers": [ { @@ -39,10 +42,9 @@ } ], "dist": { - "shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390", - "tarball": "http://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz" + "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "tarball": "http://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" } 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..62b542cb9b853a 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,6 +1,6 @@ { "name": "are-we-there-yet", - "version": "1.0.4", + "version": "1.0.6", "description": "Keep track of the overall completion of many dispirate processes", "main": "index.js", "scripts": { @@ -20,32 +20,32 @@ }, "homepage": "https://github.com/iarna/are-we-there-yet", "devDependencies": { - "tap": "^0.4.13" + "tap": "^5.2.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", + "delegates": "^1.0.0", + "readable-stream": "^2.0.0 || ^1.1.13" + }, + "gitHead": "5f19c8b6f9c5afb8b0b17308cb9d66f7027ae526", + "_id": "are-we-there-yet@1.0.6", + "_shasum": "a2d28c93102aa6cc96245a26cb954de06ec53f0c", + "_from": "are-we-there-yet@>=1.0.6 <1.1.0", + "_npmVersion": "3.6.0", + "_nodeVersion": "5.4.0", "_npmUser": { "name": "iarna", "email": "me@re-becca.org" }, + "dist": { + "shasum": "a2d28c93102aa6cc96245a26cb954de06ec53f0c", + "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz" + }, "maintainers": [ { "name": "iarna", "email": "me@re-becca.org" } ], - "dist": { - "shasum": "527fe389f7bcba90806106b99244eaa07e886f85", - "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz" } 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..ca0a8cd773d6d2 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/README.md @@ -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/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md index e9d3cc326c144a..5a03e5991c539e 100644 --- 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 @@ -26,9 +26,12 @@ 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. - +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 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 index edceb703094082..9bf537b1cd48e5 100644 --- 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 @@ -1,11 +1,14 @@ "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 } + // 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) 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 index fd552a9e4096ee..a9d9a54f7c08da 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "has-unicode", - "version": "1.0.0", + "version": "2.0.0", "description": "Try to guess if your terminal supports unicode", "main": "index.js", "scripts": { @@ -24,30 +24,29 @@ }, "homepage": "https://github.com/iarna/has-unicode", "devDependencies": { - "require-inject": "^1.1.1", - "tap": "^0.4.13" + "require-inject": "^1.3.0", + "tap": "^2.3.1" }, - "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", + "gitHead": "fdd5de141a5564bdb5bc991d951209da40f6a598", + "_id": "has-unicode@2.0.0", + "_shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3", + "_from": "has-unicode@>=2.0.0 <3.0.0", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.2", "_npmUser": { "name": "iarna", "email": "me@re-becca.org" }, + "dist": { + "shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3", + "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz" + }, "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!" + "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz" } 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 index 2394c14ef7fce9..cbdfda335088ee 100644 --- 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 @@ -7,7 +7,7 @@ test("Windows", function (t) { var hasUnicode = requireInject("../index.js", { os: { type: function () { return "Windows_NT" } } }) - t.is(hasUnicode(), true, "Windows is assumed to be unicode aware") + t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware") }) test("Unix Env", function (t) { t.plan(3) diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE.txt b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE 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/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE.txt b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE.txt deleted file mode 100644 index 17764328c826b5..00000000000000 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/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._basetostring/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md index ad04ea956e4d20..f81145e6ebe765 100644 --- 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 @@ -1,4 +1,4 @@ -# lodash._basetostring v3.0.0 +# lodash._basetostring v3.0.1 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. @@ -17,4 +17,4 @@ In Node.js/io.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. +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-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 index 71ac885889b9e6..db8ecc9fdd0094 100644 --- 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 @@ -1,14 +1,14 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.0.1 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * 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 + * Converts `value` to a string if it's not one. An empty string is returned * for `null` or `undefined` values. * * @private @@ -16,9 +16,6 @@ * @returns {string} Returns the string. */ function baseToString(value) { - if (typeof value == 'string') { - return value; - } return value == null ? '' : (value + ''); } 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 index dfb815b75772c1..d89bde9d071ea7 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "lodash._basetostring", - "version": "3.0.0", + "version": "3.0.1", "description": "The modern build of lodash’s internal `baseToString` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -47,11 +47,11 @@ "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", + "_id": "lodash._basetostring@3.0.1", + "_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5", + "_from": "lodash._basetostring@3.0.1", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" @@ -60,13 +60,29 @@ { "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": "75a9a4aaaa2b2a8761111ff5431e7d83c1daf0e2", - "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz" + "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5", + "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz", + "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE.txt b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE 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/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE 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 index 0e1c73128ce792..f9c9411c70412e 100644 --- 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 @@ -1,4 +1,4 @@ -# lodash._createpadding v3.6.0 +# lodash._createpadding v3.6.1 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. @@ -17,4 +17,4 @@ In Node.js/io.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. +See the [package source](https://github.com/lodash/lodash/blob/3.6.1-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 index 72890bd2d8f4cf..3541a8aae32935 100644 --- 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 @@ -1,18 +1,16 @@ /** - * lodash 3.6.0 (Custom Build) + * 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.2 + * Based on Underscore.js 1.8.3 * 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; +var nativeCeil = Math.ceil, + nativeIsFinite = global.isFinite; /** * Creates the padding required for `string` based on the given `length`. @@ -33,7 +31,7 @@ function createPadding(string, length, chars) { } var padLength = length - strLength; chars = chars == null ? ' ' : (chars + ''); - return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); + return repeat(chars, nativeCeil(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 index ffe797253ae925..945409f3e1c152 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "lodash._createpadding", - "version": "3.6.0", + "version": "3.6.1", "description": "The modern build of lodash’s internal `createPadding` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -50,11 +50,11 @@ "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", + "_id": "lodash._createpadding@3.6.1", + "_shasum": "4907b438595adc54ee8935527a6c424c02c81a87", + "_from": "lodash._createpadding@3.6.1", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" @@ -63,13 +63,29 @@ { "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": "c466850dd1a05e6bfec54fd0cf0db28b68332d5e", - "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.0.tgz" + "shasum": "4907b438595adc54ee8935527a6c424c02c81a87", + "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.0.tgz", + "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.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..b054ca5a3ac7d6 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/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/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..94491c81e6db90 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 v3.2.2 -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/3.2.2-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..786b6a617e5f2e 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,396 @@ /** - * 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 3.2.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 baseToString = require('lodash._basetostring'), - createPadding = require('lodash._createpadding'); +var repeat = require('lodash.repeat'); -/** 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]', + symbolTag = '[object Symbol]'; + +/** 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 + ']'); + +/** Used to determine if values are of the language type `Object`. */ +var objectTypes = { + 'function': true, + 'object': true +}; + +/** Built-in method references without a dependency on `root`. */ +var freeParseInt = parseInt; + +/** Detect free variable `exports`. */ +var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null; + +/** Detect free variable `module`. */ +var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null; + +/** 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; +} + +/** + * 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 value references. */ +var Symbol = root.Symbol; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeCeil = Math.ceil, + nativeFloor = Math.floor; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = Symbol ? symbolProto.toString : undefined; + +/** + * 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'); +} + +/** + * 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 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); +} + +/** + * 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 Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} /** - * 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 +412,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/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json index 6f028c0cc622d8..bda44d616150f7 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,15 +1,13 @@ { "name": "lodash.pad", - "version": "3.1.0", - "description": "The modern build of lodash’s `_.pad` as a module.", + "version": "3.2.2", + "description": "The lodash method `_.pad` exported as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", "license": "MIT", "keywords": [ - "lodash", "lodash-modularized", - "stdlib", - "util" + "pad" ], "author": { "name": "John-David Dalton", @@ -22,20 +20,10 @@ "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/" + "url": "https://github.com/phated" }, { "name": "Mathias Bynens", @@ -51,34 +39,29 @@ "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, "dependencies": { - "lodash._basetostring": "^3.0.0", - "lodash._createpadding": "^3.0.0" + "lodash.repeat": "^3.0.0" }, "bugs": { "url": "https://github.com/lodash/lodash/issues" }, - "_id": "lodash.pad@3.1.0", - "_shasum": "9f18b1f3749a95e197b5ff2ae752ea9851ada965", + "_id": "lodash.pad@3.2.2", + "_shasum": "fb7fdded36eb773f839ab6b5291dac03cb65c88a", "_from": "lodash.pad@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.3", - "_nodeVersion": "0.12.0", + "_npmVersion": "2.14.15", + "_nodeVersion": "5.4.0", "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" }, + "dist": { + "shasum": "fb7fdded36eb773f839ab6b5291dac03cb65c88a", + "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.2.2.tgz" + }, "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" @@ -88,11 +71,10 @@ "email": "blaine@iceddev.com" } ], - "dist": { - "shasum": "9f18b1f3749a95e197b5ff2ae752ea9851ada965", - "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.0.tgz" + "_npmOperationalInternal": { + "host": "packages-9-west.internal.npmjs.com", + "tmp": "tmp/lodash.pad-3.2.2.tgz_1454484625805_0.547145590884611" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.2.2.tgz" } 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 index 55b0c256f9d1bc..b8e25f6282d084 100644 --- 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 @@ -93,6 +93,5 @@ "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!" + "_resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz" } 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 index 2a40f94bfc3bfd..b8ab0fb942aff9 100644 --- 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 @@ -93,6 +93,5 @@ "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!" + "_resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/LICENSE new file mode 100644 index 00000000000000..b054ca5a3ac7d6 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/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/npmlog/node_modules/gauge/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/README.md new file mode 100644 index 00000000000000..740d5853915be0 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/README.md @@ -0,0 +1,18 @@ +# lodash.repeat v3.2.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/3.2.0-npm-packages/lodash.repeat) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/index.js new file mode 100644 index 00000000000000..d2b8bab59ff227 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/index.js @@ -0,0 +1,306 @@ +/** + * lodash 3.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 root = require('lodash._root'); + +/** 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]', + symbolTag = '[object Symbol]'; + +/** 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 value references. */ +var Symbol = root.Symbol; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeFloor = Math.floor; + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolToString = Symbol ? symbolProto.toString : 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 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 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 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); +} + +/** + * 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 Symbol ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; +} + +/** + * 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.repeat/node_modules/lodash._root/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/LICENSE new file mode 100644 index 00000000000000..bcbe13d67a9621 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/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.repeat/node_modules/lodash._root/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/README.md new file mode 100644 index 00000000000000..0329abf23d6735 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/README.md @@ -0,0 +1,18 @@ +# lodash._root v3.0.1 + +The internal [lodash](https://lodash.com/) function `root` exported as a [Node.js](https://nodejs.org/) module. + +## Installation + +Using npm: +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._root +``` + +In Node.js: +```js +var root = require('lodash._root'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._root) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/index.js new file mode 100644 index 00000000000000..2d8ba0affc4d12 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/index.js @@ -0,0 +1,59 @@ +/** + * lodash 3.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 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; +} + +module.exports = root; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/package.json new file mode 100644 index 00000000000000..c0a3b0bd75e05d --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/node_modules/lodash._root/package.json @@ -0,0 +1,74 @@ +{ + "name": "lodash._root", + "version": "3.0.1", + "description": "The internal lodash function `root` exported 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": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "https://github.com/phated" + }, + { + "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._root@3.0.1", + "_shasum": "fba1c4524c19ee9a5f8136b4609f017cf4ded692", + "_from": "lodash._root@>=3.0.0 <4.0.0", + "_npmVersion": "2.14.18", + "_nodeVersion": "5.5.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "fba1c4524c19ee9a5f8136b4609f017cf4ded692", + "tarball": "http://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine.bublitz@gmail.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/lodash._root-3.0.1.tgz_1455615057559_0.24128212919458747" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/package.json new file mode 100644 index 00000000000000..7f3ea62db99e83 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.repeat/package.json @@ -0,0 +1,81 @@ +{ + "name": "lodash.repeat", + "version": "3.2.0", + "description": "The lodash method `_.repeat` exported as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash-modularized", + "repeat" + ], + "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": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "https://github.com/phated" + }, + { + "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._root": "^3.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.repeat@3.2.0", + "_shasum": "dc97e035dd315580342b434e8a068997395fde7b", + "_from": "lodash.repeat@3.2.0", + "_npmVersion": "2.14.18", + "_nodeVersion": "5.5.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "dist": { + "shasum": "dc97e035dd315580342b434e8a068997395fde7b", + "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.2.0.tgz" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + } + ], + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/lodash.repeat-3.2.0.tgz_1454898646253_0.0884549324400723" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.2.0.tgz", + "readme": "ERROR: No README data found!" +} 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..b4a64f9506dfee 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/package.json @@ -1,6 +1,6 @@ { "name": "gauge", - "version": "1.2.0", + "version": "1.2.5", "description": "A terminal based horizontal guage", "main": "progress-bar.js", "scripts": { @@ -26,7 +26,7 @@ "homepage": "https://github.com/iarna/gauge", "dependencies": { "ansi": "^0.3.0", - "has-unicode": "^1.0.0", + "has-unicode": "^2.0.0", "lodash.pad": "^3.0.0", "lodash.padleft": "^3.0.0", "lodash.padright": "^3.0.0" @@ -34,27 +34,26 @@ "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", + "gitHead": "bd0bb377d121e17d343bba156dd92fe6a8b21581", + "_id": "gauge@1.2.5", + "_shasum": "b80f107dd1f7d3c5a85f5aa74f9e0124caac9da7", + "_from": "gauge@>=1.2.5 <1.3.0", + "_npmVersion": "3.6.0", + "_nodeVersion": "5.4.0", "_npmUser": { "name": "iarna", "email": "me@re-becca.org" }, + "dist": { + "shasum": "b80f107dd1f7d3c5a85f5aa74f9e0124caac9da7", + "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.5.tgz" + }, "maintainers": [ { "name": "iarna", "email": "me@re-becca.org" } ], - "dist": { - "shasum": "3094ab1285633f799814388fc8f2de67b4c012c5", - "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.0.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.5.tgz" } 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..00b3a77e19149b 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 @@ -11,8 +11,10 @@ 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..2b0c4c9e828cb1 100644 --- a/deps/npm/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/npmlog/package.json @@ -6,53 +6,56 @@ }, "name": "npmlog", "description": "logger for npm", - "version": "1.2.1", + "version": "2.0.2", "repository": { "type": "git", - "url": "git://github.com/isaacs/npmlog.git" + "url": "git+https://github.com/npm/npmlog.git" }, "main": "log.js", "scripts": { "test": "tap test/*.js" }, "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.0.6", + "gauge": "~1.2.5" }, "devDependencies": { - "tap": "" + "tap": "~5.1.2" }, "license": "ISC", - "gitHead": "4e1a73a567036064ded425a7d48c863d53550b4f", + "gitHead": "79dc582bf1ce4d2010454d89738a0a4dbd113be9", "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", + "url": "https://github.com/npm/npmlog/issues" + }, + "homepage": "https://github.com/npm/npmlog#readme", + "_id": "npmlog@2.0.2", + "_shasum": "d0470238b9697b7c3c4d16bdea65a00b12a464ab", + "_from": "npmlog@2.0.2", + "_npmVersion": "3.6.0", + "_nodeVersion": "5.4.0", "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" + "name": "iarna", + "email": "me@re-becca.org" }, "dist": { - "shasum": "28e7be619609b53f7ad1dd300a10d64d716268b6", - "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz" + "shasum": "d0470238b9697b7c3c4d16bdea65a00b12a464ab", + "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-2.0.2.tgz" }, "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, { "name": "isaacs", "email": "i@izs.me" }, { - "name": "iarna", - "email": "me@re-becca.org" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-1.2.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.2.tgz" } 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/once/package.json b/deps/npm/node_modules/once/package.json index c85f12ebe1d4fa..dac31323c40212 100644 --- a/deps/npm/node_modules/once/package.json +++ b/deps/npm/node_modules/once/package.json @@ -1,6 +1,6 @@ { "name": "once", - "version": "1.3.2", + "version": "1.3.3", "description": "Run a function exactly one time", "main": "once.js", "directories": { @@ -10,11 +10,14 @@ "wrappy": "1" }, "devDependencies": { - "tap": "~0.3.0" + "tap": "^1.2.0" }, "scripts": { "test": "tap test/*.js" }, + "files": [ + "once.js" + ], "repository": { "type": "git", "url": "git://github.com/isaacs/once.git" @@ -31,30 +34,14 @@ "url": "http://blog.izs.me/" }, "license": "ISC", - "gitHead": "e35eed5a7867574e2bf2260a1ba23970958b22f2", + "readme": "# once\n\nOnly call a function once.\n\n## usage\n\n```javascript\nvar once = require('once')\n\nfunction load (file, cb) {\n cb = once(cb)\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nOr add to the Function.prototype in a responsible way:\n\n```javascript\n// only has to be done once\nrequire('once').proto()\n\nfunction load (file, cb) {\n cb = cb.once()\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nIronically, the prototype feature makes this module twice as\ncomplicated as necessary.\n\nTo check whether you function has been called, use `fn.called`. Once the\nfunction is called for the first time the return value of the original\nfunction is saved in `fn.value` and subsequent calls will continue to\nreturn this value.\n\n```javascript\nvar once = require('once')\n\nfunction load (cb) {\n cb = once(cb)\n var stream = createStream()\n stream.once('data', cb)\n stream.once('end', function () {\n if (!cb.called) cb(new Error('not found'))\n })\n}\n```\n", + "readmeFilename": "README.md", "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" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "readme": "ERROR: No README data found!" + "_id": "once@1.3.3", + "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "_from": "once@>=1.3.3 <1.4.0" } 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/read-installed/node_modules/debuglog/package.json b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json index b622fe92286aca..39fac076703ce0 100644 --- a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json @@ -6,7 +6,7 @@ "main": "debuglog.js", "repository": { "type": "git", - "url": "git+https://github.com/sam-github/node-debuglog.git" + "url": "https://github.com/sam-github/node-debuglog.git" }, "author": { "name": "Sam Roberts", @@ -41,6 +41,5 @@ ], "directories": {}, "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", - "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" } diff --git a/deps/npm/node_modules/read-installed/node_modules/graceful-fs/.npmignore b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/read-installed/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/read-installed/node_modules/graceful-fs/README.md b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/graceful-fs/package.json b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/package.json deleted file mode 100644 index 40b65a3c2e0485..00000000000000 --- a/deps/npm/node_modules/read-installed/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "graceful-fs", - "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" - }, - "directories": { - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "keywords": [ - "fs", - "module", - "reading", - "retry", - "retries", - "queue", - "error", - "errors", - "handling", - "EMFILE", - "EAGAIN", - "EINVAL", - "EPERM", - "EACCESS" - ], - "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@>=2.0.0 <3.0.0||>=3.0.0 <4.0.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" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/read-installed/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/read-installed/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/read-installed/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/read-installed/node_modules/readdir-scoped-modules/.travis.yml b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml new file mode 100644 index 00000000000000..e1bcee1acd90c1 --- /dev/null +++ b/deps/npm/node_modules/read-installed/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/read-installed/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json index c3a39d401f6b3e..d9c7b715554e80 100644 --- 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 @@ -1,6 +1,6 @@ { "name": "readdir-scoped-modules", - "version": "1.0.1", + "version": "1.0.2", "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", "main": "readdir.js", "directories": { @@ -9,11 +9,11 @@ "dependencies": { "debuglog": "^1.0.1", "dezalgo": "^1.0.0", - "graceful-fs": "^3.0.4", + "graceful-fs": "^4.1.2", "once": "^1.3.0" }, "devDependencies": { - "tap": "0.4" + "tap": "^1.2.0" }, "scripts": { "test": "tap test/*.js" @@ -32,30 +32,10 @@ "url": "https://github.com/npm/readdir-scoped-modules/issues" }, "homepage": "https://github.com/npm/readdir-scoped-modules", - "gitHead": "451d38946c5b6b6c0db33a890f33536a11ed79f7", - "_id": "readdir-scoped-modules@1.0.1", - "_shasum": "5c2a77f3e08250a8fddf53fa58cdc17900b808b9", - "_from": "readdir-scoped-modules@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.9", - "_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": "5c2a77f3e08250a8fddf53fa58cdc17900b808b9", - "tarball": "http://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.1.tgz" - }, - "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "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/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index a7e0932169f556..b1b3c5fa5a9fbc 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -1,7 +1,7 @@ { "name": "read-installed", "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "4.0.2", + "version": "4.0.3", "repository": { "type": "git", "url": "git://github.com/isaacs/read-installed.git" @@ -17,10 +17,10 @@ "semver": "2 || 3 || 4 || 5", "slide": "~1.1.3", "util-extend": "^1.0.1", - "graceful-fs": "2 || 3" + "graceful-fs": "^4.1.2" }, "optionalDependencies": { - "graceful-fs": "2 || 3" + "graceful-fs": "^4.1.2" }, "author": { "name": "Isaac Z. Schlueter", @@ -35,12 +35,12 @@ }, "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": "e683eb7f2bb8e9b7b40c1e26192b385b92a3192f", + "gitHead": "da02df6acdb5f5ee31d8c637ef31fb50efb455c1", "bugs": { "url": "https://github.com/isaacs/read-installed/issues" }, "homepage": "https://github.com/isaacs/read-installed#readme", - "_id": "read-installed@4.0.2", - "_shasum": "4e8b18be974ccb75654b28ddcc9aac686404690e", - "_from": "read-installed@>=4.0.2 <4.1.0" + "_id": "read-installed@4.0.3", + "_shasum": "ff9b8b67f187d1e4c29b9feb31f6b223acd19067", + "_from": "read-installed@4.0.3" } diff --git a/deps/npm/node_modules/read-package-json/.travis.yml b/deps/npm/node_modules/read-package-json/.travis.yml new file mode 100644 index 00000000000000..f84676a909a702 --- /dev/null +++ b/deps/npm/node_modules/read-package-json/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' +sudo: false +before_install: + - npm install -g npm@latest 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/fstream/node_modules/graceful-fs/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE similarity index 100% rename from deps/npm/node_modules/fstream/node_modules/graceful-fs/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/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/tools/eslint/node_modules/chalk/node_modules/ansi-styles/license b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license similarity index 100% rename from tools/eslint/node_modules/chalk/node_modules/ansi-styles/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..39372636f3fb4f --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,70 @@ +{ + "name": "path-is-absolute", + "version": "1.0.0", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "_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!" +} 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..19e926cbf1035a --- /dev/null +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/package.json @@ -0,0 +1,73 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "6.0.4", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.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" + }, + "license": "ISC", + "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "_id": "glob@6.0.4", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_from": "glob@>=6.0.0 <7.0.0", + "_npmVersion": "2.14.15", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "readme": "ERROR: No README data found!" +} 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/graceful-fs/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/README.md b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/read-package-json/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/read-package-json/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/read-package-json/node_modules/graceful-fs/package.json b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/package.json deleted file mode 100644 index 349c3d8247e9cc..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - "graceful-fs@2 || 3", - "/Users/isaacs/dev/npm/npm/node_modules/read-package-json" - ] - ], - "_from": "graceful-fs@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/read-package-json/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@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" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@2 || 3", - "_where": "/Users/isaacs/dev/npm/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-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/read-package-json/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/read-package-json/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/read-package-json/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/read-package-json/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/read-package-json/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/read-package-json/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/read-package-json/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/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/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/package.json b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json index bdcdae6b461781..6e66208d9e1504 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,9 @@ } ], "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", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/jju/-/jju-1.2.1.tgz" } 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..19283ecc9dc3ad 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: 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/node_modules/json-parse-helpfulerror/package.json b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/package.json index 9ebc2ff8a6abcf..99d79f71a3e8a9 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/package.json @@ -56,6 +56,5 @@ "tarball": "http://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz" } diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index e83b1f08903104..a607dd06fed061 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -1,6 +1,6 @@ { "name": "read-package-json", - "version": "2.0.0", + "version": "2.0.3", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -9,34 +9,62 @@ "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" + "url": "git+https://github.com/npm/read-package-json.git" }, "main": "read-json.js", "scripts": { "test": "standard && tap test/*.js" }, "dependencies": { - "glob": "^5.0.3", + "glob": "^6.0.0", "json-parse-helpfulerror": "^1.0.2", "normalize-package-data": "^2.0.0", - "graceful-fs": "2 || 3" + "graceful-fs": "^4.1.2" }, "devDependencies": { - "standard": "^3.3.1", - "tap": "^0.7.1" + "standard": "^5.3.1", + "tap": "^1.2.0" }, "optionalDependencies": { - "graceful-fs": "2 || 3" + "graceful-fs": "^4.1.2" }, "license": "ISC", - "gitHead": "1a0476fef4ed8a70b48bfdc90070d897b8ad5469", - "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": "336a212716bb830781d7e71580adaeda377b69d9", "bugs": { - "url": "https://github.com/isaacs/read-package-json/issues" + "url": "https://github.com/npm/read-package-json/issues" }, - "homepage": "https://github.com/isaacs/read-package-json", - "_id": "read-package-json@2.0.0", - "_shasum": "ca7543298275028d27064b9118e6e501c9b3ae41", - "_from": "read-package-json@>=2.0.0 <2.1.0" + "homepage": "https://github.com/npm/read-package-json#readme", + "_id": "read-package-json@2.0.3", + "_shasum": "f8cec1627053b54f384b353224545e607554c5d2", + "_from": "read-package-json@2.0.3", + "_npmVersion": "3.5.4", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "f8cec1627053b54f384b353224545e607554c5d2", + "tarball": "http://registry.npmjs.org/read-package-json/-/read-package-json-2.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-package-json/-/read-package-json-2.0.3.tgz" } diff --git a/deps/npm/node_modules/read-package-json/test/fixtures/badbin.json b/deps/npm/node_modules/read-package-json/test/fixtures/badbin.json index 06c57f43bcbe9f..3eb58d9c114bb0 100644 --- a/deps/npm/node_modules/read-package-json/test/fixtures/badbin.json +++ b/deps/npm/node_modules/read-package-json/test/fixtures/badbin.json @@ -7,5 +7,6 @@ }, "version": "0.0.1", "readme": "hello world", - "bin": "./bin/typo" + "bin": "./bin/typo", + "license": "ISC" } diff --git a/deps/npm/node_modules/read-package-json/test/fixtures/bin.json b/deps/npm/node_modules/read-package-json/test/fixtures/bin.json index d47a5270c6e734..70a26eec712dcd 100644 --- a/deps/npm/node_modules/read-package-json/test/fixtures/bin.json +++ b/deps/npm/node_modules/read-package-json/test/fixtures/bin.json @@ -7,5 +7,6 @@ }, "version": "0.0.1", "readme": "hello world", - "bin": "./bin/echo" + "bin": "./bin/echo", + "license": "ISC" } diff --git a/deps/npm/node_modules/read-package-json/test/fixtures/emptybin.json b/deps/npm/node_modules/read-package-json/test/fixtures/emptybin.json index 5e12ed4e9a75d2..4fbf40075d0aad 100644 --- a/deps/npm/node_modules/read-package-json/test/fixtures/emptybin.json +++ b/deps/npm/node_modules/read-package-json/test/fixtures/emptybin.json @@ -7,5 +7,6 @@ }, "version": "0.0.1", "readme": "hello world", - "bin": {} + "bin": {}, + "license": "ISC" } 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/.npmignore b/deps/npm/node_modules/read/.npmignore deleted file mode 100644 index 0db216bfa4c14a..00000000000000 --- a/deps/npm/node_modules/read/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -npm-debug.log -node_modules diff --git a/deps/npm/node_modules/read/LICENCE b/deps/npm/node_modules/read/LICENCE deleted file mode 100644 index 74489e2e2658e7..00000000000000 --- a/deps/npm/node_modules/read/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/read/example/example.js b/deps/npm/node_modules/read/example/example.js deleted file mode 100644 index cf213bf88e09d4..00000000000000 --- a/deps/npm/node_modules/read/example/example.js +++ /dev/null @@ -1,13 +0,0 @@ -var read = require("../lib/read.js") - -read({prompt: "Username: ", default: "test-user" }, function (er, user) { - read({prompt: "Password: ", default: "test-pass", silent: true }, function (er, pass) { - read({prompt: "Password again: ", default: "test-pass", silent: true }, function (er, pass2) { - console.error({user: user, - pass: pass, - verify: pass2, - passMatch: (pass === pass2)}) - console.error("the program should exit now") - }) - }) -}) diff --git a/deps/npm/node_modules/read/package.json b/deps/npm/node_modules/read/package.json index b424aa3c0cc908..b8357c6315dde0 100644 --- a/deps/npm/node_modules/read/package.json +++ b/deps/npm/node_modules/read/package.json @@ -1,12 +1,12 @@ { "name": "read", - "version": "1.0.6", + "version": "1.0.7", "main": "lib/read.js", "dependencies": { "mute-stream": "~0.0.4" }, "devDependencies": { - "tap": "*" + "tap": "^1.2.0" }, "engines": { "node": ">=0.8" @@ -25,23 +25,26 @@ "scripts": { "test": "tap test/*.js" }, - "gitHead": "2f5101c8e41332a033e5aa4e27e33fd6e09598e2", + "files": [ + "lib/read.js" + ], + "gitHead": "b14516b9236c40140fd0666567f5d0c588a09a62", "bugs": { "url": "https://github.com/isaacs/read/issues" }, "homepage": "https://github.com/isaacs/read#readme", - "_id": "read@1.0.6", - "_shasum": "09873c14ecc114d063fad43b8ca5a33d304721c8", - "_from": "read@1.0.6", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", + "_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": "09873c14ecc114d063fad43b8ca5a33d304721c8", - "tarball": "http://registry.npmjs.org/read/-/read-1.0.6.tgz" + "shasum": "b3da19bd052431a97671d44a42634adf710b40c4", + "tarball": "http://registry.npmjs.org/read/-/read-1.0.7.tgz" }, "maintainers": [ { @@ -50,5 +53,5 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/read/-/read-1.0.6.tgz" + "_resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz" } diff --git a/deps/npm/node_modules/read/rs.js b/deps/npm/node_modules/read/rs.js deleted file mode 100644 index d9f7f48dd61400..00000000000000 --- a/deps/npm/node_modules/read/rs.js +++ /dev/null @@ -1,4 +0,0 @@ -var read = require('read'); -read({ silent: true, prompt: 'stars: ' }, function(er, data) { - console.log(er, data) -}) diff --git a/deps/npm/node_modules/read/test/basic.js b/deps/npm/node_modules/read/test/basic.js deleted file mode 100644 index f0926f3f2ecfc3..00000000000000 --- a/deps/npm/node_modules/read/test/basic.js +++ /dev/null @@ -1,60 +0,0 @@ -var tap = require('tap') -var read = require('../lib/read.js') - -if (process.argv[2] === 'child') { - return child() -} - -var CLOSE = 'close' -if (process.version.match(/^v0\.6/)) { - CLOSE = 'exit' -} - -var spawn = require('child_process').spawn - -tap.test('basic', function (t) { - var child = spawn(process.execPath, [__filename, 'child']) - var output = '' - var write = child.stdin.write.bind(child.stdin) - child.stdout.on('data', function (c) { - console.error('data %s', c) - output += c - if (output.match(/Username: \(test-user\) $/)) { - process.nextTick(write.bind(null, 'a user\n')) - } else if (output.match(/Password: \( @@ -1120,6 +1170,7 @@ 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 @@ -1256,7 +1307,7 @@ cargo.push({name: 'baz'}, function (err) { --------------------------------------- -### auto(tasks, [callback]) +### 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. @@ -1302,6 +1353,7 @@ __Arguments__ 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 @@ -1393,8 +1445,10 @@ result (if any) of the final attempt. __Arguments__ -* `opts` - Can be either an object with `times` and `interval` or a number. `times` is how many attempts should be made before giving up. `interval` is how long to wait inbetween attempts. Defaults to {times: 5, interval: 0} - * if a number is passed in it sets `times` only (with `interval` defaulting to 0). +* `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 @@ -1402,22 +1456,30 @@ __Arguments__ * `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: +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 }); ``` -It can also be embeded within other control flow functions to retry individual methods +```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 @@ -1721,6 +1783,32 @@ async.waterfall([ ], 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); +``` + --------------------------------------- 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..ffac6c287997a7 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json @@ -0,0 +1,50 @@ +{ + "name": "jsbn", + "version": "0.1.0", + "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.", + "main": "index.js", + "scripts": { + "test": "mocha test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/andyperlitch/jsbn.git" + }, + "keywords": [ + "biginteger", + "bignumber", + "big", + "integer" + ], + "author": { + "name": "Tom Wu" + }, + "license": "BSD", + "gitHead": "148a967b112806e63ddeeed78ee7938eef74c84a", + "bugs": { + "url": "https://github.com/andyperlitch/jsbn/issues" + }, + "homepage": "https://github.com/andyperlitch/jsbn", + "_id": "jsbn@0.1.0", + "_shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", + "_from": "jsbn@>=0.1.0 <0.2.0", + "_npmVersion": "2.7.4", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "andyperlitch", + "email": "andyperlitch@gmail.com" + }, + "dist": { + "shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", + "tarball": "http://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + }, + "maintainers": [ + { + "name": "andyperlitch", + "email": "andyperlitch@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", + "readme": "ERROR: No README data found!" +} 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..68282397db2200 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json @@ -0,0 +1,94 @@ +{ + "name": "tweetnacl", + "version": "0.13.3", + "description": "Port of TweetNaCl cryptographic library to JavaScript", + "main": "nacl-fast.js", + "directories": { + "test": "test" + }, + "scripts": { + "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js", + "test": "tape test/*.js | faucet", + "testall": "make -C test/c && tape test/*.js test/c/*.js | faucet", + "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", + "testling": "browserify test/browser/testling_init.js test/*.js | testling | faucet", + "firefox": "browserify test/browser/testling_init.js test/*.js | testling -x firefox | faucet", + "chrome": "browserify test/browser/testling_init.js test/*.js | testling -x google-chrome | faucet", + "bench": "node test/benchmark/bench.js", + "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "chrome/22..latest", + "firefox/16..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6..latest", + "ipad/6..latest", + "android-browser/latest" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/dchest/tweetnacl-js.git" + }, + "keywords": [ + "crypto", + "cryptography", + "curve25519", + "ed25519", + "encrypt", + "hash", + "key", + "nacl", + "poly1305", + "public", + "salsa20", + "signatures" + ], + "author": { + "name": "TweetNaCl-js contributors" + }, + "license": "Public domain", + "bugs": { + "url": "https://github.com/dchest/tweetnacl-js/issues" + }, + "homepage": "https://dchest.github.io/tweetnacl-js", + "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" + }, + "browser": { + "buffer": false, + "crypto": false + }, + "gitHead": "2bb422cb707fba4a5ec9654688564a4fb861b068", + "_id": "tweetnacl@0.13.3", + "_shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", + "_from": "tweetnacl@>=0.13.0 <1.0.0", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.3", + "_npmUser": { + "name": "dchest", + "email": "dmitry@codingrobots.com" + }, + "dist": { + "shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", + "tarball": "http://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz" + }, + "maintainers": [ + { + "name": "dchest", + "email": "dmitry@codingrobots.com" + } + ], + "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz", + "readme": "ERROR: No README data found!" +} 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..aa1366619749cb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json @@ -0,0 +1,96 @@ +{ + "name": "sshpk", + "version": "1.7.3", + "description": "A library for finding and using SSH public keys", + "main": "lib/index.js", + "scripts": { + "test": "tape test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/arekinath/node-sshpk.git" + }, + "author": { + "name": "Joyent, Inc" + }, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Alex Wilson", + "email": "alex@cooperi.net" + } + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/arekinath/node-sshpk/issues" + }, + "engines": { + "node": ">=0.8.0" + }, + "directories": { + "bin": "./bin", + "lib": "./lib", + "man": "./man/man1" + }, + "homepage": "https://github.com/arekinath/node-sshpk#readme", + "dependencies": { + "asn1": ">=0.2.3 <0.3.0", + "assert-plus": ">=0.2.0 <0.3.0", + "dashdash": ">=1.10.1 <2.0.0", + "jsbn": ">=0.1.0 <0.2.0", + "tweetnacl": ">=0.13.0 <1.0.0", + "jodid25519": ">=1.0.0 <2.0.0", + "ecc-jsbn": ">=0.0.1 <1.0.0" + }, + "optionalDependencies": { + "jsbn": ">=0.1.0 <0.2.0", + "tweetnacl": ">=0.13.0 <1.0.0", + "jodid25519": ">=1.0.0 <2.0.0", + "ecc-jsbn": ">=0.0.1 <1.0.0" + }, + "devDependencies": { + "tape": ">=3.5.0 <4.0.0", + "benchmark": ">=1.0.0 <2.0.0", + "sinon": ">=1.17.2 <2.0.0", + "temp": "0.8.2" + }, + "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" + ], + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "gitHead": "3d98bfc22bb1c09f0747244acbb408f3ca9448b5", + "_id": "sshpk@1.7.3", + "_shasum": "caa8ef95e30765d856698b7025f9f211ab65962f", + "_from": "sshpk@>=1.7.0 <2.0.0", + "_npmVersion": "2.14.9", + "_nodeVersion": "0.12.9", + "_npmUser": { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + "dist": { + "shasum": "caa8ef95e30765d856698b7025f9f211ab65962f", + "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz" + }, + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + } + ], + "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz", + "readme": "ERROR: No README data found!" +} 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..d7463088a62447 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,7 +1,7 @@ { "name": "http-signature", "description": "Reference implementation of Joyent's HTTP Signature scheme.", - "version": "0.11.0", + "version": "1.1.1", "license": "MIT", "author": { "name": "Joyent, Inc" @@ -33,32 +33,41 @@ "request" ], "engines": { - "node": ">=0.8" + "node": ">=0.8", + "npm": ">=1.3.7" }, "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" }, "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", + "gitHead": "74d3f35e3aa436d83723c53b01e266f448e8149a", + "_id": "http-signature@1.1.1", + "_shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf", + "_from": "http-signature@>=1.1.0 <1.2.0", + "_npmVersion": "2.14.9", + "_nodeVersion": "0.12.9", "_npmUser": { - "name": "pfmooney", - "email": "patrick.f.mooney@gmail.com" + "name": "arekinath", + "email": "alex@cooperi.net" + }, + "dist": { + "shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf", + "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" }, "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + }, { "name": "mcavage", "email": "mcavage@gmail.com" @@ -68,10 +77,7 @@ "email": "patrick.f.mooney@gmail.com" } ], - "dist": { - "shasum": "1796cf67a001ad5cd6849dca0991485f09089fe6", - "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.11.0.tgz" - }, "directories": {}, + "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/tools/eslint/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/request/node_modules/is-typedarray/LICENSE.md 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/request/node_modules/is-typedarray/LICENSE.md 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..861ef4f7c29711 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/package.json @@ -0,0 +1,57 @@ +{ + "name": "is-typedarray", + "version": "1.0.0", + "description": "Detect whether or not an object is a Typed Array", + "main": "index.js", + "scripts": { + "test": "node test" + }, + "author": { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", + "url": "http://hughsk.io/" + }, + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "tape": "^2.13.1" + }, + "repository": { + "type": "git", + "url": "git://github.com/hughsk/is-typedarray.git" + }, + "keywords": [ + "typed", + "array", + "detect", + "is", + "util" + ], + "bugs": { + "url": "https://github.com/hughsk/is-typedarray/issues" + }, + "homepage": "https://github.com/hughsk/is-typedarray", + "gitHead": "0617cfa871686cf541af62b144f130488f44f6fe", + "_id": "is-typedarray@1.0.0", + "_shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", + "_from": "is-typedarray@>=1.0.0 <1.1.0", + "_npmVersion": "2.7.5", + "_nodeVersion": "0.10.36", + "_npmUser": { + "name": "hughsk", + "email": "hughskennedy@gmail.com" + }, + "dist": { + "shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", + "tarball": "http://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "hughsk", + "email": "hughskennedy@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} 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..85cb14c9cbe00a 100644 --- a/deps/npm/node_modules/request/node_modules/isstream/package.json +++ b/deps/npm/node_modules/request/node_modules/isstream/package.json @@ -36,7 +36,7 @@ "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc", "_id": "isstream@0.1.2", "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", - "_from": "isstream@>=0.1.1 <0.2.0", + "_from": "isstream@>=0.1.2 <0.2.0", "_npmVersion": "2.6.1", "_nodeVersion": "1.4.3", "_npmUser": { 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..ccd55b008dfa64 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 @@ -41,7 +41,7 @@ "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5", "_id": "json-stringify-safe@5.0.1", "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "_from": "json-stringify-safe@>=5.0.0 <5.1.0", + "_from": "json-stringify-safe@>=5.0.1 <5.1.0", "_npmVersion": "2.10.0", "_nodeVersion": "2.0.1", "_npmUser": { 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 c5b8f5f133ff1e..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,39 @@ +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 +================== + + * deps: mime-db@~1.19.0 + - Add new mime types + +2.1.6 / 2015-09-03 +================== + + * deps: mime-db@~1.18.0 + - Add new mime types + +2.1.5 / 2015-08-20 +================== + + * deps: mime-db@~1.17.0 + - Add new mime types + +2.1.4 / 2015-07-30 +================== + + * deps: mime-db@~1.16.0 + - Add new mime types + 2.1.3 / 2015-07-13 ================== diff --git a/deps/npm/node_modules/request/node_modules/mime-types/index.js b/deps/npm/node_modules/request/node_modules/mime-types/index.js index 9edf72b75e9fef..f7008b246d1e4c 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/index.js +++ b/deps/npm/node_modules/request/node_modules/mime-types/index.js @@ -177,7 +177,7 @@ function populateMaps(extensions, types) { if (types[extension] !== 'application/octet-stream' && from > to || (from === to && types[extension].substr(0, 12) === 'application/')) { // skip the remapping - return + continue } } 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 fa40614d9c8caf..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,68 @@ +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 +=================== + + * Add `application/vnd.3gpp-prose-pc3ch+xml` + * Add `application/vnd.3gpp.srvcc-info+xml` + * Add `application/vnd.apple.pkpass` + * Add `application/vnd.drive+json` + +1.18.0 / 2015-09-03 +=================== + + * Add `application/pkcs12` + * Add `application/vnd.3gpp-prose+xml` + * Add `application/vnd.3gpp.mid-call+xml` + * Add `application/vnd.3gpp.state-and-event-info+xml` + * Add `application/vnd.anki` + * Add `application/vnd.firemonkeys.cloudcell` + * Add `application/vnd.openblox.game+xml` + * Add `application/vnd.openblox.game-binary` + +1.17.0 / 2015-08-13 +=================== + + * Add `application/x-msdos-program` + * Add `audio/g711-0` + * Add `image/vnd.mozilla.apng` + * Add extension `.exe` to `application/x-msdos-program` + +1.16.0 / 2015-07-29 +=================== + + * Add `application/vnd.uri-map` + 1.15.0 / 2015-07-13 =================== 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 2f2dc448eb522f..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"] @@ -768,6 +790,9 @@ "source": "iana", "extensions": ["p10"] }, + "application/pkcs12": { + "source": "iana" + }, "application/pkcs7-mime": { "source": "iana", "extensions": ["p7m","p7c"] @@ -879,6 +904,9 @@ "source": "iana", "extensions": ["rld"] }, + "application/rfc+xml": { + "source": "iana" + }, "application/riscos": { "source": "iana" }, @@ -1148,9 +1176,21 @@ "application/vividence.scriptfile": { "source": "apache" }, + "application/vnd.3gpp-prose+xml": { + "source": "iana" + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + "source": "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana" + }, "application/vnd.3gpp.bsf+xml": { "source": "iana" }, + "application/vnd.3gpp.mid-call+xml": { + "source": "iana" + }, "application/vnd.3gpp.pic-bw-large": { "source": "iana", "extensions": ["plb"] @@ -1166,6 +1206,15 @@ "application/vnd.3gpp.sms": { "source": "iana" }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana" + }, + "application/vnd.3gpp.srvcc-info+xml": { + "source": "iana" + }, + "application/vnd.3gpp.state-and-event-info+xml": { + "source": "iana" + }, "application/vnd.3gpp.ussd+xml": { "source": "iana" }, @@ -1263,6 +1312,9 @@ "compressible": false, "extensions": ["apk"] }, + "application/vnd.anki": { + "source": "iana" + }, "application/vnd.anser-web-certificate-issue-initiation": { "source": "iana", "extensions": ["cii"] @@ -1296,6 +1348,10 @@ "source": "iana", "extensions": ["m3u8"] }, + "application/vnd.apple.pkpass": { + "compressible": false, + "extensions": ["pkpass"] + }, "application/vnd.arastra.swi": { "source": "iana" }, @@ -1568,6 +1624,10 @@ "source": "iana", "extensions": ["dfac"] }, + "application/vnd.drive+json": { + "source": "iana", + "compressible": true + }, "application/vnd.ds-keypoint": { "source": "apache", "extensions": ["kpxx"] @@ -1813,9 +1873,15 @@ "application/vnd.ffsns": { "source": "iana" }, + "application/vnd.filmit.zfc": { + "source": "iana" + }, "application/vnd.fints": { "source": "iana" }, + "application/vnd.firemonkeys.cloudcell": { + "source": "iana" + }, "application/vnd.flographit": { "source": "iana", "extensions": ["gph"] @@ -1942,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, @@ -2359,6 +2437,9 @@ "source": "iana", "extensions": ["portpkg"] }, + "application/vnd.mapbox-vector-tile": { + "source": "iana" + }, "application/vnd.marlin.drm.actiontoken+xml": { "source": "iana" }, @@ -2600,6 +2681,9 @@ "source": "iana", "extensions": ["potm"] }, + "application/vnd.ms-printdevicecapabilities+xml": { + "source": "iana" + }, "application/vnd.ms-printing.printticket+xml": { "source": "apache" }, @@ -2610,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" }, @@ -3028,6 +3121,12 @@ "application/vnd.omaloc-supl-init": { "source": "iana" }, + "application/vnd.openblox.game+xml": { + "source": "iana" + }, + "application/vnd.openblox.game-binary": { + "source": "iana" + }, "application/vnd.openeye.oeb": { "source": "iana" }, @@ -3305,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"] @@ -3758,6 +3864,9 @@ "application/vnd.tmd.mediaflex.api+xml": { "source": "iana" }, + "application/vnd.tml": { + "source": "iana" + }, "application/vnd.tmobile-livetv": { "source": "iana", "extensions": ["tmo"] @@ -3839,6 +3948,9 @@ "application/vnd.uplanet.signal": { "source": "iana" }, + "application/vnd.uri-map": { + "source": "iana" + }, "application/vnd.valve.source.material": { "source": "iana" }, @@ -4385,6 +4497,9 @@ "source": "apache", "extensions": ["clp"] }, + "application/x-msdos-program": { + "extensions": ["exe"] + }, "application/x-msdownload": { "source": "apache", "extensions": ["exe","dll","com","bat","msi"] @@ -4816,9 +4931,15 @@ "audio/evrcwb1": { "source": "iana" }, + "audio/evs": { + "source": "iana" + }, "audio/fwdred": { "source": "iana" }, + "audio/g711-0": { + "source": "iana" + }, "audio/g719": { "source": "iana" }, @@ -5405,6 +5526,9 @@ "image/vnd.mix": { "source": "iana" }, + "image/vnd.mozilla.apng": { + "source": "iana" + }, "image/vnd.ms-modi": { "source": "iana", "extensions": ["mdi"] @@ -6082,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 a07ee866a76cab..e6c973296cda56 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,7 @@ { "name": "mime-db", "description": "Media Type Database", - "version": "1.15.0", + "version": "1.21.0", "contributors": [ { "name": "Douglas Christopher Wilson", @@ -33,15 +33,15 @@ "url": "git+https://github.com/jshttp/mime-db.git" }, "devDependencies": { - "bluebird": "2.9.33", + "bluebird": "3.1.1", "co": "4.6.0", "cogent": "1.0.1", - "csv-parse": "0.1.3", + "csv-parse": "1.0.1", "gnode": "0.1.1", - "istanbul": "0.3.17", + "istanbul": "0.4.1", "mocha": "1.21.5", - "raw-body": "2.1.2", - "stream-to-array": "2" + "raw-body": "2.1.5", + "stream-to-array": "2.2.0" }, "files": [ "HISTORY.md", @@ -61,14 +61,14 @@ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", "update": "npm run fetch && npm run build" }, - "gitHead": "96922b79fcaacf8c2a95ce3368739ec71c9471a2", + "gitHead": "9ab92f0a912a602408a64db5741dfef6f82c597f", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" }, "homepage": "https://github.com/jshttp/mime-db", - "_id": "mime-db@1.15.0", - "_shasum": "d219e6214bbcae23a6fa69c0868c4fadc1405e8a", - "_from": "mime-db@>=1.15.0 <1.16.0", + "_id": "mime-db@1.21.0", + "_shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac", + "_from": "mime-db@>=1.21.0 <1.22.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", @@ -85,10 +85,10 @@ } ], "dist": { - "shasum": "d219e6214bbcae23a6fa69c0868c4fadc1405e8a", - "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.15.0.tgz" + "shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac", + "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.15.0.tgz", + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz", "readme": "ERROR: No README data found!" } 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 4fbb21420e7ec7..ff5993558151da 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,7 @@ { "name": "mime-types", "description": "The ultimate javascript content-type utility.", - "version": "2.1.3", + "version": "2.1.9", "contributors": [ { "name": "Douglas Christopher Wilson", @@ -28,10 +28,10 @@ "url": "git+https://github.com/jshttp/mime-types.git" }, "dependencies": { - "mime-db": "~1.15.0" + "mime-db": "~1.21.0" }, "devDependencies": { - "istanbul": "0.3.17", + "istanbul": "0.4.1", "mocha": "~1.21.5" }, "files": [ @@ -47,14 +47,14 @@ "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": "565c49ad5683d4a123a170da3444ed32ce426c3a", + "gitHead": "329f1c77e1a77c8fac59b15038e3808e9e314d96", "bugs": { "url": "https://github.com/jshttp/mime-types/issues" }, "homepage": "https://github.com/jshttp/mime-types", - "_id": "mime-types@2.1.3", - "_shasum": "f259849c7eb1f85b8f5f826187278a7f74f0c966", - "_from": "mime-types@>=2.1.2 <2.2.0", + "_id": "mime-types@2.1.9", + "_shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8", + "_from": "mime-types@>=2.1.7 <2.2.0", "_npmVersion": "1.4.28", "_npmUser": { "name": "dougwilson", @@ -75,10 +75,10 @@ } ], "dist": { - "shasum": "f259849c7eb1f85b8f5f826187278a7f74f0c966", - "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.3.tgz" + "shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8", + "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.3.tgz", + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz", "readme": "ERROR: No README data found!" } 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/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/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..473b25a8ff52ae 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,81 @@ { - "name": "node-uuid", - "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url": "http://github.com/broofa/node-uuid", - "keywords": [ - "uuid", - "guid", - "rfc4122" - ], "author": { "name": "Robert Kieffer", "email": "robert@broofa.com" }, + "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" - }, - "scripts": { - "test": "node test/test.js" + "dependencies": {}, + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "devDependencies": { + "nyc": "^2.2.0" }, + "directories": {}, + "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" } ], + "name": "node-uuid", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/broofa/node-uuid.git" + }, + "scripts": { + "coverage": "nyc npm test && nyc report", + "test": "node test/test.js" + }, + "url": "http://github.com/broofa/node-uuid", + "version": "1.4.7", + "gitHead": "309512573ec1c60143c257157479a20f7f1f51cd", + "_id": "node-uuid@1.4.7", + "_shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", + "_from": "node-uuid@>=1.4.7 <1.5.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "coolaj86", + "email": "coolaj86@gmail.com" + }, "dist": { - "shasum": "319bb7a56e7cb63f00b5c0cd7851cd4b4ddf1df9", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz" + "shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", + "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz", + "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", "readme": "ERROR: No README data found!" } 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/index.js b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js index a587541dc577e6..b7fc0aceea2410 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 @@ -132,3 +132,4 @@ exports.rsasign = rsasign exports.plaintext = plaintext exports.sign = sign exports.rfc3986 = rfc3986 +exports.generateBase = generateBase diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json index eeaaa68d3596ce..70c01e2f053b3e 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json @@ -6,7 +6,7 @@ }, "name": "oauth-sign", "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", - "version": "0.8.0", + "version": "0.8.1", "license": "Apache-2.0", "repository": { "url": "git+https://github.com/mikeal/oauth-sign.git" @@ -21,20 +21,24 @@ "scripts": { "test": "node test.js" }, - "gitHead": "e1f2b42ff039901ce977f8e81918767d97d496b5", + "gitHead": "9c7229a336c9face98b83f93b72cb7c80dbba08d", "bugs": { "url": "https://github.com/mikeal/oauth-sign/issues" }, "homepage": "https://github.com/mikeal/oauth-sign#readme", - "_id": "oauth-sign@0.8.0", - "_shasum": "938fdc875765ba527137d8aec9d178e24debc553", + "_id": "oauth-sign@0.8.1", + "_shasum": "182439bdb91378bf7460e75c64ea43e6448def06", "_from": "oauth-sign@>=0.8.0 <0.9.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", + "_npmVersion": "3.6.0", + "_nodeVersion": "5.5.0", "_npmUser": { "name": "simov", "email": "simeonvelichkov@gmail.com" }, + "dist": { + "shasum": "182439bdb91378bf7460e75c64ea43e6448def06", + "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz" + }, "maintainers": [ { "name": "mikeal", @@ -49,11 +53,7 @@ "email": "simeonvelichkov@gmail.com" } ], - "dist": { - "shasum": "938fdc875765ba527137d8aec9d178e24debc553", - "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz", + "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/node_modules/qs/.npmignore b/deps/npm/node_modules/request/node_modules/qs/.npmignore index 2abba8d25ae709..7e1574dc5c3c81 100644 --- a/deps/npm/node_modules/request/node_modules/qs/.npmignore +++ b/deps/npm/node_modules/request/node_modules/qs/.npmignore @@ -16,4 +16,3 @@ config.json coverage.* lib-cov complexity.md -dist 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 f50217888e8bad..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,6 +1,69 @@ language: node_js - node_js: - - 0.10 - - 0.12 - - iojs + - "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 1fadc78eedd9bd..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,88 +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. -## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=open) -- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" - -## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed) -- [**#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 -- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties -- [**#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 - -## [**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 - -## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed) -- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option - -## [**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 - -## [**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.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.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.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.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.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.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.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.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.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.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 - -## [**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 - -## [**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 - -## [**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 - -## [**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.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 +## [**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 + +## [**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 + +## [**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 + +## [**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 + +## [**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 + +## [**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 + +## [**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" + +## [**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.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.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.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.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.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.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.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.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.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.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.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 + +## [**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? + +## [**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 + +## [**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.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.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 index 48a0de97fc6a55..335eafb4be5a72 100644 --- a/deps/npm/node_modules/request/node_modules/qs/Readme.md +++ b/deps/npm/node_modules/request/node_modules/qs/Readme.md @@ -2,76 +2,82 @@ 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) +[![Build Status](https://api.travis-ci.org/ljharb/qs.svg)](http://travis-ci.org/ljharb/qs) -Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) +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 qs = require('qs'); +var assert = require('assert'); -var obj = Qs.parse('a=c'); // { a: 'c' } -var str = Qs.stringify(obj); // 'a=c' +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.parse(string, [options]); ``` -**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`, or prefixing the sub-key with a dot `.`. +**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 -Qs.parse('a.hasOwnProperty=b', { plainObjects: true }); -// { a: { hasOwnProperty: 'b' } } +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 -Qs.parse('a.hasOwnProperty=b', { allowPrototypes: true }); -// { a: { hasOwnProperty: 'b' } } +var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); +assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); ``` URI encoded strings work too: ```javascript -Qs.parse('a%5Bb%5D=c'); -// { a: { b: 'c' } } +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: { @@ -85,14 +91,16 @@ By default, when nesting objects **qs** will only parse up to 5 children deep. T } } } -} +}; +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])`: +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' } } } +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. @@ -100,29 +108,29 @@ The depth limit helps mitigate abuse when **qs** is used to parse user input, an 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' } +var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); +assert.deepEqual(limited, { a: 'b' }); ``` An optional delimiter can also be passed: ```javascript -Qs.parse('a=b;c=d', { delimiter: ';' }); -// { a: 'b', c: 'd' } +var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); +assert.deepEqual(delimited, { 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' } +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 disable dot notation: +Option `allowDots` can be used to enable dot notation: ```javascript -Qs.parse('a.b=c', { allowDots: false }); -// { 'a.b': 'c' } } +var withDots = qs.parse('a.b=c', { allowDots: true }); +assert.deepEqual(withDots, { a: { b: 'c' } }); ``` ### Parsing Arrays @@ -130,15 +138,15 @@ Qs.parse('a.b=c', { allowDots: false }); **qs** can also parse arrays using a similar `[]` notation: ```javascript -Qs.parse('a[]=b&a[]=c'); -// { a: ['b', 'c'] } +var withArray = qs.parse('a[]=b&a[]=c'); +assert.deepEqual(withArray, { a: ['b', 'c'] }); ``` You may specify an index as well: ```javascript -Qs.parse('a[1]=c&a[0]=b'); -// { a: ['b', 'c'] } +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 @@ -146,68 +154,75 @@ to create an array. When creating arrays with specific indices, **qs** will comp their order: ```javascript -Qs.parse('a[1]=b&a[15]=c'); -// { a: ['b', 'c'] } +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 -Qs.parse('a[]=&a[]=b'); -// { a: ['', 'b'] } -Qs.parse('a[0]=b&a[1]=&a[2]=c'); -// { a: ['b', '', 'c'] } +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 -Qs.parse('a[100]=b'); -// { a: { '100': 'b' } } +var withMaxIndex = qs.parse('a[100]=b'); +assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); ``` This limit can be overridden by passing an `arrayLimit` option: ```javascript -Qs.parse('a[1]=b', { arrayLimit: 0 }); -// { a: { '1': 'b' } } +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 -Qs.parse('a[]=b', { parseArrays: false }); -// { a: { '0': 'b' } } +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 -Qs.parse('a[0]=b&a[b]=c'); -// { a: { '0': 'b', b: 'c' } } +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 -Qs.parse('a[][b]=c'); -// { a: [{ b: 'c' }] } +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 -Qs.stringify(object, [options]); +assert.equal(qs.stringify({ a: 'b' }), 'a=b'); +assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); ``` -When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect: +This encoding can be disabled by setting the `encode` option to `false`: ```javascript -Qs.stringify({ a: 'b' }); -// 'a=b' -Qs.stringify({ a: { b: 'c' } }); -// 'a%5Bb%5D=c' +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. @@ -215,47 +230,44 @@ Examples beyond this point will be shown as though the output is not URI encoded When arrays are stringified, by default they are given explicit indices: ```javascript -Qs.stringify({ a: ['b', 'c', 'd'] }); +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 }); +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' }) +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) // 'a[0]=b&a[1]=c' -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) // 'a[]=b&a[]=c' -Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +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=' +assert.equal(qs.stringify({ a: '' }), 'a='); ``` Properties that are set to `undefined` will be omitted entirely: ```javascript -Qs.stringify({ a: null, b: undefined }); -// 'a=' +assert.equal(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' +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. @@ -276,11 +288,11 @@ function filterFunc(prefix, value) { } return value; } -Qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }) +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'] }) +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] }) +qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); // 'a[0]=b&a[2]=d' ``` @@ -289,29 +301,35 @@ Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }) By default, `null` values are treated like empty strings: ```javascript -Qs.stringify({ a: null, b: '' }); -// 'a=&b=' +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 -Qs.parse('a&b=') -// { a: '', b: '' } +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 -Qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); -// 'a&b=' +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 -Qs.parse('a&b=', { strictNullHandling: true }); -// { a: null, b: '' } +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/bower.json b/deps/npm/node_modules/request/node_modules/qs/bower.json index ffd0641d8b7f42..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": "3.0.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 new file mode 100644 index 00000000000000..fca856a631ae37 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/qs/component.json @@ -0,0 +1,15 @@ +{ + "name": "qs", + "repository": "hapijs/qs", + "description": "query-string parser / stringifier with nesting support", + "version": "5.2.0", + "keywords": ["querystring", "query", "parser"], + "main": "lib/index.js", + "scripts": [ + "lib/index.js", + "lib/parse.js", + "lib/stringify.js", + "lib/utils.js" + ], + "license": "BSD-3-Clause" +} 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 new file mode 100644 index 00000000000000..68433d45a8022d --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js @@ -0,0 +1,475 @@ +(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) + ) { + obj = []; + obj[index] = internals.parseObject(chain, val, options); + } else { + obj[cleanRoot] = internals.parseObject(chain, val, options); + } + } + + return obj; +}; + +internals.parseKeys = function (givenKey, val, options) { + if (!givenKey) { + return; + } + + // Transform dot notation to bracket notation + var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey; + + // The regex chunks + + var parent = /^([^\[\]]*)/; + var child = /(\[[^\[\]]*\])/g; + + // Get the parent + + var segment = parent.exec(key); + + // Stash the parent if it exists + + var keys = []; + 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.allowPrototypes) { + return; + } + } + + keys.push(segment[1]); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + i += 1; + if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + if (!options.allowPrototypes) { + continue; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return internals.parseObject(keys, val, 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; + options.parseArrays = options.parseArrays !== false; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; + + if ( + str === '' || + str === null || + typeof str === 'undefined' + ) { + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + 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); + } + + return Utils.compact(obj); +}; + +},{"./utils":4}],3:[function(require,module,exports){ +'use strict'; + +var Utils = require('./utils'); + +var internals = { + delimiter: '&', + arrayPrefixGenerators: { + brackets: function (prefix) { + return prefix + '[]'; + }, + indices: function (prefix, key) { + return prefix + '[' + key + ']'; + }, + repeat: function (prefix) { + return prefix; + } + }, + strictNullHandling: false, + skipNulls: false, + encode: true +}; + +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 = String(obj); + } else if (obj instanceof Date) { + obj = obj.toISOString(); + } else if (obj === null) { + if (strictNullHandling) { + return encode ? Utils.encode(prefix) : prefix; + } + + 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 = []; + + if (typeof obj === 'undefined') { + return values; + } + + 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 (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 { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + } + } + + return values; +}; + +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)) { + objKeys = filter = options.filter; + } + + var keys = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + var arrayFormat; + if (options.arrayFormat in internals.arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (sort) { + objKeys.sort(sort); + } + + 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, sort)); + } + + return keys.join(delimiter); +}; + +},{"./utils":4}],4:[function(require,module,exports){ +'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(); + } + + return array; +}()); + +exports.arrayToObject = function (source, options) { + var obj = options.plainObjects ? Object.create(null) : {}; + for (var i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +}; + +exports.merge = function (target, source, options) { + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } else if (typeof target === 'object') { + target[source] = true; + } else { + return [target, source]; + } + + return target; + } + + if (typeof target !== 'object') { + return [target].concat(source); + } + + var mergeTarget = target; + if (Array.isArray(target) && !Array.isArray(source)) { + mergeTarget = exports.arrayToObject(target, options); + } + + return Object.keys(source).reduce(function (acc, key) { + var value = source[key]; + + if (Object.prototype.hasOwnProperty.call(acc, key)) { + acc[key] = exports.merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +}; + +exports.decode = function (str) { + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return 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; + } + + var string = typeof str === 'string' ? str : String(str); + + var out = ''; + for (var i = 0; i < string.length; ++i) { + var c = string.charCodeAt(i); + + 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 += string.charAt(i); + continue; + } + + if (c < 0x80) { + out = out + hexTable[c]; + continue; + } + + if (c < 0x800) { + out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + continue; + } + + 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, references) { + if (typeof obj !== 'object' || obj === null) { + return obj; + } + + var refs = references || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0; i < obj.length; ++i) { + if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + 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') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +}; + +},{}]},{},[1])(1) +}); \ No newline at end of file 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 e7c56c5ce62cb5..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, @@ -12,16 +9,15 @@ var internals = { parameterLimit: 1000, strictNullHandling: false, plainObjects: false, - allowPrototypes: false + allowPrototypes: false, + 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; @@ -31,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; } } } @@ -48,9 +42,7 @@ internals.parseValues = function (str, options) { return obj; }; - internals.parseObject = function (chain, val, options) { - if (!chain.length) { return val; } @@ -61,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); } } @@ -85,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 @@ -113,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; } @@ -128,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; } @@ -149,24 +128,23 @@ 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; options.parseArrays = options.parseArrays !== false; - options.allowDots = options.allowDots !== false; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; 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) : {}; } @@ -176,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 7414284c57e969..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,54 +1,46 @@ -// 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 = []; @@ -57,53 +49,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'; } @@ -112,9 +111,19 @@ 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); 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 4c45772df66dcd..285b2b185e7b34 100644 --- a/deps/npm/node_modules/request/node_modules/qs/package.json +++ b/deps/npm/node_modules/request/node_modules/qs/package.json @@ -1,57 +1,79 @@ { "name": "qs", - "version": "4.0.0", "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "homepage": "https://github.com/hapijs/qs", - "main": "lib/index.js", - "dependencies": {}, - "devDependencies": { - "browserify": "^10.2.1", - "code": "1.x.x", - "lab": "5.x.x" - }, - "scripts": { - "test": "lab -a code -t 100 -L", - "test-cov-html": "lab -a code -r html -o coverage.html", - "dist": "browserify --standalone Qs lib/index.js > dist/qs.js" - }, + "homepage": "https://github.com/ljharb/qs", + "version": "6.0.2", "repository": { "type": "git", - "url": "git+https://github.com/hapijs/qs.git" + "url": "git+https://github.com/ljharb/qs.git" }, + "main": "lib/index.js", + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], "keywords": [ "querystring", "qs" ], + "engines": { + "node": ">=0.6" + }, + "dependencies": {}, + "devDependencies": { + "browserify": "^12.0.1", + "tape": "^4.3.0", + "covert": "^1.1.0", + "mkdirp": "^0.5.1", + "eslint": "^1.10.3", + "@ljharb/eslint-config": "^1.6.1", + "parallelshell": "^2.0.0", + "evalmd": "^0.0.16" + }, + "scripts": { + "test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'", + "tests-only": "node test", + "readme": "evalmd README.md", + "lint": "eslint lib/*.js text/*.js", + "coverage": "covert test", + "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", + "prepublish": "npm run dist" + }, "license": "BSD-3-Clause", - "gitHead": "e573dd08eae6cce30d2202704691a102dfa3782a", + "gitHead": "47dfbd6740b3cc1593847825701c8aa136f636e3", "bugs": { - "url": "https://github.com/hapijs/qs/issues" + "url": "https://github.com/ljharb/qs/issues" }, - "_id": "qs@4.0.0", - "_shasum": "c31d9b74ec27df75e543a86c78728ed8d4623607", - "_from": "qs@>=4.0.0 <4.1.0", - "_npmVersion": "2.12.0", - "_nodeVersion": "0.12.4", + "_id": "qs@6.0.2", + "_shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd", + "_from": "qs@>=6.0.2 <6.1.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.4.1", "_npmUser": { - "name": "nlf", - "email": "quitlahok@gmail.com" + "name": "ljharb", + "email": "ljharb@gmail.com" }, "dist": { - "shasum": "c31d9b74ec27df75e543a86c78728ed8d4623607", - "tarball": "http://registry.npmjs.org/qs/-/qs-4.0.0.tgz" + "shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd", + "tarball": "http://registry.npmjs.org/qs/-/qs-6.0.2.tgz" }, "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-4.0.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/qs/-/qs-6.0.2.tgz" } 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 a19d7645784d0e..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 disabling dot notation', function (done) { - - expect(Qs.parse('a.b=c')).to.deep.equal({ a: { b: 'c' } }); - expect(Qs.parse('a.b=c', { allowDots: false })).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')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); - expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); - expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz')).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); - expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2')).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')).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] }); - 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' }] }); - 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); + 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 48b7803f7dea8a..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,259 +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 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 nulls when asked', function (st) { + st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b'); + 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('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('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('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('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('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('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('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('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('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 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 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 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 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 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 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('stringifies a complicated object', function (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(); + }); - expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); - 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 an empty value', function (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(); + }); - 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) { + t.test('drops keys with a value of undefined', function (st) { + st.equal(qs.stringify({ a: undefined }), ''); - expect(Qs.stringify({ a: undefined })).to.equal(''); - - 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; - expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d'); + var result = qs.stringify({ a: 'b', c: 'd' }); global.Buffer = tempBuffer; - 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(); + }); + + 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(); + }); + 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..39474baa0b5ef2 100644 --- a/deps/npm/node_modules/request/node_modules/stringstream/package.json +++ b/deps/npm/node_modules/request/node_modules/stringstream/package.json @@ -1,6 +1,6 @@ { "name": "stringstream", - "version": "0.0.4", + "version": "0.0.5", "description": "Encode and decode streams into string streams", "author": { "name": "Michael Hart", @@ -19,14 +19,17 @@ "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" + "gitHead": "1efe3bf507bf3a1161f8473908b60e881d41422b", + "bugs": { + "url": "https://github.com/mhart/StringStream/issues" }, - "_npmVersion": "1.2.0", + "homepage": "https://github.com/mhart/StringStream#readme", + "_id": "stringstream@0.0.5", + "scripts": {}, + "_shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "_from": "stringstream@>=0.0.4 <0.1.0", + "_npmVersion": "2.14.8", + "_nodeVersion": "4.2.1", "_npmUser": { "name": "hichaelmart", "email": "michael.hart.au@gmail.com" @@ -37,12 +40,11 @@ "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" + "dist": { + "shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" }, - "homepage": "https://github.com/mhart/StringStream#readme" + "directories": {}, + "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "readme": "ERROR: No README data found!" } 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..5fd5510a12ac53 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 @@ -3,6 +3,26 @@ "name": "Jeremy Stashewsky", "email": "jstashewsky@salesforce.com" }, + "contributors": [ + { + "name": "Alexander Savin" + }, + { + "name": "Ian Livingstone" + }, + { + "name": "Ivan Nikulin" + }, + { + "name": "Lalit Kapoor" + }, + { + "name": "Sam Thompson" + }, + { + "name": "Sebastian Mayr" + } + ], "license": "BSD-3-Clause", "name": "tough-cookie", "description": "RFC6265 Cookies and Cookie Jar for node.js", @@ -16,7 +36,7 @@ "RFC6265", "RFC2965" ], - "version": "2.0.0", + "version": "2.2.1", "homepage": "https://github.com/SalesforceEng/tough-cookie", "repository": { "type": "git", @@ -26,29 +46,33 @@ "url": "https://github.com/SalesforceEng/tough-cookie/issues" }, "main": "./lib/cookie", + "files": [ + "lib" + ], "scripts": { + "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js", "test": "vows test/*_test.js" }, "engines": { "node": ">=0.10.0" }, "devDependencies": { - "vows": "0.7.0", - "async": ">=0.1.12" + "async": "^1.4.2", + "vows": "^0.8.1" }, - "gitHead": "a3af6104da7787c23bb98910109b0e0e8a10153c", - "_id": "tough-cookie@2.0.0", - "_shasum": "41ce08720b35cf90beb044dd2609fb19e928718f", - "_from": "tough-cookie@>=0.12.0", - "_npmVersion": "2.7.4", - "_nodeVersion": "0.12.2", + "gitHead": "f1055655ea56c85bd384aaf7d5b740b916700b6f", + "_id": "tough-cookie@2.2.1", + "_shasum": "3b0516b799e70e8164436a1446e7e5877fda118e", + "_from": "tough-cookie@>=2.2.0 <2.3.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", "_npmUser": { "name": "jstash", "email": "jstash@gmail.com" }, "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" }, "maintainers": [ { @@ -61,6 +85,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.0.0.tgz", + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz", "readme": "ERROR: No README data found!" } 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.0 <0.5.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", + "_shasum": "1104e3f36ac87125c287270067d582d18133bfee", + "_from": "tunnel-agent@>=0.4.1 <0.5.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.0.0", "_npmUser": { "name": "simov", "email": "simeonvelichkov@gmail.com" }, "dist": { - "shasum": "bbeecff4d679ce753db9462761a88dfcec3c5ab3", - "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz" + "shasum": "1104e3f36ac87125c287270067d582d18133bfee", + "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz" }, "maintainers": [ { @@ -55,6 +56,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz", + "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json index 0f3275a9b1be72..f365be73cccad4 100644 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -7,7 +7,7 @@ "util", "utility" ], - "version": "2.60.0", + "version": "2.69.0", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" @@ -25,25 +25,27 @@ }, "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": "~4.0.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" + "tough-cookie": "~2.2.0", + "tunnel-agent": "~0.4.1" }, "scripts": { "test": "npm run lint && npm run test-ci && npm run test-browser", @@ -53,40 +55,36 @@ "lint": "eslint lib/ *.js tests/ && echo Lint passed." }, "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": "af19cef3bc60e9151ffce5015d8ce3c0728d3aca", + "gitHead": "1c2fb40c74efb4f706f350a78dbd5e58fe913af3", "homepage": "https://github.com/request/request#readme", - "_id": "request@2.60.0", - "_shasum": "498820957fcdded1d37749069610c85f61a29f2d", - "_from": "request@2.60.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.6", + "_id": "request@2.69.0", + "_shasum": "cf91d2e000752b1217155c005241911991a2346a", + "_from": "request@2.69.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", "_npmUser": { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - }, - "dist": { - "shasum": "498820957fcdded1d37749069610c85f61a29f2d", - "tarball": "http://registry.npmjs.org/request/-/request-2.60.0.tgz" + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, "maintainers": [ { @@ -106,6 +104,10 @@ "email": "simeonvelichkov@gmail.com" } ], + "dist": { + "shasum": "cf91d2e000752b1217155c005241911991a2346a", + "tarball": "http://registry.npmjs.org/request/-/request-2.69.0.tgz" + }, "directories": {}, - "_resolved": "https://registry.npmjs.org/request/-/request-2.60.0.tgz" + "_resolved": "https://registry.npmjs.org/request/-/request-2.69.0.tgz" } diff --git a/deps/npm/node_modules/request/release.sh b/deps/npm/node_modules/request/release.sh deleted file mode 100755 index 7678bf8d8b691b..00000000000000 --- a/deps/npm/node_modules/request/release.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh - -if [ -z "`which github-changes`" ]; then - # specify version because github-changes "is under heavy development. Things - # may break between releases" until 0.1.0 - echo "First, do: [sudo] npm install -g github-changes@0.0.14" - exit 1 -fi - -if [ -d .git/refs/remotes/upstream ]; then - remote=upstream -else - remote=origin -fi - -# Increment v2.x.y -> v2.x+1.0 -npm version minor || exit 1 - -# Generate changelog from pull requests -github-changes -o request -r request \ - --auth --verbose \ - --file CHANGELOG.md \ - --only-pulls --use-commit-body \ - --date-format '(YYYY/MM/DD)' \ - || exit 1 - -# Since the tag for the new version hasn't been pushed yet, any changes in it -# will be marked as "upcoming" -version="$(grep '"version"' package.json | cut -d'"' -f4)" -sed -i -e "s/^### upcoming/### v$version/" CHANGELOG.md - -# This may fail if no changelog updates -# TODO: would this ever actually happen? handle it better? -git add CHANGELOG.md; git commit -m 'Update changelog' - -# Publish the new version to npm -npm publish || exit 1 - -# Increment v2.x.0 -> v2.x.1 -# For rationale, see: -# https://github.com/request/oauth-sign/issues/10#issuecomment-58917018 -npm version patch || exit 1 - -# Push back to the main repo -git push $remote master --tags || exit 1 diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js index f3f5dd915560fd..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`')) @@ -256,17 +262,7 @@ Request.prototype.init = function (options) { // Support Unix Sockets if (self.uri.host === 'unix') { - // Get the socket & request paths from the URL - var unixParts = self.uri.path.split(':') - , host = unixParts[0] - , path = unixParts[1] - // Apply unix properties to request - self.socketPath = host - self.uri.pathname = path - self.uri.path = path - self.uri.host = host - self.uri.hostname = host - self.uri.isUnix = true + self.enableUnixSocket() } if (self.strictSSL === false) { @@ -287,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)) } @@ -294,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) } @@ -432,13 +429,22 @@ Request.prototype.init = function (options) { } function setContentLength () { - if (!Buffer.isBuffer(self.body) && !Array.isArray(self.body)) { + if (isTypedArray(self.body)) { self.body = new Buffer(self.body) } + if (!self.hasHeader('content-length')) { - var length = (Array.isArray(self.body)) - ? self.body.reduce(function (a, b) {return a + b.length}, 0) - : self.body.length + var length + if (typeof self.body === 'string') { + length = Buffer.byteLength(self.body) + } + else if (Array.isArray(self.body)) { + length = self.body.reduce(function (a, b) {return a + b.length}, 0) + } + else { + length = self.body.length + } + if (length) { self.setHeader('content-length', length) } else { @@ -483,10 +489,9 @@ Request.prototype.init = function (options) { if (v.major === 0 && v.minor <= 10) { self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL } else { - self.agent = new self.httpModule.Agent({ - keepAlive: true, - maxSockets: (options.pool && options.pool.maxSockets) || Infinity - }) + self.agentClass = self.httpModule.Agent + self.agentOptions = self.agentOptions || {} + self.agentOptions.keepAlive = true } } else { self.agentClass = self.httpModule.Agent @@ -575,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() @@ -589,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 @@ -804,21 +752,33 @@ Request.prototype.start = function () { if (self.timeout && !self.timeoutTimer) { var timeout = self.timeout < 0 ? 0 : self.timeout + // Set a timeout in memory - this block will throw if the server takes more + // than `timeout` to write the HTTP status and headers (corresponding to + // the on('response') event on the client). NB: this measures wall-clock + // time, not the time between bytes sent by the server. self.timeoutTimer = setTimeout(function () { + var connectTimeout = self.req.socket && self.req.socket.readable === false self.abort() var e = new Error('ETIMEDOUT') e.code = 'ETIMEDOUT' + e.connect = connectTimeout self.emit('error', e) }, timeout) - // Set additional timeout on socket - in case if remote - // server freeze after sending headers if (self.req.setTimeout) { // only works on node 0.6+ + // Set an additional timeout on the socket, via the `setsockopt` syscall. + // This timeout sets the amount of time to wait *between* bytes sent + // from the server, and may or may not correspond to the wall-clock time + // elapsed from the start of the request. + // + // In particular, it's useful for erroring if the server fails to send + // data halfway through streaming a response. self.req.setTimeout(timeout, function () { if (self.req) { self.req.abort() var e = new Error('ESOCKETTIMEDOUT') e.code = 'ESOCKETTIMEDOUT' + e.connect = false self.emit('error', e) } }) @@ -1008,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) { - // empty - } - } - 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 { @@ -1071,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 @@ -1079,7 +1045,7 @@ Request.prototype.abort = function () { self.req.abort() } else if (self.response) { - self.response.abort() + self.response.destroy() } self.emit('abort') @@ -1137,16 +1103,20 @@ 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 + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + return self } Request.prototype.form = function (form) { @@ -1230,6 +1200,20 @@ Request.prototype.getHeader = function (name, headers) { }) return result } +Request.prototype.enableUnixSocket = function () { + // Get the socket & request paths from the URL + var unixParts = this.uri.path.split(':') + , host = unixParts[0] + , path = unixParts[1] + // Apply unix properties to request + this.socketPath = host + this.uri.pathname = path + this.uri.path = path + this.uri.host = host + this.uri.hostname = host + this.uri.isUnix = true +} + Request.prototype.auth = function (user, pass, sendImmediately, bearer) { var self = this @@ -1245,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 } @@ -1356,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() } @@ -1363,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/.npmignore b/deps/npm/node_modules/retry/.npmignore index 5a23aa6a0add26..e7726a071b7f39 100644 --- a/deps/npm/node_modules/retry/.npmignore +++ b/deps/npm/node_modules/retry/.npmignore @@ -1 +1,2 @@ /node_modules/* +npm-debug.log diff --git a/deps/npm/node_modules/retry/Makefile b/deps/npm/node_modules/retry/Makefile index a6e68c4182e5fc..eee21a99dfc9ec 100644 --- a/deps/npm/node_modules/retry/Makefile +++ b/deps/npm/node_modules/retry/Makefile @@ -3,5 +3,20 @@ 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/retry/Readme.md b/deps/npm/node_modules/retry/Readme.md index ba6602205ab393..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]) @@ -96,15 +98,49 @@ Explaining the various values from left to right: To make this a little easier for you, use wolfram alpha to do the calculations: -[http://www.wolframalpha.com/input/?i=Sum%5B1000*x^k%2C+{k%2C+0%2C+9}%5D+%3D+5+*+60+*+1000]() + [article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html -### new RetryOperation(timeouts) +### 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, [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 @@ -131,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) @@ -154,11 +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 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/example/dns.js b/deps/npm/node_modules/retry/example/dns.js index e4082af729ec19..d6351e9d05bb33 100644 --- a/deps/npm/node_modules/retry/example/dns.js +++ b/deps/npm/node_modules/retry/example/dns.js @@ -3,7 +3,7 @@ var retry = require('../lib/retry'); function faultTolerantResolve(address, cb) { var opts = { - times: 2, + retries: 2, factor: 2, minTimeout: 1 * 1000, maxTimeout: 2 * 1000, @@ -28,4 +28,4 @@ faultTolerantResolve('nodejs.org', function(err, errors, addresses) { console.warn('addresses:'); console.log(addresses); -}); \ No newline at end of file +}); diff --git a/deps/npm/node_modules/retry/lib/retry.js b/deps/npm/node_modules/retry/lib/retry.js index 38406860df92cd..02ab14729bd8b7 100644 --- a/deps/npm/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/retry/lib/retry.js @@ -2,7 +2,10 @@ var RetryOperation = require('./retry_operation'); exports.operation = function(options) { var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); }; exports.timeouts = function(options) { @@ -27,7 +30,7 @@ exports.timeouts = function(options) { var timeouts = []; for (var i = 0; i < opts.retries; i++) { - timeouts.push(this._createTimeout(i, opts)); + timeouts.push(this.createTimeout(i, opts)); } // sort the array numerically ascending @@ -38,7 +41,7 @@ exports.timeouts = function(options) { return timeouts; }; -exports._createTimeout = function(attempt, opts) { +exports.createTimeout = function(attempt, opts) { var random = (opts.randomize) ? (Math.random() + 1) : 1; @@ -47,4 +50,46 @@ exports._createTimeout = function(attempt, opts) { timeout = Math.min(timeout, opts.maxTimeout); return timeout; -}; \ No newline at end of file +}; + +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/retry/lib/retry_operation.js b/deps/npm/node_modules/retry/lib/retry_operation.js index f24d2d5a47625e..ad96efbdf3b02d 100644 --- a/deps/npm/node_modules/retry/lib/retry_operation.js +++ b/deps/npm/node_modules/retry/lib/retry_operation.js @@ -1,11 +1,21 @@ -function RetryOperation(timeouts) { +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; this._operationTimeout = null; this._operationTimeoutCb = null; this._timeout = null; + + if (this._options.forever) { + this._cachedTimeouts = this._timeouts.slice(0); + } } module.exports = RetryOperation; @@ -22,22 +32,37 @@ RetryOperation.prototype.retry = function(err) { var timeout = this._timeouts.shift(); if (timeout === undefined) { - return false; + 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; + } } - this._attempts++; - var self = this; - setTimeout(function() { - self._fn(self._attempts); + 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; }; @@ -53,14 +78,14 @@ RetryOperation.prototype.attempt = function(fn, timeoutOps) { } } - this._fn(this._attempts); - var self = this; if (this._operationTimeoutCb) { this._timeout = setTimeout(function() { self._operationTimeoutCb(); }, self._operationTimeout); } + + this._fn(this._attempts); }; RetryOperation.prototype.try = function(fn) { @@ -106,4 +131,4 @@ RetryOperation.prototype.mainError = function() { } return mainError; -}; \ No newline at end of file +}; diff --git a/deps/npm/node_modules/retry/package.json b/deps/npm/node_modules/retry/package.json index 130fcae13aa7f7..c8fc00f9d7593b 100644 --- a/deps/npm/node_modules/retry/package.json +++ b/deps/npm/node_modules/retry/package.json @@ -6,7 +6,8 @@ }, "name": "retry", "description": "Abstraction for exponential and custom retry strategies for failed operations.", - "version": "0.6.1", + "license": "MIT", + "version": "0.9.0", "homepage": "https://github.com/tim-kos/node-retry", "repository": { "type": "git", @@ -24,13 +25,16 @@ "fake": "0.2.0", "far": "0.0.1" }, + "gitHead": "1b621cf499ef7647d005e3650006b93a8dbeb986", "bugs": { "url": "https://github.com/tim-kos/node-retry/issues" }, - "_id": "retry@0.6.1", - "_shasum": "fdc90eed943fde11b893554b8cc63d0e899ba918", - "_from": "retry@>=0.6.1 <0.7.0", - "_npmVersion": "1.4.9", + "_id": "retry@0.9.0", + "scripts": {}, + "_shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", + "_from": "retry@0.9.0", + "_npmVersion": "2.1.7", + "_nodeVersion": "4.2.1", "_npmUser": { "name": "tim-kos", "email": "tim@debuggable.com" @@ -42,8 +46,8 @@ } ], "dist": { - "shasum": "fdc90eed943fde11b893554b8cc63d0e899ba918", - "tarball": "http://registry.npmjs.org/retry/-/retry-0.6.1.tgz" + "shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", + "tarball": "http://registry.npmjs.org/retry/-/retry-0.9.0.tgz" }, - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.6.1.tgz" + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.9.0.tgz" } diff --git a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js index d873d1fa8814a9..cecfa3b7310013 100644 --- a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js +++ b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js @@ -77,4 +77,30 @@ var retry = require(common.dir.lib + '/retry'); }; fn(); -})(); \ No newline at end of file +})(); + +(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/retry/test/integration/test-retry-wrap.js b/deps/npm/node_modules/retry/test/integration/test-retry-wrap.js new file mode 100644 index 00000000000000..7ca8bc7eb596b5 --- /dev/null +++ b/deps/npm/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/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/node-gyp/node_modules/semver/LICENSE b/deps/npm/node_modules/rimraf/node_modules/glob/LICENSE similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/semver/LICENSE rename to deps/npm/node_modules/rimraf/node_modules/glob/LICENSE diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/README.md b/deps/npm/node_modules/rimraf/node_modules/glob/README.md new file mode 100644 index 00000000000000..6960483bac63c6 --- /dev/null +++ b/deps/npm/node_modules/rimraf/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/rimraf/node_modules/glob/common.js b/deps/npm/node_modules/rimraf/node_modules/glob/common.js new file mode 100644 index 00000000000000..b280e76cee9be6 --- /dev/null +++ b/deps/npm/node_modules/rimraf/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 = 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.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/rimraf/node_modules/glob/glob.js b/deps/npm/node_modules/rimraf/node_modules/glob/glob.js new file mode 100644 index 00000000000000..804cde53f0d276 --- /dev/null +++ b/deps/npm/node_modules/rimraf/node_modules/glob/glob.js @@ -0,0 +1,772 @@ +// 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' + if (f === this.cwd) { + var error = new Error(er.code + ' invalid cwd ' + f) + error.path = f + 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/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js new file mode 100644 index 00000000000000..19f103f908ac72 --- /dev/null +++ b/deps/npm/node_modules/rimraf/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/tools/eslint/node_modules/chalk/node_modules/has-ansi/license b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/license similarity index 100% rename from tools/eslint/node_modules/chalk/node_modules/has-ansi/license rename to deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/license diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json new file mode 100644 index 00000000000000..39372636f3fb4f --- /dev/null +++ b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json @@ -0,0 +1,70 @@ +{ + "name": "path-is-absolute", + "version": "1.0.0", + "description": "Node.js 0.12 path.isAbsolute() ponyfill", + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-is-absolute.git" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "node test.js" + }, + "files": [ + "index.js" + ], + "keywords": [ + "path", + "paths", + "file", + "dir", + "absolute", + "isabsolute", + "is-absolute", + "built-in", + "util", + "utils", + "core", + "ponyfill", + "polyfill", + "shim", + "is", + "detect", + "check" + ], + "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "bugs": { + "url": "https://github.com/sindresorhus/path-is-absolute/issues" + }, + "homepage": "https://github.com/sindresorhus/path-is-absolute", + "_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!" +} diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md new file mode 100644 index 00000000000000..cdf94f4309a27e --- /dev/null +++ b/deps/npm/node_modules/rimraf/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/rimraf/node_modules/glob/package.json b/deps/npm/node_modules/rimraf/node_modules/glob/package.json new file mode 100644 index 00000000000000..3f1119ee89fada --- /dev/null +++ b/deps/npm/node_modules/rimraf/node_modules/glob/package.json @@ -0,0 +1,76 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "name": "glob", + "description": "a little globber", + "version": "7.0.0", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-glob.git" + }, + "main": "glob.js", + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "engines": { + "node": "*" + }, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "devDependencies": { + "mkdirp": "0", + "rimraf": "^2.2.8", + "tap": "^5.0.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" + }, + "license": "ISC", + "gitHead": "8e8876f84232783fd2db3182af5fa33cc83f1989", + "bugs": { + "url": "https://github.com/isaacs/node-glob/issues" + }, + "homepage": "https://github.com/isaacs/node-glob#readme", + "_id": "glob@7.0.0", + "_shasum": "3b20a357fffcf46bb384aed6f8ae9a647fdb6ac4", + "_from": "glob@>=7.0.0 <8.0.0", + "_npmVersion": "3.7.0", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "3b20a357fffcf46bb384aed6f8ae9a647fdb6ac4", + "tarball": "http://registry.npmjs.org/glob/-/glob-7.0.0.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/glob-7.0.0.tgz_1455132435010_0.6941273615229875" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.0.tgz" +} diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/sync.js b/deps/npm/node_modules/rimraf/node_modules/glob/sync.js new file mode 100644 index 00000000000000..aa28c87a3e5daf --- /dev/null +++ b/deps/npm/node_modules/rimraf/node_modules/glob/sync.js @@ -0,0 +1,466 @@ +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' + if (f === this.cwd) { + var error = new Error(er.code + ' invalid cwd ' + f) + error.path = f + 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/deps/npm/node_modules/rimraf/package.json b/deps/npm/node_modules/rimraf/package.json index 449d380d9d8552..0cbadee1ae4ac4 100644 --- a/deps/npm/node_modules/rimraf/package.json +++ b/deps/npm/node_modules/rimraf/package.json @@ -1,6 +1,6 @@ { "name": "rimraf", - "version": "2.4.2", + "version": "2.5.2", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": { @@ -20,7 +20,7 @@ "rimraf": "./bin.js" }, "dependencies": { - "glob": "^5.0.14" + "glob": "^7.0.0" }, "files": [ "LICENSE", @@ -30,25 +30,25 @@ ], "devDependencies": { "mkdirp": "^0.5.1", - "tap": "^1.3.1" + "tap": "^5.1.1" }, - "gitHead": "4359e9d3b3c0f26e6abe3139a00b93337f1689d7", + "gitHead": "f414f87021f88d004ac487eebc8d07ce6a152721", "bugs": { "url": "https://github.com/isaacs/rimraf/issues" }, "homepage": "https://github.com/isaacs/rimraf#readme", - "_id": "rimraf@2.4.2", - "_shasum": "ab4f39b08b72eae07c3d9fe9f4831aebfc9f431d", - "_from": "rimraf@2.4.2", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", + "_id": "rimraf@2.5.2", + "_shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "_from": "rimraf@2.5.2", + "_npmVersion": "3.7.0", + "_nodeVersion": "5.6.0", "_npmUser": { "name": "isaacs", - "email": "isaacs@npmjs.com" + "email": "i@izs.me" }, "dist": { - "shasum": "ab4f39b08b72eae07c3d9fe9f4831aebfc9f431d", - "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.4.2.tgz" + "shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" }, "maintainers": [ { @@ -56,7 +56,10 @@ "email": "i@izs.me" } ], + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/rimraf-2.5.2.tgz_1455346499772_0.9326622514054179" + }, "directories": {}, - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.2.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" } diff --git a/deps/npm/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/rimraf/rimraf.js index 447705ac97bb0b..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) { @@ -83,7 +85,7 @@ function rimraf (p, options, cb) { results.forEach(function (p) { rimraf_(p, options, function CB (er) { if (er) { - if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") && busyTries < options.maxBusyTries) { busyTries ++ var time = busyTries * 100 @@ -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 d650b8953dbb47..0a8742848dbc3f 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,14 +1,13 @@ { "name": "semver", - "version": "5.0.1", + "version": "5.1.0", "description": "The semantic version parser used by npm.", "main": "semver.js", "scripts": { "test": "tap test/*.js" }, "devDependencies": { - "tap": "^1.2.0", - "uglify-js": "~2.3.6" + "tap": "^2.0.0" }, "license": "ISC", "repository": { @@ -18,23 +17,23 @@ "bin": { "semver": "./bin/semver" }, - "gitHead": "3408896f115cdb241684fb81f85abb0d2ecc27e9", + "gitHead": "8e33a30e62e40e4983d1c5f55e794331b861aadc", "bugs": { "url": "https://github.com/npm/node-semver/issues" }, "homepage": "https://github.com/npm/node-semver#readme", - "_id": "semver@5.0.1", - "_shasum": "9fb3f4004f900d83c47968fe42f7583e05832cc9", - "_from": "semver@>=5.0.1 <5.1.0", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", + "_id": "semver@5.1.0", + "_shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "_from": "semver@>=5.1.0 <5.2.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", "_npmUser": { "name": "isaacs", - "email": "isaacs@npmjs.com" + "email": "i@izs.me" }, "dist": { - "shasum": "9fb3f4004f900d83c47968fe42f7583e05832cc9", - "tarball": "http://registry.npmjs.org/semver/-/semver-5.0.1.tgz" + "shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "tarball": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz" }, "maintainers": [ { @@ -47,6 +46,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/semver/-/semver-5.0.1.tgz", + "_resolved": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz", "readme": "ERROR: No README data found!" } 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 d4a8dca609683b..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; }; @@ -481,6 +477,7 @@ SemVer.prototype.inc = function(release, identifier) { throw new Error('invalid increment argument: ' + release); } this.format(); + this.raw = this.version; return this; }; @@ -691,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; }; @@ -738,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/semver/test/index.js b/deps/npm/node_modules/semver/test/index.js index c256c79479c144..47c3f5f9513103 100644 --- a/deps/npm/node_modules/semver/test/index.js +++ b/deps/npm/node_modules/semver/test/index.js @@ -391,14 +391,14 @@ test('\nincrement versions test', function(t) { ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], - ['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'], - ['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'], - ['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'], - ['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'], - ['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'], - ['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'], - ['1.2.0-1', 'minor', '1.2.0', 'dev'], - ['1.0.0-1', 'major', '1.0.0', 'dev'], + ['1.2.0', 'prepatch', '1.2.1-dev.0', false, 'dev'], + ['1.2.0-1', 'prepatch', '1.2.1-dev.0', false, 'dev'], + ['1.2.0', 'preminor', '1.3.0-dev.0', false, 'dev'], + ['1.2.3-1', 'preminor', '1.3.0-dev.0', false, 'dev'], + ['1.2.0', 'premajor', '2.0.0-dev.0', false, 'dev'], + ['1.2.3-1', 'premajor', '2.0.0-dev.0', false, 'dev'], + ['1.2.0-1', 'minor', '1.2.0', false, 'dev'], + ['1.0.0-1', 'major', '1.0.0', false, 'dev'], ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] ].forEach(function(v) { @@ -410,6 +410,19 @@ test('\nincrement versions test', function(t) { var found = inc(pre, what, loose, id); var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; t.equal(found, wanted, cmd + ' === ' + wanted); + + var parsed = semver.parse(pre, loose); + if (wanted) { + parsed.inc(what, id); + t.equal(parsed.version, wanted, cmd + ' object version updated'); + t.equal(parsed.raw, wanted, cmd + ' object raw field updated'); + } else if (parsed) { + t.throws(function () { + parsed.inc(what, id) + }) + } else { + t.equal(parsed, null) + } }); t.end(); diff --git a/deps/npm/node_modules/sha/index.js b/deps/npm/node_modules/sha/index.js index d50ac2fb92f2cf..44e7b4b5182734 100644 --- a/deps/npm/node_modules/sha/index.js +++ b/deps/npm/node_modules/sha/index.js @@ -2,20 +2,7 @@ var Transform = require('stream').Transform || require('readable-stream').Transform var crypto = require('crypto') -var fs -try { - fs = require('graceful-fs') -} catch (ex) { - fs = require('fs') -} -try { - process.binding('crypto') -} catch (e) { - var er = new Error( 'crypto binding not found.\n' - + 'Please build node with openssl.\n' - + e.message ) - throw er -} +var fs = require('graceful-fs') exports.check = check exports.checkSync = checkSync diff --git a/deps/npm/node_modules/sha/node_modules/graceful-fs/.npmignore b/deps/npm/node_modules/sha/node_modules/graceful-fs/.npmignore deleted file mode 100644 index c2658d7d1b3184..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/graceful-fs/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ diff --git a/deps/npm/node_modules/sha/node_modules/graceful-fs/README.md b/deps/npm/node_modules/sha/node_modules/graceful-fs/README.md deleted file mode 100644 index 13a2e86050a3eb..00000000000000 --- a/deps/npm/node_modules/sha/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/sha/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/sha/node_modules/graceful-fs/fs.js deleted file mode 100644 index 64ad980232ec0d..00000000000000 --- a/deps/npm/node_modules/sha/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/sha/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/sha/node_modules/graceful-fs/graceful-fs.js deleted file mode 100644 index fb206b83854a19..00000000000000 --- a/deps/npm/node_modules/sha/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/sha/node_modules/graceful-fs/package.json b/deps/npm/node_modules/sha/node_modules/graceful-fs/package.json deleted file mode 100644 index 84e65e878b3d59..00000000000000 --- a/deps/npm/node_modules/sha/node_modules/graceful-fs/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - "graceful-fs@2 || 3", - "/Users/isaacs/dev/npm/npm/node_modules/sha" - ] - ], - "_from": "graceful-fs@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/sha/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@2 || 3", - "rawSpec": "2 || 3", - "scope": null, - "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "/sha" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@2 || 3", - "_where": "/Users/isaacs/dev/npm/npm/node_modules/sha", - "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/sha/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/sha/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/sha/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/sha/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/sha/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/sha/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/sha/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/sha/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/sha/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/sha/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/sha/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/sha/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/sha/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/sha/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/sha/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/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/sha/node_modules/readable-stream/.npmignore similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.npmignore rename to deps/npm/node_modules/sha/node_modules/readable-stream/.npmignore diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/sha/node_modules/readable-stream/.travis.yml similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.travis.yml rename to deps/npm/node_modules/sha/node_modules/readable-stream/.travis.yml diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml b/deps/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/.zuul.yml rename to deps/npm/node_modules/sha/node_modules/readable-stream/.zuul.yml diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/LICENSE rename to deps/npm/node_modules/sha/node_modules/readable-stream/LICENSE 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 new file mode 100644 index 00000000000000..77fafa3da15f9f --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# 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 new file mode 100644 index 00000000000000..a2270c88057950 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1651 @@ +# 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 new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# 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/deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/duplex.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/duplex.js diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js 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 new file mode 100644 index 00000000000000..eef3d825d7a084 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,959 @@ +'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/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js 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 new file mode 100644 index 00000000000000..b232952016a9c1 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,520 @@ +// 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/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js 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 new file mode 100644 index 00000000000000..466dfdfe0139b3 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,53 @@ +{ + "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/sha/node_modules/readable-stream/node_modules/core-util-is/util.js 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/util.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md 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 new file mode 100644 index 00000000000000..e1856ef0943728 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js @@ -0,0 +1,208 @@ + +/** + * 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/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js 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 new file mode 100644 index 00000000000000..19228ab6fdcaaf --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,53 @@ +{ + "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/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml 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 new file mode 100644 index 00000000000000..049521cad7ba1b --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -0,0 +1,13 @@ +'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 new file mode 100644 index 00000000000000..c67e3532b54245 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# 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 new file mode 100644 index 00000000000000..087586e8f8cedd --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -0,0 +1,45 @@ +{ + "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 new file mode 100644 index 00000000000000..78e7cfaeb7acde --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +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 new file mode 100644 index 00000000000000..ef15721584ac99 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/process-nextick-args/test.js @@ -0,0 +1,24 @@ +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/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/History.md diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/LICENSE diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/README.md diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/browser.js diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/node.js diff --git a/tools/eslint/node_modules/concat-stream/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 similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json rename to deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/util-deprecate/package.json 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 new file mode 100644 index 00000000000000..7a333a98a324e1 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json @@ -0,0 +1,75 @@ +{ + "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/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/passthrough.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/passthrough.js diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/readable.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/readable.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/readable.js diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/transform.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/transform.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/transform.js diff --git a/tools/eslint/node_modules/concat-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/writable.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/readable-stream/writable.js rename to deps/npm/node_modules/sha/node_modules/readable-stream/writable.js diff --git a/deps/npm/node_modules/sha/package.json b/deps/npm/node_modules/sha/package.json index f5aff490799337..95e55e138946a6 100644 --- a/deps/npm/node_modules/sha/package.json +++ b/deps/npm/node_modules/sha/package.json @@ -1,6 +1,6 @@ { "name": "sha", - "version": "1.3.0", + "version": "2.0.1", "description": "Check and get file hashes", "scripts": { "test": "mocha -R spec" @@ -9,27 +9,24 @@ "type": "git", "url": "https://github.com/ForbesLindesay/sha.git" }, - "license": "BSD", - "optionalDependencies": { - "graceful-fs": "2 || 3", - "readable-stream": "~1.1" + "license": "(BSD-2-Clause OR MIT)", + "dependencies": { + "graceful-fs": "^4.1.2", + "readable-stream": "^2.0.2" }, "devDependencies": { "mocha": "~1.9.0" }, - "gitHead": "f1985eefbf7538e5809a2157c728d2f740901600", + "gitHead": "ce7c72ba753d886fb46c396cbadcbfc8eac25b4f", "bugs": { "url": "https://github.com/ForbesLindesay/sha/issues" }, "homepage": "https://github.com/ForbesLindesay/sha", - "dependencies": { - "graceful-fs": "2 || 3", - "readable-stream": "~1.1" - }, - "_id": "sha@1.3.0", - "_shasum": "79f4787045d0ede7327d702c25c443460dbc6764", - "_from": "sha@>=1.3.0 <1.4.0", - "_npmVersion": "1.5.0-alpha-4", + "_id": "sha@2.0.1", + "_shasum": "6030822fbd2c9823949f8f72ed6411ee5cf25aae", + "_from": "sha@2.0.1", + "_npmVersion": "2.7.1", + "_nodeVersion": "1.6.2", "_npmUser": { "name": "forbeslindesay", "email": "forbes@lindesay.co.uk" @@ -38,12 +35,20 @@ { "name": "forbeslindesay", "email": "forbes@lindesay.co.uk" + }, + { + "name": "kenan", + "email": "kenan@kenany.me" + }, + { + "name": "thefourtheye", + "email": "thechargingvolcano@gmail.com" } ], "dist": { - "shasum": "79f4787045d0ede7327d702c25c443460dbc6764", - "tarball": "http://registry.npmjs.org/sha/-/sha-1.3.0.tgz" + "shasum": "6030822fbd2c9823949f8f72ed6411ee5cf25aae", + "tarball": "http://registry.npmjs.org/sha/-/sha-2.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/sha/-/sha-1.3.0.tgz" + "_resolved": "https://registry.npmjs.org/sha/-/sha-2.0.1.tgz" } diff --git a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/LICENSE b/deps/npm/node_modules/spdx-license-ids/LICENSE similarity index 100% rename from deps/npm/node_modules/spdx/node_modules/spdx-license-ids/LICENSE rename to deps/npm/node_modules/spdx-license-ids/LICENSE diff --git a/deps/npm/node_modules/spdx-license-ids/README.md b/deps/npm/node_modules/spdx-license-ids/README.md new file mode 100755 index 00000000000000..92523532b24609 --- /dev/null +++ b/deps/npm/node_modules/spdx-license-ids/README.md @@ -0,0 +1,55 @@ +# spdx-license-ids + +A list of [SPDX license](https://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 +const 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 +const spdxLicenseIds = require('spdx-license-ids'); //=> ['Glide', 'Abstyles', 'AFL-1.1', ... ] +``` + +## License + +[The Unlicense](./LICENSE). diff --git a/deps/npm/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/spdx-license-ids/package.json new file mode 100644 index 00000000000000..abc55f6502889e --- /dev/null +++ b/deps/npm/node_modules/spdx-license-ids/package.json @@ -0,0 +1,77 @@ +{ + "name": "spdx-license-ids", + "version": "1.2.0", + "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.24.0", + "got": "^3.3.0", + "istanbul": "^0.3.17", + "require-bower-files": "^2.0.0", + "rimraf": "^2.4.1", + "stringify-object": "^2.2.0", + "tape": "^4.0.0" + }, + "gitHead": "f74a7a16ca05540e0e97f1bbb61da07829b5d9ab", + "bugs": { + "url": "https://github.com/shinnn/spdx-license-ids/issues" + }, + "homepage": "https://github.com/shinnn/spdx-license-ids#readme", + "_id": "spdx-license-ids@1.2.0", + "_shasum": "b549dd0f63dcb745a17e2ea3a07402e0e332d1e2", + "_from": "spdx-license-ids@1.2.0", + "_npmVersion": "3.5.2", + "_nodeVersion": "5.4.0", + "_npmUser": { + "name": "shinnn", + "email": "snnskwtnb@gmail.com" + }, + "dist": { + "shasum": "b549dd0f63dcb745a17e2ea3a07402e0e332d1e2", + "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.0.tgz" + }, + "maintainers": [ + { + "name": "shinnn", + "email": "snnskwtnb@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.0.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-license-ids/spdx-license-ids.json similarity index 89% rename from deps/npm/node_modules/spdx/node_modules/spdx-license-ids/spdx-license-ids.json rename to deps/npm/node_modules/spdx-license-ids/spdx-license-ids.json index 3c5bdfcd0fc2dd..8d23a650ef49f5 100644 --- a/deps/npm/node_modules/spdx/node_modules/spdx-license-ids/spdx-license-ids.json +++ b/deps/npm/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,10 +53,12 @@ "CECILL-1.0", "CECILL-1.1", "CECILL-2.0", + "CECILL-2.1", "CECILL-B", "CECILL-C", "ClArtistic", "MIT-CMU", + "CNRI-Jython", "CNRI-Python", "CNRI-Python-GPL-Compatible", "CPOL-1.02", @@ -97,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", @@ -146,24 +151,28 @@ "HPND", "IBM-pibs", "IPL-1.0", + "ICU", "ImageMagick", "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", "Leptonica", + "LGPLLR", "Libpng", "libtiff", "LPL-1.02", @@ -202,6 +211,7 @@ "OCLC-2.0", "ODbL-1.0", "PDDL-1.0", + "OCCT-PL", "OGTSL", "OLDAP-2.2.2", "OLDAP-1.1", @@ -242,11 +252,13 @@ "RPL-1.5", "RHeCos-1.1", "RSCPL", + "RSA-MD", "Ruby", "SAX-PD", "Saxpath", "SCEA", "SWL", + "Sendmail", "SGI-B-1.0", "SGI-B-1.1", "SGI-B-2.0", @@ -255,6 +267,9 @@ "SimPL-2.0", "Sleepycat", "SNIA", + "Spencer-86", + "Spencer-94", + "Spencer-99", "SMLNJ", "SugarCRM-1.1.3", "SISSL", @@ -267,12 +282,13 @@ "TORQUE-1.1", "TOSL", "Unicode-TOU", + "UPL-1.0", "NCSA", "Vim", "VOSTROM", "VSL-1.0", - "W3C", "W3C-19980720", + "W3C", "Wsuipa", "Xnet", "X11", @@ -292,5 +308,14 @@ "ZPL-1.1", "ZPL-2.0", "ZPL-2.1", - "ICU" + "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/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/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/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/tools/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license b/deps/npm/node_modules/strip-ansi/license similarity index 100% rename from tools/eslint/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/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..f9809beee8dc3f --- /dev/null +++ b/deps/npm/node_modules/strip-ansi/package.json @@ -0,0 +1,85 @@ +{ + "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", + "_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/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/strip-ansi/readme.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md rename to deps/npm/node_modules/strip-ansi/readme.md diff --git a/deps/npm/node_modules/tar/lib/entry.js b/deps/npm/node_modules/tar/lib/entry.js index 4af5c410838af8..5f5dd3c2688a8b 100644 --- a/deps/npm/node_modules/tar/lib/entry.js +++ b/deps/npm/node_modules/tar/lib/entry.js @@ -24,6 +24,7 @@ function Entry (header, extended, global) { this._ending = false this._ended = false this._remaining = 0 + this._abort = false this._queue = [] this._index = 0 this._queueLen = 0 @@ -209,5 +210,11 @@ Entry.prototype._setProps = function () { this._remaining = props.size } +// the parser may not call write if _abort is true. +// useful for skipping data from some files quickly. +Entry.prototype.abort = function(){ + this._abort = true +} + Entry.prototype.warn = fstream.warn Entry.prototype.error = fstream.error diff --git a/deps/npm/node_modules/tar/lib/parse.js b/deps/npm/node_modules/tar/lib/parse.js index 1c53d9d26d7f21..600ad782f0f61d 100644 --- a/deps/npm/node_modules/tar/lib/parse.js +++ b/deps/npm/node_modules/tar/lib/parse.js @@ -102,7 +102,11 @@ Parse.prototype._process = function (c) { if (this._entry) { var entry = this._entry - entry.write(c) + if(!entry._abort) entry.write(c) + else { + entry._remaining -= c.length + if(entry._remaining < 0) entry._remaining = 0 + } if (entry._remaining === 0) { entry.end() this._entry = null diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index f160d0bd0a8ff1..2d0846a1fde27b 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -6,7 +6,7 @@ }, "name": "tar", "description": "tar for node", - "version": "2.1.1", + "version": "2.2.1", "repository": { "type": "git", "url": "git://github.com/isaacs/node-tar.git" @@ -21,7 +21,7 @@ "inherits": "2" }, "devDependencies": { - "graceful-fs": "^3.0.2", + "graceful-fs": "^4.1.2", "rimraf": "1.x", "tap": "0.x", "mkdirp": "^0.5.0" @@ -29,12 +29,12 @@ "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": "2cbe6c805fc5d87ce099183ed13c43faba962224", + "gitHead": "52237e39d2eb68d22a32d9a98f1d762189fe6a3d", "bugs": { "url": "https://github.com/isaacs/node-tar/issues" }, "homepage": "https://github.com/isaacs/node-tar#readme", - "_id": "tar@2.1.1", - "_shasum": "ac0649e135fa4546e430c7698514e1da2e8a7cc4", - "_from": "tar@>=2.1.1 <2.2.0" + "_id": "tar@2.2.1", + "_shasum": "8e4d2a256c0e2185c6b18ad694aec968b83cb1d1", + "_from": "tar@2.2.1" } diff --git a/deps/npm/node_modules/tar/test/parse-discard.js b/deps/npm/node_modules/tar/test/parse-discard.js new file mode 100644 index 00000000000000..79408c274b96e9 --- /dev/null +++ b/deps/npm/node_modules/tar/test/parse-discard.js @@ -0,0 +1,29 @@ +var tap = require("tap") + , tar = require("../tar.js") + , fs = require("fs") + , path = require("path") + , file = path.resolve(__dirname, "fixtures/c.tar") + +tap.test("parser test", function (t) { + var parser = tar.Parse() + var total = 0 + var dataTotal = 0 + + parser.on("end", function () { + + t.equals(total-513,dataTotal,'should have discarded only c.txt') + + t.end() + }) + + fs.createReadStream(file) + .pipe(parser) + .on('entry',function(entry){ + if(entry.path === 'c.txt') entry.abort() + + total += entry.size; + entry.on('data',function(data){ + dataTotal += data.length + }) + }) +}) diff --git a/deps/npm/node_modules/validate-npm-package-license/README.md b/deps/npm/node_modules/validate-npm-package-license/README.md index 2c51c8e640da8a..c5b3bfcf381d33 100644 --- a/deps/npm/node_modules/validate-npm-package-license/README.md +++ b/deps/npm/node_modules/validate-npm-package-license/README.md @@ -3,59 +3,111 @@ validate-npm-package-license Give me a string and I'll tell you if it's a valid npm package license string. - +```javascript +var valid = require('validate-npm-package-license'); +``` + +SPDX license identifiers are valid license strings: -```js -var noWarnings = { +```javascript + +var assert = require('assert'); +var validSPDXExpression = { validForNewPackages: true, - validForOldPackages: true + validForOldPackages: true, + spdx: true }; -// SPDX license identifier for common open-source licenses -valid('MIT'); // => noWarnings -valid('BSD-2-Clause'); // => noWarnings -valid('Apache-2.0'); // => noWarnings -valid('ISC'); // => noWarnings - -// Simple SPDX license expression for dual licensing -valid('(GPL-3.0 OR BSD-2-Clause)'); // => noWarnings +assert.deepEqual(valid('MIT'), validSPDXExpression); +assert.deepEqual(valid('BSD-2-Clause'), validSPDXExpression); +assert.deepEqual(valid('Apache-2.0'), validSPDXExpression); +assert.deepEqual(valid('ISC'), validSPDXExpression); +``` +The function will return a warning and suggestion for nearly-correct license identifiers: -// Refer to a non-standard license found in the package -valid('SEE LICENSE IN LICENSE.txt'); // => noWarnings -valid('SEE LICENSE IN license.md'); // => noWarnings +```javascript +assert.deepEqual( + valid('Apache 2.0'), + { + validForOldPackages: false, + validForNewPackages: false, + warnings: [ + 'license should be ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + + '"UNLICENSED", or ' + + '"SEE LICENSE IN "', + 'license is similar to the valid expression "Apache-2.0"' + ] + } +); +``` -// No license -valid('UNLICENSED'); // => noWarnings -valid('UNLICENCED'); // => noWarnings +SPDX expressions are valid, too ... -var warningsWithSuggestion = { - validForOldPackages: false, - validForNewPackages: false, - warnings: [ - 'license should be ' + - 'a valid SPDX license expression without "LicenseRef", ' + - '"UNLICENSED", or ' + - '"SEE LICENSE IN "', - 'license is similar to the valid expression "Apache-2.0"' - ] -}; +```javascript +// Simple SPDX license expression for dual licensing +assert.deepEqual( + valid('(GPL-3.0 OR BSD-2-Clause)'), + validSPDXExpression +); +``` -// Almost a valid SPDX license identifier -valid('Apache 2.0'); // => warningsWithSuggestion +... except if they contain `LicenseRef`: +```javascript var warningAboutLicenseRef = { validForOldPackages: false, validForNewPackages: false, + spdx: true, warnings: [ 'license should be ' + - 'a valid SPDX license expression without "LicenseRef", ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + '"UNLICENSED", or ' + '"SEE LICENSE IN "', ] }; -// LicenseRef-* identifiers are valid SPDX expressions, -// but not valid in package.json -valid('LicenseRef-Made-Up'); // => warningAboutLicenseRef -valid('(MIT OR LicenseRef-Made-Up)'); // => warningAboutLicenseRef +assert.deepEqual( + valid('LicenseRef-Made-Up'), + warningAboutLicenseRef +); + +assert.deepEqual( + valid('(MIT OR LicenseRef-Made-Up)'), + warningAboutLicenseRef +); +``` + +If you can't describe your licensing terms with standardized SPDX identifiers, put the terms in a file in the package and point users there: + +```javascript +assert.deepEqual( + valid('SEE LICENSE IN LICENSE.txt'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'LICENSE.txt' + } +); + +assert.deepEqual( + valid('SEE LICENSE IN license.md'), + { + validForNewPackages: true, + validForOldPackages: true, + inFile: 'license.md' + } +); +``` + +If there aren't any licensing terms, use `UNLICENSED`: + +```javascript +var unlicensed = { + validForNewPackages: true, + validForOldPackages: true, + unlicensed: true +}; +assert.deepEqual(valid('UNLICENSED'), unlicensed); +assert.deepEqual(valid('UNLICENCED'), unlicensed); ``` diff --git a/deps/npm/node_modules/validate-npm-package-license/index.js b/deps/npm/node_modules/validate-npm-package-license/index.js index adf58d6751bf5e..2ad98d9d84d370 100644 --- a/deps/npm/node_modules/validate-npm-package-license/index.js +++ b/deps/npm/node_modules/validate-npm-package-license/index.js @@ -1,14 +1,9 @@ -var spdx = require('spdx'); +var parse = require('spdx-expression-parse'); var correct = require('spdx-correct'); -var validResult = { - validForNewPackages: true, - validForOldPackages: true -}; - var genericWarning = ( 'license should be ' + - 'a valid SPDX license expression without "LicenseRef", ' + + 'a valid SPDX license expression (without "LicenseRef"), ' + '"UNLICENSED", or ' + '"SEE LICENSE IN "' ); @@ -38,14 +33,24 @@ module.exports = function(argument) { var ast; try { - ast = spdx.parse(argument); + ast = parse(argument); } catch (e) { + var match if ( argument === 'UNLICENSED' || - argument === 'UNLICENCED' || - fileReferenceRE.test(argument) + argument === 'UNLICENCED' ) { - return validResult; + return { + validForOldPackages: true, + validForNewPackages: true, + unlicensed: true + }; + } else if (match = fileReferenceRE.exec(argument)) { + return { + validForOldPackages: true, + validForNewPackages: true, + inFile: match[1] + }; } else { var result = { validForOldPackages: false, @@ -66,9 +71,14 @@ module.exports = function(argument) { return { validForNewPackages: false, validForOldPackages: false, + spdx: true, warnings: [genericWarning] }; } else { - return validResult; + return { + validForNewPackages: true, + validForOldPackages: true, + spdx: true + }; } }; 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 index 17de51c642a7da..4b54239b2e6f94 100644 --- 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 @@ -10,165 +10,48 @@ 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. +"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/README.md b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md index 05cd9947d22ccd..4289e5cd8c5719 100644 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/README.md @@ -1,21 +1,10 @@ -spdx-correct.js -=============== +```javascript +var correct = require('spdx-correct'); +var assert = require('assert'); -[![npm version](https://img.shields.io/npm/v/spdx-correct.svg)](https://www.npmjs.com/package/spdx-correct) -[![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-correct.js.svg)](http://travis-ci.org/kemitchell/spdx-correct.js) +assert.equal(correct('mit'), 'MIT') +assert.equal(correct('Apache 2'), 'Apache-2.0') -Correct invalid SPDX identifiers. - - - -```js -correct('mit'); // => 'MIT' - -correct('Apache 2'); // => 'Apache-2.0' - -correct('No idea what license'); // => null +assert(correct('No idea what license') === null) ``` diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/index.js b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/index.js new file mode 100644 index 00000000000000..75b7a21afebb65 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/index.js @@ -0,0 +1,237 @@ +var licenseIDs = require('spdx-license-ids'); + +function valid(string) { + return licenseIDs.indexOf(string) > -1; +} + +// Common transpositions of license identifier acronyms +var transpositions = [ + ['APGL', 'AGPL'], + ['Gpl', 'GPL'], + ['GLP', 'GPL'], + ['APL', 'Apache'], + ['ISD', 'ISC'], + ['GLP', 'GPL'], + ['IST', 'ISC'], + ['Claude', 'Clause'], + [' or later', '+'], + [' International', ''], + ['GNU', 'GPL'], + ['GUN', 'GPL'], + ['+', ''], + ['GNU GPL', 'GPL'], + ['GNU/GPL', 'GPL'], + ['GNU GLP', 'GPL'], + ['GNU General Public License', 'GPL'], + ['Gnu public license', 'GPL'], + ['GNU Public License', 'GPL'], + ['GNU GENERAL PUBLIC LICENSE', 'GPL'], + ['MTI', 'MIT'], + ['Mozilla Public License', 'MPL'], + ['WTH', 'WTF'], + ['-License', ''] +]; + +var TRANSPOSED = 0; +var CORRECT = 1; + +// Simple corrections to nearly valid identifiers. +var transforms = [ + // e.g. 'mit' + function(argument) { + return argument.toUpperCase(); + }, + // e.g. 'MIT ' + function(argument) { + return argument.trim(); + }, + // e.g. 'M.I.T.' + function(argument) { + return argument.replace(/\./g, ''); + }, + // e.g. 'Apache- 2.0' + function(argument) { + return argument.replace(/\s+/g, ''); + }, + // e.g. 'CC BY 4.0'' + function(argument) { + return argument.replace(/\s+/g, '-'); + }, + // e.g. 'LGPLv2.1' + function(argument) { + return argument.replace('v', '-'); + }, + // e.g. 'Apache 2.0' + function(argument) { + return argument.replace(/,?\s*(\d)/, '-$1'); + }, + // e.g. 'GPL 2' + function(argument) { + return argument.replace(/,?\s*(\d)/, '-$1.0'); + }, + // e.g. 'Apache Version 2.0' + function(argument) { + return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2'); + }, + // e.g. 'Apache Version 2' + function(argument) { + return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0'); + }, + // e.g. 'ZLIB' + function(argument) { + return argument[0].toUpperCase() + argument.slice(1); + }, + // e.g. 'MPL/2.0' + function(argument) { + return argument.replace('/', '-'); + }, + // e.g. 'Apache 2' + function(argument) { + return argument + .replace(/\s*V\s*(\d)/, '-$1') + .replace(/(\d)$/, '$1.0'); + }, + // e.g. 'GPL-2.0-' + function(argument) { + return argument.slice(0, argument.length - 1); + }, + // e.g. 'GPL2' + function(argument) { + return argument.replace(/(\d)$/, '-$1.0'); + }, + // e.g. 'BSD 3' + function(argument) { + return argument.replace(/(-| )?(\d)$/, '-$2-Clause'); + }, + // e.g. 'BSD clause 3' + function(argument) { + return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause'); + }, + // e.g. 'BY-NC-4.0' + function(argument) { + return 'CC-' + argument; + }, + // e.g. 'BY-NC' + function(argument) { + return 'CC-' + argument + '-4.0'; + }, + // e.g. 'Attribution-NonCommercial' + function(argument) { + return argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, ''); + }, + // e.g. 'Attribution-NonCommercial' + function(argument) { + return 'CC-' + + argument + .replace('Attribution', 'BY') + .replace('NonCommercial', 'NC') + .replace('NoDerivatives', 'ND') + .replace(/ (\d)/, '-$1') + .replace(/ ?International/, '') + + '-4.0'; + } +]; + +// If all else fails, guess that strings containing certain substrings +// meant to identify certain licenses. +var lastResorts = [ + ['UNLI', 'Unlicense'], + ['WTF', 'WTFPL'], + ['2 CLAUSE', 'BSD-2-Clause'], + ['2-CLAUSE', 'BSD-2-Clause'], + ['3 CLAUSE', 'BSD-3-Clause'], + ['3-CLAUSE', 'BSD-3-Clause'], + ['AFFERO', 'AGPL-3.0'], + ['AGPL', 'AGPL-3.0'], + ['APACHE', 'Apache-2.0'], + ['ARTISTIC', 'Artistic-2.0'], + ['Affero', 'AGPL-3.0'], + ['BEER', 'Beerware'], + ['BOOST', 'BSL-1.0'], + ['BSD', 'BSD-2-Clause'], + ['ECLIPSE', 'EPL-1.0'], + ['FUCK', 'WTFPL'], + ['GNU', 'GPL-3.0'], + ['LGPL', 'LGPL-3.0'], + ['GPL', 'GPL-3.0'], + ['MIT', 'MIT'], + ['MPL', 'MPL-2.0'], + ['X11', 'X11'], + ['ZLIB', 'Zlib'] +]; + +var SUBSTRING = 0; +var IDENTIFIER = 1; + +var validTransformation = function(identifier) { + for (var i = 0; i < transforms.length; i++) { + var transformed = transforms[i](identifier); + if (transformed !== identifier && valid(transformed)) { + return transformed; + } + } + return null; +}; + +var validLastResort = function(identifier) { + var upperCased = identifier.toUpperCase(); + for (var i = 0; i < lastResorts.length; i++) { + var lastResort = lastResorts[i]; + if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { + return lastResort[IDENTIFIER]; + } + } + return null; +}; + +var anyCorrection = function(identifier, check) { + for (var i = 0; i < transpositions.length; i++) { + var transposition = transpositions[i]; + var transposed = transposition[TRANSPOSED]; + if (identifier.indexOf(transposed) > -1) { + var corrected = identifier.replace( + transposed, + transposition[CORRECT] + ); + var checked = check(corrected); + if (checked !== null) { + return checked; + } + } + } + return null; +}; + +module.exports = function(identifier) { + identifier = identifier.replace(/\+$/, ''); + if (valid(identifier)) { + return identifier; + } + var transformed = validTransformation(identifier); + if (transformed !== null) { + return transformed; + } + transformed = anyCorrection(identifier, function(argument) { + if (valid(argument)) { + return argument; + } + return validTransformation(argument); + }); + if (transformed !== null) { + return transformed; + } + transformed = validLastResort(identifier); + if (transformed !== null) { + return transformed; + } + transformed = anyCorrection(identifier, validLastResort); + if (transformed !== null) { + return transformed; + } + return null; +}; 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 d0946e3e25a54a..1fcb730362e6a7 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,25 +1,21 @@ { "name": "spdx-correct", "description": "correct invalid SPDX identifiers", - "version": "1.0.0", + "version": "1.0.2", "author": { "name": "Kyle E. Mitchell", "email": "kyle@kemitchell.com", - "url": "http://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/spdx-correct.js/issues" + "url": "https://kemitchell.com" }, "dependencies": { - "spdx": "^0.4.0" + "spdx-license-ids": "^1.0.2" }, "devDependencies": { - "jscs": "~1.13.1", - "jshint": "~2.8.0", - "jsmd": "~0.3.0", + "defence-cli": "^1.0.1", + "replace-require-self": "^1.0.0", + "spdx-expression-parse": "^1.0.0", "tape": "~4.0.0" }, - "homepage": "https://github.com/kemitchell/spdx-correct.js", "keywords": [ "SPDX", "law", @@ -28,37 +24,42 @@ "metadata" ], "license": "Apache-2.0", - "main": "spdx-correct.js", "repository": { "type": "git", "url": "git+https://github.com/kemitchell/spdx-correct.js.git" }, "scripts": { - "lint": "jshint spdx-correct.js test && jscs spdx-correct.js test", - "precommit": "npm run lint && npm run test", - "test": "jsmd README.md && tape test/*.test.js" + "test": "defence README.md | replace-require-self | node && tape *.test.js" + }, + "gitHead": "8430a3ad521e1455208db33faafcb79c7b074236", + "bugs": { + "url": "https://github.com/kemitchell/spdx-correct.js/issues" }, - "gitHead": "eab00824e5a1281fd7c522f33f0498c7d1cedd13", - "_id": "spdx-correct@1.0.0", - "_shasum": "c2a8654a5a56d8b2d44ee82dfdfc24aaec6b702c", + "homepage": "https://github.com/kemitchell/spdx-correct.js#readme", + "_id": "spdx-correct@1.0.2", + "_shasum": "4b3073d933ff51f3912f03ac5519498a4150db40", "_from": "spdx-correct@>=1.0.0 <1.1.0", - "_npmVersion": "2.11.0", - "_nodeVersion": "2.2.1", + "_npmVersion": "3.3.6", + "_nodeVersion": "4.2.1", "_npmUser": { "name": "kemitchell", "email": "kyle@kemitchell.com" }, + "dist": { + "shasum": "4b3073d933ff51f3912f03ac5519498a4150db40", + "tarball": "http://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz" + }, "maintainers": [ { "name": "kemitchell", "email": "kyle@kemitchell.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" } ], - "dist": { - "shasum": "c2a8654a5a56d8b2d44ee82dfdfc24aaec6b702c", - "tarball": "http://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.0.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.0.tgz", + "_resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js deleted file mode 100644 index 094712d62361c8..00000000000000 --- a/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-correct/spdx-correct.js +++ /dev/null @@ -1,235 +0,0 @@ -var spdx = require('spdx'); - -var valid = spdx.valid.bind(spdx); - -// Common transpositions of license identifier acronyms -var transpositions = [ - ['APGL', 'AGPL'], - ['Gpl', 'GPL'], - ['GLP', 'GPL'], - ['APL', 'Apache'], - ['ISD', 'ISC'], - ['GLP', 'GPL'], - ['IST', 'ISC'], - ['Claude', 'Clause'], - [' or later', '+'], - [' International', ''], - ['GNU', 'GPL'], - ['GUN', 'GPL'], - ['+', ''], - ['GNU GPL', 'GPL'], - ['GNU/GPL', 'GPL'], - ['GNU GLP', 'GPL'], - ['GNU General Public License', 'GPL'], - ['Gnu public license', 'GPL'], - ['GNU Public License', 'GPL'], - ['GNU GENERAL PUBLIC LICENSE', 'GPL'], - ['MTI', 'MIT'], - ['Mozilla Public License', 'MPL'], - ['WTH', 'WTF'], - ['-License', ''] -]; - -var TRANSPOSED = 0; -var CORRECT = 1; - -// Simple corrections to nearly valid identifiers. -var transforms = [ - // e.g. 'mit' - function(argument) { - return argument.toUpperCase(); - }, - // e.g. 'MIT ' - function(argument) { - return argument.trim(); - }, - // e.g. 'M.I.T.' - function(argument) { - return argument.replace(/\./g, ''); - }, - // e.g. 'Apache- 2.0' - function(argument) { - return argument.replace(/\s+/g, ''); - }, - // e.g. 'CC BY 4.0'' - function(argument) { - return argument.replace(/\s+/g, '-'); - }, - // e.g. 'LGPLv2.1' - function(argument) { - return argument.replace('v', '-'); - }, - // e.g. 'Apache 2.0' - function(argument) { - return argument.replace(/,?\s*(\d)/, '-$1'); - }, - // e.g. 'GPL 2' - function(argument) { - return argument.replace(/,?\s*(\d)/, '-$1.0'); - }, - // e.g. 'Apache Version 2.0' - function(argument) { - return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2'); - }, - // e.g. 'Apache Version 2' - function(argument) { - return argument.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0'); - }, - // e.g. 'ZLIB' - function(argument) { - return argument[0].toUpperCase() + argument.slice(1); - }, - // e.g. 'MPL/2.0' - function(argument) { - return argument.replace('/', '-'); - }, - // e.g. 'Apache 2' - function(argument) { - return argument - .replace(/\s*V\s*(\d)/, '-$1') - .replace(/(\d)$/, '$1.0'); - }, - // e.g. 'GPL-2.0-' - function(argument) { - return argument.slice(0, argument.length - 1); - }, - // e.g. 'GPL2' - function(argument) { - return argument.replace(/(\d)$/, '-$1.0'); - }, - // e.g. 'BSD 3' - function(argument) { - return argument.replace(/(-| )?(\d)$/, '-$2-Clause'); - }, - // e.g. 'BSD clause 3' - function(argument) { - return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause'); - }, - // e.g. 'BY-NC-4.0' - function(argument) { - return 'CC-' + argument; - }, - // e.g. 'BY-NC' - function(argument) { - return 'CC-' + argument + '-4.0'; - }, - // e.g. 'Attribution-NonCommercial' - function(argument) { - return argument - .replace('Attribution', 'BY') - .replace('NonCommercial', 'NC') - .replace('NoDerivatives', 'ND') - .replace(/ (\d)/, '-$1') - .replace(/ ?International/, ''); - }, - // e.g. 'Attribution-NonCommercial' - function(argument) { - return 'CC-' + - argument - .replace('Attribution', 'BY') - .replace('NonCommercial', 'NC') - .replace('NoDerivatives', 'ND') - .replace(/ (\d)/, '-$1') - .replace(/ ?International/, '') + - '-4.0'; - } -]; - -// If all else fails, guess that strings containing certain substrings -// meant to identify certain licenses. -var lastResorts = [ - ['UNLI', 'Unlicense'], - ['WTF', 'WTFPL'], - ['2 CLAUSE', 'BSD-2-Clause'], - ['2-CLAUSE', 'BSD-2-Clause'], - ['3 CLAUSE', 'BSD-3-Clause'], - ['3-CLAUSE', 'BSD-3-Clause'], - ['AFFERO', 'AGPL-3.0'], - ['AGPL', 'AGPL-3.0'], - ['APACHE', 'Apache-2.0'], - ['ARTISTIC', 'Artistic-2.0'], - ['Affero', 'AGPL-3.0'], - ['BEER', 'Beerware'], - ['BOOST', 'BSL-1.0'], - ['BSD', 'BSD-2-Clause'], - ['ECLIPSE', 'EPL-1.0'], - ['FUCK', 'WTFPL'], - ['GNU', 'GPL-3.0'], - ['LGPL', 'LGPL-3.0'], - ['GPL', 'GPL-3.0'], - ['MIT', 'MIT'], - ['MPL', 'MPL-2.0'], - ['X11', 'X11'], - ['ZLIB', 'Zlib'] -]; - -var SUBSTRING = 0; -var IDENTIFIER = 1; - -var validTransformation = function(identifier) { - for (var i = 0; i < transforms.length; i++) { - var transformed = transforms[i](identifier); - if (transformed !== identifier && valid(transformed)) { - return transformed; - } - } - return null; -}; - -var validLastResort = function(identifier) { - var upperCased = identifier.toUpperCase(); - for (var i = 0; i < lastResorts.length; i++) { - var lastResort = lastResorts[i]; - if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) { - return lastResort[IDENTIFIER]; - } - } - return null; -}; - -var anyCorrection = function(identifier, check) { - for (var i = 0; i < transpositions.length; i++) { - var transposition = transpositions[i]; - var transposed = transposition[TRANSPOSED]; - if (identifier.indexOf(transposed) > -1) { - var corrected = identifier.replace( - transposed, - transposition[CORRECT] - ); - var checked = check(corrected); - if (checked !== null) { - return checked; - } - } - } - return null; -}; - -module.exports = function(identifier) { - identifier = identifier.replace(/\+$/, ''); - if (valid(identifier)) { - return identifier; - } - var transformed = validTransformation(identifier); - if (transformed !== null) { - return transformed; - } - transformed = anyCorrection(identifier, function(argument) { - if (valid(argument)) { - return argument; - } - return validTransformation(argument); - }); - if (transformed !== null) { - return transformed; - } - transformed = validLastResort(identifier); - if (transformed !== null) { - return transformed; - } - transformed = anyCorrection(identifier, validLastResort); - if (transformed !== null) { - return transformed; - } - return null; -}; 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 new file mode 100644 index 00000000000000..51a8d6bf05d26c --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2015 Kyle E. Mitchell 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. 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 new file mode 100644 index 00000000000000..4b96d3e2a9e97d --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/README.md @@ -0,0 +1,44 @@ +```javascript +var parse = require('spdx-expression-parse') +var assert = require('assert') + +var firstAST = { + left: { license: 'LGPL-2.1' }, + conjunction: 'or', + right: { + left: { license: 'BSD-3-Clause' }, + conjunction: 'and', + right: { license: 'MIT' } } } + +assert.deepEqual( + 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' } } } + +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 }) }) }) +``` + +--- + +[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/validate-npm-package-license/node_modules/spdx-expression-parse/index.js b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/index.js new file mode 100644 index 00000000000000..3f38e3a7491c39 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/index.js @@ -0,0 +1,4 @@ +var parser = require('./parser.generated.js').parser + +module.exports = function(argument) { + return parser.parse(argument) } 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 new file mode 100644 index 00000000000000..43a663723df002 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/README.md @@ -0,0 +1 @@ +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 new file mode 100644 index 00000000000000..3b84277baad0c8 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/index.json @@ -0,0 +1,24 @@ +[ + "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" +] 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 new file mode 100644 index 00000000000000..734aafb5b39fc5 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/node_modules/spdx-exceptions/package.json @@ -0,0 +1,48 @@ +{ + "name": "spdx-exceptions", + "description": "list of SPDX standard license exceptions", + "version": "1.0.4", + "author": { + "name": "The Linux Foundation" + }, + "contributors": [ + { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "https://kemitchell.com/" + } + ], + "license": "CC-BY-3.0", + "repository": { + "type": "git", + "url": "git+https://github.com/kemitchell/spdx-exceptions.json.git" + }, + "gitHead": "770316d6c946417ab6efa8533b82d0b61779092b", + "bugs": { + "url": "https://github.com/kemitchell/spdx-exceptions.json/issues" + }, + "homepage": "https://github.com/kemitchell/spdx-exceptions.json#readme", + "_id": "spdx-exceptions@1.0.4", + "scripts": {}, + "_shasum": "220b84239119ae9045a892db81a83f4ce16f80fd", + "_from": "spdx-exceptions@>=1.0.4 <2.0.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + "dist": { + "shasum": "220b84239119ae9045a892db81a83f4ce16f80fd", + "tarball": "http://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz" + }, + "maintainers": [ + { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-1.0.4.tgz", + "readme": "ERROR: No README data found!" +} 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 new file mode 100644 index 00000000000000..662d8b47e60640 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/package.json @@ -0,0 +1,66 @@ +{ + "name": "spdx-expression-parse", + "description": "parse SPDX license expressions", + "version": "1.0.2", + "author": { + "name": "Kyle E. Mitchell", + "email": "kyle@kemitchell.com", + "url": "http://kemitchell.com" + }, + "dependencies": { + "spdx-exceptions": "^1.0.4", + "spdx-license-ids": "^1.0.0" + }, + "devDependencies": { + "defence-cli": "^1.0.1", + "jison": "^0.4.15", + "replace-require-self": "^1.0.0", + "uglify-js": "^2.4.24" + }, + "keywords": [ + "SPDX", + "law", + "legal", + "license", + "metadata", + "package", + "package.json", + "standards" + ], + "license": "(MIT AND CC-BY-3.0)", + "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" + }, + "gitHead": "ffe2fa7272ebf640b18286fc561f17a844d4f06b", + "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.2", + "_shasum": "d52b14b5e9670771440af225bcb563122ac452f6", + "_from": "spdx-expression-parse@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + }, + "dist": { + "shasum": "d52b14b5e9670771440af225bcb563122ac452f6", + "tarball": "http://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "kemitchell", + "email": "kyle@kemitchell.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.2.tgz" +} 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 new file mode 100644 index 00000000000000..7d9665a86b2d28 --- /dev/null +++ b/deps/npm/node_modules/validate-npm-package-license/node_modules/spdx-expression-parse/parser.generated.js @@ -0,0 +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 beb00f8bf68e7f..1b7e084b1b47e6 100644 --- a/deps/npm/node_modules/validate-npm-package-license/package.json +++ b/deps/npm/node_modules/validate-npm-package-license/package.json @@ -1,23 +1,20 @@ { "name": "validate-npm-package-license", "description": "Give me a string and I'll tell you if it's a valid npm package license string", - "version": "2.0.0", + "version": "3.0.1", "author": { "name": "Kyle E. Mitchell", "email": "kyle@kemitchell.com", - "url": "http://kemitchell.com" - }, - "bugs": { - "url": "https://github.com/kemitchell/validate-npm-package-license.js/issues" + "url": "https://kemitchell.com" }, "dependencies": { - "spdx": "~0.4.0", - "spdx-correct": "~1.0.0" + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" }, "devDependencies": { - "jsmd": "~0.3.0" + "defence-cli": "^1.0.1", + "replace-require-self": "^1.0.0" }, - "homepage": "https://github.com/kemitchell/validate-npm-package-license.js", "keywords": [ "license", "npm", @@ -25,25 +22,31 @@ "validation" ], "license": "Apache-2.0", - "main": "index.js", "repository": { "type": "git", "url": "git+https://github.com/kemitchell/validate-npm-package-license.js.git" }, "scripts": { - "precommit": "npm run test", - "test": "jsmd README.md" + "test": "defence README.md | replace-require-self | node" + }, + "gitHead": "00200d28f9960985f221bc1a8a71e4760daf39bf", + "bugs": { + "url": "https://github.com/kemitchell/validate-npm-package-license.js/issues" }, - "gitHead": "24544d4688f7cc9ed9685a3f9f90bd3f3bed58c0", - "_id": "validate-npm-package-license@2.0.0", - "_shasum": "ce0a29300edfa07e6ac6ad52eed8d6dfd194e42b", - "_from": "validate-npm-package-license@2.0.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", + "homepage": "https://github.com/kemitchell/validate-npm-package-license.js#readme", + "_id": "validate-npm-package-license@3.0.1", + "_shasum": "2804babe712ad3379459acfbe24746ab2c303fbc", + "_from": "validate-npm-package-license@>=3.0.1 <3.1.0", + "_npmVersion": "2.13.5", + "_nodeVersion": "0.12.7", "_npmUser": { "name": "kemitchell", "email": "kyle@kemitchell.com" }, + "dist": { + "shasum": "2804babe712ad3379459acfbe24746ab2c303fbc", + "tarball": "http://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz" + }, "maintainers": [ { "name": "kemitchell", @@ -54,11 +57,7 @@ "email": "ogd@aoaioxxysz.net" } ], - "dist": { - "shasum": "ce0a29300edfa07e6ac6ad52eed8d6dfd194e42b", - "tarball": "http://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-2.0.0.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-2.0.0.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/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 new file mode 100644 index 00000000000000..7f22ad5a13250d --- /dev/null +++ b/deps/npm/node_modules/which/.travis.yml @@ -0,0 +1,6 @@ +sudo: false +language: node_js +node_js: + - '0.10' + - '0.12' + - '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..f5adcb683e8340 --- /dev/null +++ b/deps/npm/node_modules/which/node_modules/isexe/package.json @@ -0,0 +1,54 @@ +{ + "name": "isexe", + "version": "1.1.1", + "description": "Minimal module to check if a file is executable.", + "main": "index.js", + "directories": { + "test": "test" + }, + "devDependencies": { + "mkdirp": "^0.5.1", + "rimraf": "^2.5.0", + "tap": "^5.1.2" + }, + "scripts": { + "test": "tap test/*.js --branches=100 --statements=100 --functions=100 --lines=100" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/isexe.git" + }, + "keywords": [], + "bugs": { + "url": "https://github.com/isaacs/isexe/issues" + }, + "homepage": "https://github.com/isaacs/isexe#readme", + "gitHead": "af83031caed58654ad9d20b98eb710d383618ad7", + "_id": "isexe@1.1.1", + "_shasum": "f0d4793ed2fb5c46bfdeab760bbb965f4485a66c", + "_from": "isexe@>=1.1.1 <2.0.0", + "_npmVersion": "2.14.15", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "f0d4793ed2fb5c46bfdeab760bbb965f4485a66c", + "tarball": "http://registry.npmjs.org/isexe/-/isexe-1.1.1.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "_resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.1.tgz", + "readme": "ERROR: No README data found!" +} 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 8cffb7986e7ab6..f3b3fd32d91ac6 100644 --- a/deps/npm/node_modules/which/package.json +++ b/deps/npm/node_modules/which/package.json @@ -6,7 +6,7 @@ }, "name": "which", "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "1.1.1", + "version": "1.2.4", "repository": { "type": "git", "url": "git://github.com/isaacs/node-which.git" @@ -17,33 +17,34 @@ }, "license": "ISC", "dependencies": { - "is-absolute": "^0.1.7" + "is-absolute": "^0.1.7", + "isexe": "^1.1.1" }, "devDependencies": { "mkdirp": "^0.5.0", "rimraf": "^2.3.3", - "tap": "^1.0.2" + "tap": "^5.1.1" }, "scripts": { - "test": "tap test/*.js" + "test": "tap test/*.js --cov" }, - "gitHead": "c80a08e9f8cf7a5c0f39c2e2f87f18f153b118a8", + "gitHead": "1375684d40af9de2ecc527d1ab9b87b537d7a1cc", "bugs": { "url": "https://github.com/isaacs/node-which/issues" }, "homepage": "https://github.com/isaacs/node-which#readme", - "_id": "which@1.1.1", - "_shasum": "9ce512459946166e12c083f08ec073380fc8cbbb", - "_from": "which@>=1.1.1 <1.2.0", - "_npmVersion": "2.9.1", - "_nodeVersion": "2.0.1", + "_id": "which@1.2.4", + "_shasum": "1557f96080604e5b11b3599eb9f45b50a9efd722", + "_from": "which@1.2.4", + "_npmVersion": "2.14.15", + "_nodeVersion": "4.0.0", "_npmUser": { "name": "isaacs", - "email": "isaacs@npmjs.com" + "email": "i@izs.me" }, "dist": { - "shasum": "9ce512459946166e12c083f08ec073380fc8cbbb", - "tarball": "http://registry.npmjs.org/which/-/which-1.1.1.tgz" + "shasum": "1557f96080604e5b11b3599eb9f45b50a9efd722", + "tarball": "http://registry.npmjs.org/which/-/which-1.2.4.tgz" }, "maintainers": [ { @@ -52,5 +53,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/which/-/which-1.1.1.tgz" + "_resolved": "https://registry.npmjs.org/which/-/which-1.2.4.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/which/test/basic.js b/deps/npm/node_modules/which/test/basic.js index 189ca6d0ad5bb4..54c8d2384dc27f 100644 --- a/deps/npm/node_modules/which/test/basic.js +++ b/deps/npm/node_modules/which/test/basic.js @@ -51,31 +51,67 @@ t.test('make executable', function (t) { }) t.test('find when executable', function (t) { - t.plan(2) var opt = { pathExt: '.sh' } var expect = path.resolve(fixture, 'foo.sh').toLowerCase() + var PATH = process.env.PATH || process.env.Path t.test('absolute', function (t) { - t.plan(2) - runTest(t) + runTest(fixture + '/foo.sh', t) + }) + + t.test('with process.env.PATH', function (t) { + process.env.PATH = process.env.Path = fixture + runTest('foo.sh', t) + }) + + t.test('with process.env.Path', { + skip: isWindows ? false : 'Only for Windows' + }, function (t) { + process.env.PATH = "" + process.env.Path = fixture + 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) }) - function runTest(t) { - which(fixture + '/foo.sh', opt, function (er, found) { + 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(fixture + '/foo.sh', opt).toLowerCase() - t.equal(found, expect) } - t.test('with path', function (t) { - t.plan(2) - opt.path = fixture - runTest(t) - }) + 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 13fc26dcfbb0ce..5cf0124d7899b5 100644 --- a/deps/npm/node_modules/which/which.js +++ b/deps/npm/node_modules/which/which.js @@ -7,58 +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') -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 & 0001) - || (mod & 0010) && process.getgid && gid === process.getgid() - || (mod & 0100) && process.getuid && uid === process.getuid() - || (mod & 0110) && process.getuid && 0 === process.getuid() - - if (process.getgroups && (mod & 0010)) { - var groups = process.getgroups() - for (var g = 0; g < groups.length; g++) { - if (groups[g] === gid) - return true - } - } - - return ret - } -} - -function which (cmd, opt, cb) { - if (typeof opt === 'function') { - cb = opt - opt = {} - } - +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 = [''] - // On windows, env.Path is common. - if (isWindows && !pathEnv) { - var k = Object.keys(process.env) - for (var p = 0; p < k.length; p++) { - if (p.toLowerCase() === 'path') { - pathEnv = process.env[p] - break - } - } - } - 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('') } @@ -68,17 +36,47 @@ function which (cmd, opt, cb) { if (isAbsolute(cmd)) pathEnv = [''] + return { + env: pathEnv, + ext: pathExt, + extExe: pathExtExe + } +} + +function which (cmd, opt, cb) { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + + 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) }) @@ -87,51 +85,37 @@ function which (cmd, opt, cb) { } function whichSync (cmd, opt) { - if (!opt) - opt = {} - - var colon = opt.colon || COLON - - var pathEnv = opt.path || process.env.PATH || '' - var pathExt = [''] - - // On windows, env.Path is common. - if (isWindows && !pathEnv) { - var k = Object.keys(process.env) - for (var p = 0; p < k.length; p++) { - if (p.toLowerCase() === 'path') { - pathEnv = process.env[p] - break - } - } - } - - pathEnv = pathEnv.split(colon) + opt = opt || {} - if (isWindows) { - pathEnv.unshift(process.cwd()) - pathExt = (opt.pathExt || process.env.PATHEXT || '.EXE').split(colon) - if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') - pathExt.unshift('') - } - - // If it's absolute, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - if (isAbsolute(cmd)) - pathEnv = [''] + 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/write-file-atomic/.nyc_output/47248.json b/deps/npm/node_modules/write-file-atomic/.nyc_output/47248.json new file mode 100644 index 00000000000000..9e26dfeeb6e641 --- /dev/null +++ b/deps/npm/node_modules/write-file-atomic/.nyc_output/47248.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/deps/npm/node_modules/write-file-atomic/.nyc_output/47250.json b/deps/npm/node_modules/write-file-atomic/.nyc_output/47250.json new file mode 100644 index 00000000000000..eada5f58dd8435 --- /dev/null +++ b/deps/npm/node_modules/write-file-atomic/.nyc_output/47250.json @@ -0,0 +1 @@ +{"./index.js":{"path":"./index.js","s":{"1":1,"2":1,"3":1,"4":1,"5":14,"6":14,"7":42,"8":14,"9":1,"10":1,"11":14,"12":1,"13":7,"14":5,"15":5,"16":7,"17":5,"18":7,"19":7,"20":7,"21":4,"22":1,"23":7,"24":5,"25":7,"26":7,"27":7,"28":6,"29":1,"30":5,"31":4,"32":4,"33":4},"b":{"1":[5,2],"2":[5,2],"3":[7,1],"4":[4,3],"5":[5,2],"6":[1,5]},"f":{"1":14,"2":14,"3":7,"4":7,"5":4,"6":7},"fnMap":{"1":{"name":"murmurhex","line":6,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":22}}},"2":{"name":"(anonymous_2)","line":12,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":37}}},"3":{"name":"writeFile","line":16,"loc":{"start":{"line":16,"column":17},"end":{"line":16,"column":72}}},"4":{"name":"(anonymous_4)","line":27,"loc":{"start":{"line":27,"column":5},"end":{"line":27,"column":20}}},"5":{"name":"(anonymous_5)","line":28,"loc":{"start":{"line":28,"column":29},"end":{"line":28,"column":41}}},"6":{"name":"writeFileSync","line":33,"loc":{"start":{"line":33,"column":22},"end":{"line":33,"column":71}}}},"statementMap":{"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":40}},"4":{"start":{"line":6,"column":0},"end":{"line":10,"column":1}},"5":{"start":{"line":7,"column":2},"end":{"line":7,"column":30}},"6":{"start":{"line":8,"column":2},"end":{"line":8,"column":77}},"7":{"start":{"line":8,"column":48},"end":{"line":8,"column":77}},"8":{"start":{"line":9,"column":2},"end":{"line":9,"column":22}},"9":{"start":{"line":11,"column":0},"end":{"line":11,"column":19}},"10":{"start":{"line":12,"column":0},"end":{"line":14,"column":1}},"11":{"start":{"line":13,"column":2},"end":{"line":13,"column":75}},"12":{"start":{"line":16,"column":0},"end":{"line":31,"column":1}},"13":{"start":{"line":17,"column":2},"end":{"line":20,"column":3}},"14":{"start":{"line":18,"column":4},"end":{"line":18,"column":22}},"15":{"start":{"line":19,"column":4},"end":{"line":19,"column":18}},"16":{"start":{"line":21,"column":2},"end":{"line":21,"column":28}},"17":{"start":{"line":21,"column":16},"end":{"line":21,"column":28}},"18":{"start":{"line":22,"column":2},"end":{"line":22,"column":36}},"19":{"start":{"line":23,"column":2},"end":{"line":30,"column":4}},"20":{"start":{"line":28,"column":4},"end":{"line":29,"column":18}},"21":{"start":{"line":28,"column":43},"end":{"line":28,"column":57}},"22":{"start":{"line":33,"column":0},"end":{"line":44,"column":1}},"23":{"start":{"line":34,"column":2},"end":{"line":34,"column":28}},"24":{"start":{"line":34,"column":16},"end":{"line":34,"column":28}},"25":{"start":{"line":35,"column":2},"end":{"line":35,"column":36}},"26":{"start":{"line":36,"column":2},"end":{"line":43,"column":3}},"27":{"start":{"line":37,"column":4},"end":{"line":37,"column":44}},"28":{"start":{"line":38,"column":4},"end":{"line":38,"column":82}},"29":{"start":{"line":38,"column":23},"end":{"line":38,"column":82}},"30":{"start":{"line":39,"column":4},"end":{"line":39,"column":36}},"31":{"start":{"line":41,"column":4},"end":{"line":41,"column":47}},"32":{"start":{"line":41,"column":10},"end":{"line":41,"column":33}},"33":{"start":{"line":42,"column":4},"end":{"line":42,"column":13}}},"branchMap":{"1":{"line":17,"type":"if","locations":[{"start":{"line":17,"column":2},"end":{"line":17,"column":2}},{"start":{"line":17,"column":2},"end":{"line":17,"column":2}}]},"2":{"line":21,"type":"if","locations":[{"start":{"line":21,"column":2},"end":{"line":21,"column":2}},{"start":{"line":21,"column":2},"end":{"line":21,"column":2}}]},"3":{"line":25,"type":"binary-expr","locations":[{"start":{"line":25,"column":4},"end":{"line":25,"column":17}},{"start":{"line":25,"column":21},"end":{"line":25,"column":82}}]},"4":{"line":28,"type":"cond-expr","locations":[{"start":{"line":28,"column":10},"end":{"line":28,"column":59}},{"start":{"line":29,"column":8},"end":{"line":29,"column":18}}]},"5":{"line":34,"type":"if","locations":[{"start":{"line":34,"column":2},"end":{"line":34,"column":2}},{"start":{"line":34,"column":2},"end":{"line":34,"column":2}}]},"6":{"line":38,"type":"if","locations":[{"start":{"line":38,"column":4},"end":{"line":38,"column":4}},{"start":{"line":38,"column":4},"end":{"line":38,"column":4}}]}}}} \ No newline at end of file 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=3.0.2 <4.0.0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/write-file-atomic/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.2", - "rawSpec": "^3.0.2", - "scope": null, - "spec": ">=3.0.2 <4.0.0", - "type": "range" - }, - "_requiredBy": [ - "/write-file-atomic" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@^3.0.2", - "_where": "/Users/isaacs/dev/npm/npm/node_modules/write-file-atomic", - "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/write-file-atomic/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/write-file-atomic/node_modules/graceful-fs/polyfills.js deleted file mode 100644 index 8ac5006e2da24d..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/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/write-file-atomic/node_modules/graceful-fs/test/max-open.js b/deps/npm/node_modules/write-file-atomic/node_modules/graceful-fs/test/max-open.js deleted file mode 100644 index a6b9ba43d3a6de..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/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/write-file-atomic/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/write-file-atomic/node_modules/graceful-fs/test/open.js deleted file mode 100644 index 85732f236b0026..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/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/write-file-atomic/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/write-file-atomic/node_modules/graceful-fs/test/readdir-sort.js deleted file mode 100644 index cb63a6846ed78f..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/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/write-file-atomic/node_modules/graceful-fs/test/write-then-read.js b/deps/npm/node_modules/write-file-atomic/node_modules/graceful-fs/test/write-then-read.js deleted file mode 100644 index 21e4c26bf6c9dc..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/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/write-file-atomic/package.json b/deps/npm/node_modules/write-file-atomic/package.json index 27f6694b7c0521..36598cd4912e6b 100644 --- a/deps/npm/node_modules/write-file-atomic/package.json +++ b/deps/npm/node_modules/write-file-atomic/package.json @@ -1,14 +1,14 @@ { "name": "write-file-atomic", - "version": "1.1.2", + "version": "1.1.4", "description": "Write files in an atomic fashion w/configurable ownership", "main": "index.js", "scripts": { - "test": "tap test/*.js" + "test": "standard && tap --coverage test/*.js" }, "repository": { "type": "git", - "url": "git@github.com:iarna/write-file-atomic.git" + "url": "git+ssh://git@github.com/iarna/write-file-atomic.git" }, "keywords": [ "writeFile", @@ -25,33 +25,19 @@ }, "homepage": "https://github.com/iarna/write-file-atomic", "dependencies": { - "graceful-fs": "^3.0.2", + "graceful-fs": "^4.1.2", + "imurmurhash": "^0.1.4", "slide": "^1.1.5" }, "devDependencies": { "require-inject": "^1.1.0", - "tap": "^0.4.12" - }, - "gitHead": "b721f8a71223bcf162f1ee4ff4677f31de1c061f", - "_id": "write-file-atomic@1.1.2", - "_shasum": "ff3d61f1c2f5bb71e8ebe491a7157bf7d60435a4", - "_from": "write-file-atomic@>=1.1.2 <1.2.0", - "_npmVersion": "2.7.6", - "_nodeVersion": "1.6.2", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" - }, - "dist": { - "shasum": "ff3d61f1c2f5bb71e8ebe491a7157bf7d60435a4", - "tarball": "http://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.2.tgz" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.2.tgz" + "standard": "^5.4.1", + "tap": "^2.3.1" + }, + "readme": "write-file-atomic\n-----------------\n\nThis is an extension for node's `fs.writeFile` that makes its operation\natomic and allows you set ownership (uid/gid of the file).\n\n### var writeFileAtomic = require('write-file-atomic')
      writeFileAtomic(filename, data, [options], callback)\n\n* filename **String**\n* data **String** | **Buffer**\n* options **Object**\n * chown **Object**\n * uid **Number**\n * gid **Number**\n * encoding **String** | **Null** default = 'utf8'\n * mode **Number** default = 438 (aka 0666 in Octal)\ncallback **Function**\n\nAtomically and asynchronously writes data to a file, replacing the file if it already\nexists. data can be a string or a buffer.\n\nThe file is initially named `filename + \".\" + md5hex(__filename, process.pid, ++invocations)`.\nIf writeFile completes successfully then, if passed the **chown** option it will change\nthe ownership of the file. Finally it renames the file back to the filename you specified. If\nit encounters errors at any of these steps it will attempt to unlink the temporary file and then\npass the error back to the caller.\n\nIf provided, the **chown** option requires both **uid** and **gid** properties or else\nyou'll get an error.\n\nThe **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'.\n\nExample:\n\n```javascript\nwriteFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) {\n if (err) throw err;\n console.log('It\\'s saved!');\n});\n```\n\n### var writeFileAtomicSync = require('write-file-atomic').sync
      writeFileAtomicSync(filename, data, [options])\n\nThe synchronous version of **writeFileAtomic**.\n", + "readmeFilename": "README.md", + "gitHead": "42dc04a17af96ac045f4979c8c951ee5a14a8b8b", + "_id": "write-file-atomic@1.1.4", + "_shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", + "_from": "write-file-atomic@>=1.1.4 <1.2.0" } 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 4cee1cf1a74bf4..660b192626db85 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "2.13.3", + "version": "2.14.20", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -31,76 +31,78 @@ "bin": "./bin/npm-cli.js", "dependencies": { "abbrev": "~1.0.7", - "ansi": "~0.3.0", + "ansi": "~0.3.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "~1.0.0", "async-some": "~1.0.2", "block-stream": "0.0.8", "char-spinner": "~1.0.1", - "chmodr": "~0.1.1", - "chownr": "0.0.2", - "cmd-shim": "~2.0.1", - "columnify": "~1.5.1", - "config-chain": "~1.1.9", + "chmodr": "~1.0.2", + "chownr": "~1.0.1", + "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.6", - "fs-write-stream-atomic": "~1.0.3", - "fstream": "~1.0.7", - "fstream-npm": "~1.0.4", + "fs-vacuum": "~1.2.7", + "fs-write-stream-atomic": "~1.0.8", + "fstream": "~1.0.8", + "fstream-npm": "~1.0.7", "github-url-from-git": "~1.4.0", "github-url-from-username-repo": "~1.0.2", - "glob": "~5.0.14", - "graceful-fs": "~4.1.2", + "glob": "~5.0.15", + "graceful-fs": "~4.1.3", "hosted-git-info": "~2.1.4", "inflight": "~1.0.4", "inherits": "~2.0.1", "ini": "~1.3.4", - "init-package-json": "~1.7.1", + "init-package-json": "~1.9.3", "lockfile": "~1.0.1", - "lru-cache": "~2.6.5", - "minimatch": "~2.0.10", + "lru-cache": "~3.2.0", + "minimatch": "~3.0.0", "mkdirp": "~0.5.1", - "node-gyp": "~2.0.2", - "nopt": "~3.0.3", + "node-gyp": "~3.3.0", + "nopt": "~3.0.6", "normalize-git-url": "~3.0.1", - "normalize-package-data": "~2.3.1", + "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": "~6.5.1", + "npm-install-checks": "~1.0.7", + "npm-package-arg": "~4.1.0", + "npm-registry-client": "~7.0.9", "npm-user-validate": "~0.1.2", - "npmlog": "~1.2.1", - "once": "~1.3.2", + "npmlog": "~2.0.2", + "once": "~1.3.3", "opener": "~1.4.1", "osenv": "~0.1.3", "path-is-inside": "~1.0.0", - "read": "~1.0.6", - "read-installed": "~4.0.2", - "read-package-json": "~2.0.0", + "read": "~1.0.7", + "read-installed": "~4.0.3", + "read-package-json": "~2.0.3", "readable-stream": "~1.1.13", "realize-package-specifier": "~3.0.1", - "request": "~2.60.0", - "retry": "~0.6.1", - "rimraf": "~2.4.2", - "semver": "~5.0.1", - "sha": "~1.3.0", + "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", - "tar": "~2.1.1", + "spdx-license-ids": "~1.2.0", + "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", "validate-npm-package-name": "~2.2.2", - "which": "~1.1.1", + "which": "~1.2.4", "wrappy": "~1.0.1", - "write-file-atomic": "~1.1.2" + "write-file-atomic": "~1.1.4" }, "bundleDependencies": [ "abbrev", "ansi", + "ansi-regex", "ansicolors", "ansistyles", "archy", @@ -123,6 +125,7 @@ "glob", "graceful-fs", "hosted-git-info", + "imurmurhash", "inflight", "inherits", "ini", @@ -157,7 +160,8 @@ "sha", "slide", "sorted-object", - "spdx", + "spdx-license-ids", + "strip-ansi", "tar", "text-table", "uid-number", @@ -169,24 +173,24 @@ "write-file-atomic" ], "devDependencies": { - "deep-equal": "~1.0.0", - "marked": "~0.3.3", + "deep-equal": "~1.0.1", + "marked": "~0.3.5", "marked-man": "~0.1.5", - "nock": "~2.7.0", - "npm-registry-couchapp": "~2.6.7", + "npm-registry-couchapp": "~2.6.12", "npm-registry-mock": "~1.0.0", - "require-inject": "~1.2.0", + "require-inject": "~1.3.0", "sprintf-js": "~1.0.2", - "tap": "~1.3.1" + "tap": "~2.3.1" }, "scripts": { - "test-legacy": "node ./test/run.js", - "test": "tap --timeout 240 test/tap/*.js", - "tap": "tap --timeout 240 test/tap/*.js", - "test-all": "npm run test-legacy && npm test", - "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true", + "dumpconf": "env | grep npm | sort | uniq", "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc", - "dumpconf": "env | grep npm | sort | uniq" + "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\"" }, "license": "Artistic-2.0" } diff --git a/deps/npm/scripts/doc-build.sh b/deps/npm/scripts/doc-build.sh index 6a5c7aa70f6b35..61819028be39b2 100755 --- a/deps/npm/scripts/doc-build.sh +++ b/deps/npm/scripts/doc-build.sh @@ -103,22 +103,15 @@ case $dest in | man_replace_tokens > $dest exit $? ;; - - html/partial/*.html) - url=${dest/html\/partial\//} - cat $src | ./node_modules/.bin/marked | html_replace_tokens $url > $dest - ;; - - html/*.html) + *.html) url=${dest/html\//} (cat html/dochead.html && \ - cat $src && \ + cat $src | ./node_modules/.bin/marked && cat html/docfoot.html)\ | html_replace_tokens $url \ > $dest exit $? ;; - *) echo "Invalid destination type: $dest" >&2 exit 1 diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index 3537df68761aa6..de0a9f416d79d8 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -18,6 +18,8 @@ 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.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 diff --git a/deps/npm/test/fixtures/config/.npmrc b/deps/npm/test/fixtures/config/.npmrc deleted file mode 100644 index 7d59bd8be1b82d..00000000000000 --- a/deps/npm/test/fixtures/config/.npmrc +++ /dev/null @@ -1 +0,0 @@ -just = testing 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/npm_cache/npm-test-files/1.2.5/package.tgz b/deps/npm/test/npm_cache/npm-test-files/1.2.5/package.tgz new file mode 100644 index 00000000000000..b24f7944c59584 Binary files /dev/null and b/deps/npm/test/npm_cache/npm-test-files/1.2.5/package.tgz differ diff --git a/deps/npm/test/npm_cache/npm-test-files/1.2.5/package/package.json b/deps/npm/test/npm_cache/npm-test-files/1.2.5/package/package.json new file mode 100644 index 00000000000000..717149c176cc69 --- /dev/null +++ b/deps/npm/test/npm_cache/npm-test-files/1.2.5/package/package.json @@ -0,0 +1 @@ +{"name":"npm-test-files","version":"1.2.5","files":["sub1/sub","sub2"],"readme":"ERROR: No README data found!","_id":"npm-test-files@1.2.5","scripts":{},"_shasum":"3f516561e52d6958b818db2a4fbc1b40707e68e3","_from":"npm-test-files","_resolved":"file:npm-test-files"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/npm-test-preferglobal-dep/0.0.0/package.tgz b/deps/npm/test/npm_cache/npm-test-preferglobal-dep/0.0.0/package.tgz deleted file mode 100644 index 3d33fc88a3f681..00000000000000 Binary files a/deps/npm/test/npm_cache/npm-test-preferglobal-dep/0.0.0/package.tgz and /dev/null differ diff --git a/deps/npm/test/npm_cache/npm-test-preferglobal-dep/0.0.0/package/package.json b/deps/npm/test/npm_cache/npm-test-preferglobal-dep/0.0.0/package/package.json deleted file mode 100644 index 75614bdfdaa6fe..00000000000000 --- a/deps/npm/test/npm_cache/npm-test-preferglobal-dep/0.0.0/package/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"npm-test-preferglobal-dep","version":"0.0.0","preferGlobal":true,"readme":"ERROR: No README data found!","_id":"npm-test-preferglobal-dep@0.0.0","scripts":{},"_shasum":"48c51014a917da64c1770f91dc4db16525c7c5e2","_from":"../npm-test-preferglobal-dep","_resolved":"file:../npm-test-preferglobal-dep"} \ No newline at end of file diff --git a/deps/npm/test/npm_cache/registry.npmjs.org/jshint/.cache.json b/deps/npm/test/npm_cache/registry.npmjs.org/jshint/.cache.json deleted file mode 100644 index eb4066830faef5..00000000000000 --- a/deps/npm/test/npm_cache/registry.npmjs.org/jshint/.cache.json +++ /dev/null @@ -1 +0,0 @@ -{"_id":"jshint","_rev":"322-0929561aae4ba51e3c4396517b42d181","name":"jshint","description":"Static analysis tool for JavaScript","dist-tags":{"latest":"2.8.0"},"versions":{"0.1.8":{"name":"jshint","version":"0.1.8","description":"a cli for jshint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"main":"./packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","lib","bin","package.json"],"dependencies":{"argsparser":">=0.0.3"},"_id":"jshint@0.1.8","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.17","_nodeVersion":"v0.4.2","directories":{"lib":"./lib","bin":"./bin"},"bin":{"jshint":"bin/jshint"},"_defaultsLoaded":true,"dist":{"shasum":"d90e12dccb1bc490409a079defa01e21ee16a6e8","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.1.8.tgz"}},"0.1.9":{"name":"jshint","version":"0.1.9","description":"a cli for jshint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"main":"./packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","lib","bin","package.json"],"dependencies":{"argsparser":">=0.0.3"},"_id":"jshint@0.1.9","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.17","_nodeVersion":"v0.4.2","directories":{"lib":"./lib","bin":"./bin"},"bin":{"jshint":"bin/jshint"},"_defaultsLoaded":true,"dist":{"shasum":"4ec9f0415c6746021de4b7eb5a3ca1a3ed7f33a7","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.1.9.tgz"}},"0.2.0":{"name":"jshint","version":"0.2.0","description":"a cli for jshint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"main":"./packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","lib","bin","package.json"],"dependencies":{"argsparser":">=0.0.3"},"_id":"jshint@0.2.0","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.17","_nodeVersion":"v0.4.2","directories":{"lib":"./lib","bin":"./bin"},"bin":{"jshint":"bin/jshint"},"_defaultsLoaded":true,"dist":{"shasum":"0c63f41429bb1a764ce5936f7aaaf806b771d947","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.2.0.tgz"}},"0.2.1":{"name":"jshint","version":"0.2.1","description":"a cli for jshint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP"],"dependencies":{"argsparser":">=0.0.3"},"devDependencies":{},"_id":"jshint@0.2.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.6","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"c8589746ff9750d89c4b9e3a0996a9f81b6493bc","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.2.1.tgz"},"scripts":{},"directories":{}},"0.2.2":{"name":"jshint","version":"0.2.2","description":"a cli for jshint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint"],"dependencies":{"argsparser":">=0.0.3"},"_npmJsonOpts":{"file":"/Users/isaacs/.npm/jshint/0.2.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"jshint@0.2.2","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.13","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"77091e70ea88bc28904d8e0e7ae2c45b638b477a","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.2.2.tgz"},"scripts":{},"directories":{}},"0.2.3":{"name":"jshint","version":"0.2.3","description":"a cli for jshint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3"},"preferGlobal":true,"_npmJsonOpts":{"file":"/home/brent/.npm/jshint/0.2.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"jshint@0.2.3","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.15","_nodeVersion":"v0.4.8","_defaultsLoaded":true,"dist":{"shasum":"d31480ae27228f1c4a7267d521b85fcb9662e53e","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.2.3.tgz"},"scripts":{},"directories":{}},"0.3.0":{"name":"jshint","version":"0.3.0","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","glob":">=2.0.7"},"preferGlobal":true,"_npmJsonOpts":{"file":"/Users/brent/.npm/jshint/0.3.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"jshint@0.3.0","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"b011c63b3a805e80e03453768f5a399e02fe5bc0","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.3.0.tgz"},"scripts":{},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.3.1":{"name":"jshint","version":"0.3.1","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","glob":">=2.0.7"},"preferGlobal":true,"_npmJsonOpts":{"file":"/Users/brent/.npm/jshint/0.3.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"jshint@0.3.1","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"260df1eaaa6462becf1693da55e831fa87abcb69","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.3.1.tgz"},"scripts":{},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.4.0":{"name":"jshint","version":"0.4.0","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","glob":">=2.0.7","jasmine-node":"1.0.7"},"bundledDependencies":["argsparser","glob"],"preferGlobal":true,"_npmJsonOpts":{"file":"/Users/brent/.npm/jshint/0.4.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"jshint@0.4.0","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"8349e2e7bb89147c8c8b47c8b1353d735af6dfeb","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.4.0.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.0":{"name":"jshint","version":"0.5.0","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","jasmine-node":"1.0.7","minimatch":">=0.0.4"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.0","bundleDependencies":["argsparser","minimatch"],"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.93","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"a2351b0dbd7ba63f7b94da7d0769ac600e788fdd","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.0.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.1":{"name":"jshint","version":"0.5.1","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.1","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.99","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"3bc469d32d67e818055799cc2f7212a6f9b8d25a","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.1.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.2":{"name":"jshint","version":"0.5.2","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.2","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.99","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"2db6c1b8597fd820ae161f60d77c9db12efe40b9","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.2.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.3":{"name":"jshint","version":"0.5.3","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.3","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-2","_nodeVersion":"v0.6.3","_defaultsLoaded":true,"dist":{"shasum":"7519c1c8d42eca0799f4f30e58b172ff806f5e78","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.3.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.4":{"name":"jshint","version":"0.5.4","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.4","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-2","_nodeVersion":"v0.6.3","_defaultsLoaded":true,"dist":{"shasum":"7660480d2a99fd693addbaeecb56ac5d6ad4e1e2","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.4.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.5":{"name":"jshint","version":"0.5.5","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.5","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-2","_nodeVersion":"v0.6.3","_defaultsLoaded":true,"dist":{"shasum":"f2a2a69ea0d159058cfd56a6bd481866e6d82a82","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.5.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.6":{"name":"jshint","version":"0.5.6","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.6","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-beta-10","_nodeVersion":"v0.6.7","_defaultsLoaded":true,"dist":{"shasum":"64ed3d3701d2becbd3f838b4d4280aef72731b2c","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.6.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"}],"directories":{}},"0.5.7":{"name":"jshint","version":"0.5.7","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"_id":"jshint@0.5.7","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.5","_defaultsLoaded":true,"dist":{"shasum":"d7944db46f3bb7baefea3d13f23c99a8cd5b753b","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.7.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.5.8":{"name":"jshint","version":"0.5.8","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"_id":"jshint@0.5.8","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"8ce1e5a237aa1d1d8957e6b048028dc26a3e22a8","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.8.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.5.9":{"name":"jshint","version":"0.5.9","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":">=0.0.3","minimatch":">=0.0.4"},"devDependencies":{"jasmine-node":"1.0.7"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.5.9","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"ccb5ba9d2818dfe78857feaa71ccba0cb10aebc9","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.5.9.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.6.0":{"name":"jshint","version":"0.6.0","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":"0.0.x","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.6.0","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"38c95b34c825861cb7123f913cbcbe9091247d25","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.6.0.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.6.1":{"name":"jshint","version":"0.6.1","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":"0.0.x","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.6.1","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"5b9e69b5867cb356e25d49d7a642a696207e46fa","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.6.1.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.6.2":{"name":"jshint","version":"0.6.2","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":"0.0.x","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.6.2","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.12","_nodeVersion":"v0.6.14","_defaultsLoaded":true,"dist":{"shasum":"b461612bf710df8d71d4274e04f5dcc7bee2a4d1","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.6.2.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.6.3":{"name":"jshint","version":"0.6.3","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"argsparser":"0.0.x","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"_id":"jshint@0.6.3","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"d07c254c928a842fbe92881ad3342c98bdd79530","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.6.3.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.7.0":{"name":"jshint","version":"0.7.0","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","HELP","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.7.0","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"4070f1ed3c13c154ce87eb4037593bbb5e4d9cd8","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.7.0.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.7.1":{"name":"jshint","version":"0.7.1","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"brentlintner","email":"brent.lintner@gmail.com"},"_id":"jshint@0.7.1","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"7c62cdd1b260ec71743a9851ce79a9fc9d22ff15","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.7.1.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.7.2":{"name":"jshint","version":"0.7.2","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"_id":"jshint@0.7.2","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"35064bd9aef2798e56ae9e81962bdd3435151510","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.7.2.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.7.3":{"name":"jshint","version":"0.7.3","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"_id":"jshint@0.7.3","optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.9","_defaultsLoaded":true,"dist":{"shasum":"a1920fe3d12401d36333955691e14e888796e218","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.7.3.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.8.0":{"name":"jshint","version":"0.8.0","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_id":"jshint@0.8.0","dist":{"shasum":"19393131b1bdff8fadb94c104be8425e65fdade4","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.8.0.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.8.1":{"name":"jshint","version":"0.8.1","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_id":"jshint@0.8.1","dist":{"shasum":"9bcaeb31a7fd3e799d4bea20be784724feeabead","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.8.1.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.8.2":{"name":"jshint","version":"0.8.2","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_id":"jshint@0.8.2","dist":{"shasum":"b49311dcbcf7c8cb8aa81319372959f201013191","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.8.2.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.9.0":{"name":"jshint","version":"0.9.0","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_id":"jshint@0.9.0","dist":{"shasum":"225022bdeb44ac608ce5773ebe01e020eef413c3","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.9.0.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"0.9.1":{"name":"jshint","version":"0.9.1","description":"A CLI for JSHint","homepage":"http://github.com/jshint/node-jshint","author":{"name":"Brent Lintner","email":"brent.lintner@gmail.com","url":"http://github.com/brentlintner"},"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/mit-license.php"}],"bin":{"jshint":"./bin/hint"},"main":"packages/jshint/jshint","files":["packages/jshint/README.markdown","packages/jshint/jshint.js","README.md","LICENSE","bin/hint","lib"],"dependencies":{"cli":"0.4.3","minimatch":"0.0.x"},"devDependencies":{"jasmine-node":"1.0.x"},"preferGlobal":true,"_id":"jshint@0.9.1","dist":{"shasum":"ff32ec7f09f84001f7498eeafd63c9e4fbb2dc0e","tarball":"http://registry.npmjs.org/jshint/-/jshint-0.9.1.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"1.0.0":{"name":"jshint","version":"1.0.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"bin":{"jshint":"./bin/jshint"},"scripts":{"test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"esprima":"https://github.com/ariya/esprima/tarball/master","shelljs":"*","underscore":"*","peakle":"*","cli":"0.4.3","minimatch":"0.x.x"},"devDependencies":{"jshint":"*","shelljs":"*","browserify":"*","coveraje":"*","nodeunit":"*","sinon":"*"},"preferGlobal":true,"_id":"jshint@1.0.0","dist":{"shasum":"dcd5b7adf776a9f65197990b61fcfa71a3256f03","tarball":"http://registry.npmjs.org/jshint/-/jshint-1.0.0.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"1.1.0":{"name":"jshint","version":"1.1.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"bin":{"jshint":"./bin/jshint"},"scripts":{"test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"esprima":"https://github.com/ariya/esprima/tarball/master","shelljs":"0.1.x","underscore":"1.4.x","peakle":"0.0.x","cli":"0.4.x","minimatch":"0.x.x"},"devDependencies":{"jshint":"1.1.0","shelljs":"0.1.x","browserify":"1.16.1","coveraje":"0.2.x","nodeunit":"0.7.x","sinon":"1.6.x"},"preferGlobal":true,"_id":"jshint@1.1.0","dist":{"shasum":"9987b90b860556cbc7f380d5755a23d504213513","tarball":"http://registry.npmjs.org/jshint/-/jshint-1.1.0.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.0.0":{"name":"jshint","version":"2.0.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x"},"devDependencies":{"jshint":"1.1.0","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.7.x","sinon":"1.6.x","console-browserify":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"_id":"jshint@2.0.0","dist":{"shasum":"4a5618819c4e7f63b00bf0ff387ee1360c924306","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.0.0.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.0.1":{"name":"jshint","version":"2.0.1","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"1.1.0","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.7.x","sinon":"1.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"_id":"jshint@2.0.1","dist":{"shasum":"b04cde939472afd7ba0ecf98cd0175ba9ed445a4","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.0.1.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.0":{"name":"jshint","version":"2.1.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"1.1.0","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.7.x","sinon":"1.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"_id":"jshint@2.1.0","dist":{"shasum":"a824d872d4a291c8bb0bda9a3aa4f7dfdf2959e1","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.0.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.1":{"name":"jshint","version":"2.1.1","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"1.1.0","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.7.x","sinon":"1.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"_id":"jshint@2.1.1","dist":{"shasum":"a5611a822407a3a6a51079318b8897d85abd2cb8","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.1.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.2":{"name":"jshint","version":"2.1.2","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"1.1.0","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.7.x","sinon":"1.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"_id":"jshint@2.1.2","dist":{"shasum":"1fb7b77df7b8620c17d4f807945bb2d24990969e","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.2.tgz"},"_npmVersion":"1.1.63","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.3":{"name":"jshint","version":"2.1.3","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"_id":"jshint@2.1.3","dist":{"shasum":"2392e062f7f080fc5ee6d6db8164b6c81b1abaaf","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.3.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.4":{"name":"jshint","version":"2.1.4","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"_id":"jshint@2.1.4","dist":{"shasum":"8d5be86628eea91c073c8700dd6e4c90afd9ab38","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.4.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.5":{"name":"jshint","version":"2.1.5","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src"],"_id":"jshint@2.1.5","dist":{"shasum":"fc95a40ea89a14522fec1d03950f6eaa0e363499","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.5.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.6":{"name":"jshint","version":"2.1.6","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src"],"_id":"jshint@2.1.6","dist":{"shasum":"8e00e8893099128fc3d4478e3aedba8079ff3b02","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.6.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.7":{"name":"jshint","version":"2.1.7","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src"],"_id":"jshint@2.1.7","dist":{"shasum":"11f4214333a0cd2df88057b88c4d751d0c0658a0","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.7.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.8":{"name":"jshint","version":"2.1.8","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node ./make.js build","test":"node ./make.js test","lint":"node ./make.js lint"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src"],"_id":"jshint@2.1.8","dist":{"shasum":"c4bfe5c28718d101148cfba9e285053a7671ccf2","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.8.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.9":{"name":"jshint","version":"2.1.9","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node make.js build","test":"nodeunit tests tests/stable/regression tests/stable/unit","pretest":"jshint --config=jshint.json src"},"main":"./src/stable/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src"],"_id":"jshint@2.1.9","dist":{"shasum":"65cdbb2302cbf27e45db0066669b5d5e74f66465","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.9.tgz"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.10":{"name":"jshint","version":"2.1.10","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node make.js build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src"],"_id":"jshint@2.1.10","dist":{"shasum":"0c015ec5bc5ad65c11c4b5152f221f24b7af5522","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.10.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.1.11":{"name":"jshint","version":"2.1.11","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src"],"_id":"jshint@2.1.11","dist":{"shasum":"eb5108fef9ba5ddebb830983f572d242e49e3f96","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.1.11.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.2.0":{"name":"jshint","version":"2.2.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.1.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.2.0","dist":{"shasum":"9cd120e17c6635a5bfd6339531b088ed33eb5af2","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.2.0.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.3.0":{"name":"jshint","version":"2.3.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.3.x","shelljs":"0.1.x","browserify":"2.12.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.3.0","dist":{"shasum":"19504455a2c20c46ee183361eb87f3a1c0b7dc47","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.3.0.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.4.0":{"name":"jshint","version":"2.4.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","htmlparser2":"3.3.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.4.x","shelljs":"0.1.x","browserify":"3.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.4.0","dist":{"shasum":"31717646cee2137cdd7f1b773c3fce58f4d99fc5","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.4.0.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.4.1":{"name":"jshint","version":"2.4.1","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","htmlparser2":"3.3.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.4.x","shelljs":"0.1.x","browserify":"3.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.4.1","dist":{"shasum":"833f361a56577b80816b64f18434cce3b3942591","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.4.1.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.4.2":{"name":"jshint","version":"2.4.2","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","htmlparser2":"3.3.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.4.x","shelljs":"0.1.x","browserify":"3.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.4.2","dist":{"shasum":"4f85a8e3133e5bded5b84e06718889bcbb9fa4d0","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.4.2.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.4.3":{"name":"jshint","version":"2.4.3","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","htmlparser2":"3.3.x","console-browserify":"0.1.x"},"devDependencies":{"jshint":"2.4.x","shelljs":"0.1.x","browserify":"3.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.4.3","dist":{"shasum":"1beb074b4d9f817773bb5aa16882fd67164c216a","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.4.3.tgz"},"_from":".","_npmVersion":"1.3.5","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.4.4":{"name":"jshint","version":"2.4.4","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","htmlparser2":"3.3.x","console-browserify":"0.1.x","exit":"0.1.x"},"devDependencies":{"jshint":"2.4.x","shelljs":"0.1.x","browserify":"3.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"jshintConfig":{"boss":true,"node":true,"strict":true,"white":true,"smarttabs":true,"maxlen":100,"newcap":false,"undef":true,"unused":true,"onecase":true,"indent":2},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.4.4","dist":{"shasum":"4162238314c649f987752651e8e064e30a68706e","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.4.4.tgz"},"_from":".","_npmVersion":"1.2.21","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"brentlintner","email":"brent.lintner@gmail.com"},{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.5.0":{"name":"jshint","version":"2.5.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.1.x","underscore":"1.4.x","cli":"0.4.x","minimatch":"0.x.x","htmlparser2":"3.3.x","console-browserify":"0.1.x","exit":"0.1.x","strip-json-comments":"0.1.x"},"devDependencies":{"jshint":"2.4.x","shelljs":"0.1.x","browserify":"3.x","coveraje":"0.2.x","nodeunit":"0.8.x","sinon":"1.7.x","unicode-6.3.0":"0.1.x","regenerate":"0.5.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data"],"_id":"jshint@2.5.0","dist":{"shasum":"82fd1a235ffce75fad1b40b2a38bef47beac8c54","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.0.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.5.1":{"name":"jshint","version":"2.5.1","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.3.x","underscore":"1.6.x","cli":"0.6.x","minimatch":"0.x.x","htmlparser2":"3.7.x","console-browserify":"1.1.x","exit":"0.1.x","strip-json-comments":"0.1.x"},"devDependencies":{"jshint":"2.5.x","browserify":"4.x","coveraje":"0.2.x","nodeunit":"0.9.x","sinon":"1.9.x","unicode-6.3.0":"0.1.x","regenerate":"0.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data","dist"],"_id":"jshint@2.5.1","dist":{"shasum":"8e96d27377806767d40f16676fbec113d33520ec","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.1.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.5.2":{"name":"jshint","version":"2.5.2","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.3.x","underscore":"1.6.x","cli":"0.6.x","minimatch":"0.x.x","htmlparser2":"3.7.x","console-browserify":"1.1.x","exit":"0.1.x","strip-json-comments":"0.1.x"},"devDependencies":{"jshint":"2.5.x","browserify":"4.x","coveraje":"0.2.x","nodeunit":"0.9.x","sinon":"1.9.x","unicode-6.3.0":"0.1.x","regenerate":"0.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data","dist"],"_id":"jshint@2.5.2","dist":{"shasum":"bec223d5149e49ef6ea96dcf8b3504a27613e8be","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.2.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"antonkovalyov","email":"anton@kovalyov.net"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"}],"directories":{}},"2.5.3":{"name":"jshint","version":"2.5.3","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.3.x","underscore":"1.6.x","cli":"0.6.x","minimatch":"0.x.x","htmlparser2":"3.7.x","console-browserify":"1.1.x","exit":"0.1.x","strip-json-comments":"0.1.x"},"devDependencies":{"jshint":"2.5.x","browserify":"4.x","coveraje":"0.2.x","nodeunit":"0.9.x","sinon":"1.9.x","unicode-6.3.0":"0.1.x","regenerate":"0.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data","dist"],"gitHead":"e3250b47e0c1fbb11a782864166900ba5b60cf41","_id":"jshint@2.5.3","_shasum":"821c14ff5ccaa458ae1b34a2caa70bf753f963ea","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"821c14ff5ccaa458ae1b34a2caa70bf753f963ea","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.3.tgz"},"directories":{}},"2.5.4":{"name":"jshint","version":"2.5.4","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.3.x","underscore":"1.6.x","cli":"0.6.x","minimatch":"0.x.x","htmlparser2":"3.7.x","console-browserify":"1.1.x","exit":"0.1.x","strip-json-comments":"0.1.x"},"devDependencies":{"jshint":"2.5.x","browserify":"4.x","coveraje":"0.2.x","nodeunit":"0.9.x","sinon":"1.9.x","unicode-6.3.0":"0.1.x","regenerate":"0.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data","dist"],"gitHead":"be724857242ecf6931387feed23d5cae285354d0","_id":"jshint@2.5.4","_shasum":"3dc82cb37b381b65f0e95ec7a616d39b4e95faef","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"3dc82cb37b381b65f0e95ec7a616d39b4e95faef","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.4.tgz"},"directories":{}},"2.5.5":{"name":"jshint","version":"2.5.5","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.3.x","underscore":"1.6.x","cli":"0.6.x","minimatch":"0.x.x","htmlparser2":"3.7.x","console-browserify":"1.1.x","exit":"0.1.x","strip-json-comments":"0.1.x"},"devDependencies":{"jshint":"2.5.x","browserify":"4.x","coveraje":"0.2.x","nodeunit":"0.9.x","sinon":"1.9.x","unicode-6.3.0":"0.1.x","regenerate":"0.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data","dist"],"gitHead":"94df11c872bccd979c8deffed612e4421abdf17d","_id":"jshint@2.5.5","_shasum":"9f24958dcd11c5e2ceba96ec92225873b02f4775","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"9f24958dcd11c5e2ceba96ec92225873b02f4775","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.5.tgz"},"directories":{}},"2.5.6":{"name":"jshint","version":"2.5.6","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.3.x","underscore":"1.6.x","cli":"0.6.x","minimatch":"1.0.x","htmlparser2":"3.7.x","console-browserify":"1.1.x","exit":"0.1.x","strip-json-comments":"1.0.x"},"devDependencies":{"jshint":"2.5.x","browserify":"5.x","coveraje":"0.2.x","nodeunit":"0.9.x","sinon":"1.10.x","unicode-6.3.0":"0.1.x","regenerate":"0.6.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data","dist"],"gitHead":"17e9355cd27ef53c76c82e9c8514118eabe25ffe","_id":"jshint@2.5.6","_shasum":"1685ce1f9e1c74832375d83fe89728589bd9d8c7","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"1685ce1f9e1c74832375d83fe89728589bd9d8c7","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.6.tgz"},"directories":{}},"2.5.7":{"name":"jshint","version":"2.5.7","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"data":"node scripts/generate-identifier-data","build":"node bin/build","test":"nodeunit tests tests/regression tests/unit","pretest":"jshint src"},"main":"./src/jshint.js","dependencies":{"shelljs":"0.3.x","underscore":"1.6.x","cli":"0.6.x","minimatch":"1.0.x","htmlparser2":"3.7.x","console-browserify":"1.1.x","exit":"0.1.x","strip-json-comments":"1.0.x"},"devDependencies":{"jshint":"2.5.x","browserify":"6.x","coveraje":"0.2.x","nodeunit":"0.9.x","sinon":"1.10.x","unicode-6.3.0":"0.1.x","regenerate":"0.6.x","mock-stdin":"^0.3.0"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","src","data","dist"],"gitHead":"5b779e62d99c1182581167d07a870b34fc4579b0","_id":"jshint@2.5.7","_shasum":"69a6dfa046f3164f904a82f9b0ab57192fc13749","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"69a6dfa046f3164f904a82f9b0ab57192fc13749","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.7.tgz"},"directories":{}},"2.5.8":{"name":"jshint","version":"2.5.8","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","data":"node scripts/generate-identifier-data","pretest":"jshint src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveraje":"0.2.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"53556a7e6a4f6a7bb1bee6e83a229e0481b782b9","_id":"jshint@2.5.8","_shasum":"31ddb3c17df48fe04cff24abe0a1bb1c1bc529f5","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"31ddb3c17df48fe04cff24abe0a1bb1c1bc529f5","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.8.tgz"},"directories":{}},"2.5.9":{"name":"jshint","version":"2.5.9","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","data":"node scripts/generate-identifier-data","pretest":"jshint src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveraje":"0.2.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"1839f7a0b504890fec60d27e0d6945cb52a697fb","_id":"jshint@2.5.9","_shasum":"c2d514d6dcc03bfc4d0c5c1f5d1033a4cc1539d4","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"c2d514d6dcc03bfc4d0c5c1f5d1033a4cc1539d4","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.9.tgz"},"directories":{}},"2.5.10":{"name":"jshint","version":"2.5.10","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","data":"node scripts/generate-identifier-data","pretest":"jshint src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveraje":"0.2.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"3a71ce850c57be8c03599462f42245708387a5f6","_id":"jshint@2.5.10","_shasum":"2fef47ee0901914e31832123d5d3f434c28060ef","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"2fef47ee0901914e31832123d5d3f434c28060ef","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.10.tgz"},"directories":{}},"2.5.11":{"name":"jshint","version":"2.5.11","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","coverage":"istanbul -- cover ./node_modules/.bin/nodeunit tests/unit","data":"node scripts/generate-identifier-data","pretest":"jshint src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveralls":"2.11.x","istanbul":"0.3.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"29bda1104e117c34bdd7702854fbc40cd00e66ac","_id":"jshint@2.5.11","_shasum":"e2d95858bbb1aa78300108a2e81099fb095622e0","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"e2d95858bbb1aa78300108a2e81099fb095622e0","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.5.11.tgz"},"directories":{}},"2.6.0":{"name":"jshint","version":"2.6.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","coverage":"istanbul -- cover ./node_modules/.bin/nodeunit tests/unit","data":"node scripts/generate-identifier-data","pretest":"jshint src && jscs src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveralls":"2.11.x","istanbul":"0.3.x","jscs":"1.9.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"f1fabe31294552a05d41259e64bb83427bfb2f7f","_id":"jshint@2.6.0","_shasum":"04e59d04da83aa32301d89115628274871597f33","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"04e59d04da83aa32301d89115628274871597f33","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.6.0.tgz"},"directories":{}},"2.6.1":{"name":"jshint","version":"2.6.1","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","coverage":"istanbul -- cover ./node_modules/.bin/nodeunit tests/unit","data":"node scripts/generate-identifier-data","pretest":"jshint src && jscs src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveralls":"2.11.x","istanbul":"0.3.x","jscs":"1.11.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"02c2628de6401363fad48b3cc7668eef2c2d7c1a","_id":"jshint@2.6.1","_shasum":"2a431526e20215043e56831d228c769f3a9f5bc9","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"2a431526e20215043e56831d228c769f3a9f5bc9","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.6.1.tgz"},"directories":{}},"2.6.2":{"name":"jshint","version":"2.6.2","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","coverage":"istanbul -- cover ./node_modules/.bin/nodeunit tests/unit","data":"node scripts/generate-identifier-data","pretest":"jshint src && jscs src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveralls":"2.11.x","istanbul":"0.3.x","jscs":"1.11.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"d82cf19916ea35079dc239f32b950dfc0767b795","_id":"jshint@2.6.2","_shasum":"fce55812fc9374855238ab2b08c8b37fbd9b5bee","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"fce55812fc9374855238ab2b08c8b37fbd9b5bee","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.6.2.tgz"},"directories":{}},"2.6.3":{"name":"jshint","version":"2.6.3","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","coverage":"istanbul -- cover ./node_modules/.bin/nodeunit tests/unit","data":"node scripts/generate-identifier-data","pretest":"jshint src && jscs src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"1.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","underscore":"1.6.x"},"devDependencies":{"browserify":"6.x","coveralls":"2.11.x","istanbul":"0.3.x","jscs":"1.11.x","jshint":"2.5.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.0.x","sinon":"1.11.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"983fc8de62dc826670b7af8e64fd67de0a4d1a27","_id":"jshint@2.6.3","_shasum":"84b470b8e5d5cd7adf0a3bd4975250443c9d311a","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"84b470b8e5d5cd7adf0a3bd4975250443c9d311a","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.6.3.tgz"},"directories":{}},"2.7.0":{"name":"jshint","version":"2.7.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","coverage":"istanbul -- cover ./node_modules/.bin/nodeunit tests/unit","data":"node scripts/generate-identifier-data","pretest":"jshint src && jscs src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"2.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","lodash":"3.6.x"},"devDependencies":{"browserify":"9.x","coveralls":"2.11.x","istanbul":"0.3.x","jscs":"1.11.x","jshint":"2.6.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.2.x","sinon":"1.12.x","unicode-6.3.0":"0.1.x"},"licenses":[{"type":"MIT","url":"https://github.com/jshint/jshint/blob/master/LICENSE"}],"preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"dd768c243af2bd3a8beb5e47768eef3ec7ab2e5e","_id":"jshint@2.7.0","_shasum":"d512bb14731dac09e49f212e6b2f1b0fdbabbc4f","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.35","_npmUser":{"name":"rwaldron","email":"waldron.rick@gmail.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"}],"dist":{"shasum":"d512bb14731dac09e49f212e6b2f1b0fdbabbc4f","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.7.0.tgz"},"directories":{}},"2.8.0":{"name":"jshint","version":"2.8.0","homepage":"http://jshint.com/","description":"Static analysis tool for JavaScript","author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"bugs":{"url":"https://github.com/jshint/jshint/issues"},"bin":{"jshint":"./bin/jshint"},"scripts":{"build":"node bin/build","coverage":"istanbul -- cover ./node_modules/.bin/nodeunit tests/unit","data":"node scripts/generate-identifier-data","pretest":"jshint src && jscs src","test":"nodeunit tests tests/regression tests/unit"},"main":"./src/jshint.js","dependencies":{"cli":"0.6.x","console-browserify":"1.1.x","exit":"0.1.x","htmlparser2":"3.8.x","minimatch":"2.0.x","shelljs":"0.3.x","strip-json-comments":"1.0.x","lodash":"3.7.x"},"devDependencies":{"browserify":"9.x","coveralls":"2.11.x","istanbul":"0.3.x","jscs":"1.11.x","jshint":"2.6.x","mock-stdin":"0.3.x","nodeunit":"0.9.x","regenerate":"1.2.x","sinon":"1.12.x","unicode-6.3.0":"0.1.x"},"license":"(MIT AND JSON)","preferGlobal":true,"files":["bin","data","dist","src"],"gitHead":"e6611af2d180bd2317d5762e85807a481de99ccb","_id":"jshint@2.8.0","_shasum":"1d09a3bd913c4cadfa81bf18d582bd85bffe0d44","_from":".","_npmVersion":"2.6.0","_nodeVersion":"0.12.0","_npmUser":{"name":"jugglinmike","email":"mike@mikepennisi.com"},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"},{"name":"jugglinmike","email":"mike@mikepennisi.com"}],"dist":{"shasum":"1d09a3bd913c4cadfa81bf18d582bd85bffe0d44","tarball":"http://registry.npmjs.org/jshint/-/jshint-2.8.0.tgz"},"directories":{}}},"maintainers":[{"name":"antonkovalyov","email":"anton@kovalyov.net"},{"name":"rwaldron","email":"waldron.rick@gmail.com"},{"name":"jugglinmike","email":"mike@mikepennisi.com"}],"time":{"modified":"2015-05-31T17:47:28.288Z","created":"2011-03-27T18:32:36.942Z","0.1.8":"2011-03-27T18:32:37.263Z","0.1.9":"2011-03-30T01:23:22.132Z","0.2.0":"2011-04-07T01:29:17.412Z","0.2.1":"2011-05-06T15:19:59.724Z","0.2.2":"2011-05-26T02:28:56.346Z","0.2.3":"2011-06-22T00:20:15.092Z","0.3.0":"2011-08-20T23:55:34.317Z","0.3.1":"2011-09-05T17:43:21.706Z","0.4.0":"2011-10-11T01:30:17.763Z","0.5.0":"2011-10-13T02:31:28.177Z","0.5.1":"2011-10-15T20:27:49.794Z","0.5.2":"2011-10-27T23:47:13.813Z","0.5.3":"2011-12-06T17:04:23.138Z","0.5.4":"2011-12-09T16:22:22.276Z","0.5.5":"2011-12-12T23:04:51.885Z","0.5.6":"2012-01-10T19:47:14.374Z","0.5.7":"2012-01-20T17:56:31.354Z","0.5.8":"2012-02-14T03:54:59.373Z","0.5.9":"2012-02-28T19:37:50.194Z","0.6.0":"2012-04-04T20:08:42.115Z","0.6.1":"2012-04-11T18:54:41.288Z","0.6.2":"2012-04-30T15:42:49.409Z","0.6.3":"2012-05-02T05:57:50.465Z","0.7.0":"2012-05-08T17:08:21.221Z","0.7.1":"2012-05-17T21:06:25.975Z","0.7.2":"2012-07-26T23:52:25.934Z","0.7.3":"2012-08-06T04:29:47.399Z","0.8.0":"2012-08-20T18:38:37.399Z","0.8.1":"2012-08-27T16:42:17.856Z","0.8.2":"2012-08-30T16:06:24.563Z","0.9.0":"2012-09-03T22:09:34.078Z","0.9.1":"2012-09-25T19:05:55.651Z","1.0.0":"2013-02-21T20:56:02.439Z","1.1.0":"2013-03-06T01:06:48.338Z","2.0.0":"2013-05-08T20:38:37.226Z","2.0.1":"2013-05-08T21:01:32.782Z","2.1.0":"2013-05-21T04:36:39.121Z","2.1.1":"2013-05-21T19:13:39.939Z","2.1.2":"2013-05-22T02:23:18.655Z","2.1.3":"2013-06-03T02:19:30.866Z","2.1.4":"2013-06-24T18:45:59.139Z","2.1.5":"2013-07-27T22:58:03.807Z","2.1.6":"2013-07-29T05:07:25.272Z","2.1.7":"2013-07-29T18:11:57.558Z","2.1.8":"2013-08-01T03:14:32.906Z","2.1.9":"2013-08-02T20:38:14.506Z","2.1.10":"2013-08-15T22:44:38.250Z","2.1.11":"2013-09-20T22:42:42.815Z","2.2.0":"2013-10-18T17:31:51.676Z","2.3.0":"2013-10-21T01:32:59.427Z","2.4.0":"2013-12-25T01:57:21.185Z","2.4.1":"2014-01-03T21:06:46.027Z","2.4.2":"2014-01-21T19:28:04.110Z","2.4.3":"2014-01-26T03:31:02.974Z","2.4.4":"2014-02-21T02:20:54.850Z","2.5.0":"2014-04-02T05:16:29.038Z","2.5.1":"2014-05-16T04:23:38.796Z","2.5.2":"2014-07-05T16:46:57.881Z","2.5.3":"2014-08-08T19:00:00.438Z","2.5.4":"2014-08-18T16:11:02.461Z","2.5.5":"2014-08-24T04:20:32.497Z","2.5.6":"2014-09-21T17:21:30.478Z","2.5.7":"2014-10-28T16:51:38.395Z","2.5.8":"2014-10-29T21:48:42.556Z","2.5.9":"2014-11-06T13:43:15.032Z","2.5.10":"2014-11-06T18:55:24.861Z","2.5.11":"2014-12-18T19:22:58.738Z","2.6.0":"2015-01-21T22:25:46.173Z","2.6.1":"2015-02-27T17:25:52.054Z","2.6.2":"2015-02-28T00:22:54.946Z","2.6.3":"2015-02-28T17:18:08.698Z","2.7.0":"2015-04-11T20:42:55.596Z","2.8.0":"2015-05-31T17:47:28.288Z"},"author":{"name":"Anton Kovalyov","email":"anton@kovalyov.net","url":"http://anton.kovalyov.net/"},"users":{"mvolkmann":true,"soldair":true,"danielr":true,"fgribreau":true,"pid":true,"graemef":true,"gillesruppert":true,"jgoodall":true,"tokuhirom":true,"m42am":true,"af":true,"jamesallardice":true,"charmander":true,"sandeepmistry":true,"millermedeiros":true,"ianmcburnie":true,"cparker15":true,"antonnguyen":true,"niftymonkey":true,"blalor":true,"netroy":true,"joliva":true,"pragma-dudes":true,"fibo":true,"adamrenny":true,"codylindley":true,"victorquinn":true,"chrisoei":true,"shiin":true,"mhaidarh":true,"cedx":true,"pragmadash":true,"claveren":true,"chpopov":true,"xtopher":true,"csk83":true,"priyaranjan":true,"jorgemsrs":true,"cilindrox":true,"fmm":true,"darryl.west":true,"renatobalbino":true,"redbe4rd":true,"fei":true,"sionbird":true,"toogle":true,"qiuzuhui":true,"ezhi":true,"davidbaiguini":true,"owaz":true,"chaowi":true,"agent_9191":true,"ambdxtrch":true,"frk1705":true,"tunnckocore":true,"nlwillia":true,"gdibble":true,"goblindegook":true,"antonkovalyov":true,"thebearingedge":true,"jits":true,"qmmr":true,"louxiaojian":true,"markymark":true,"byossarian":true,"alaabadran":true,"piotr23":true,"buster":true,"dgarlitt":true,"waltgiroir":true,"bkimminich":true,"csbun":true,"leobalter":true,"ivangaravito":true,"mjurincic":true,"kws4679":true,"presence":true,"hoitmort":true,"azder":true,"alexandermac":true,"sirreal":true,"kh3phr3n":true,"nitayneeman":true,"nicolasmccurdy":true,"haeck":true,"pnevares":true,"gdbtek":true,"ksmithut":true,"kulakowka":true,"nadimix":true,"trigu":true,"vboctor":true,"shannonmoeller":true,"limit":true,"borjes":true,"yasinaydin":true,"josuehenry14":true,"ericwbailey":true,"kai_":true,"raiseandfall":true,"clux":true,"ugarz":true,"sasquatch":true,"tfentonz":true,"dac2205":true,"subchen":true,"marbio":true,"brandondoran":true,"jackpinto":true,"joris-van-der-wel":true,"rogier.spieker":true,"hassane":true,"sakthiinfotec":true,"season19840122":true,"fvcproductions":true,"felixjung":true,"jamesmgreene":true,"nice_body":true,"maskedcoder":true},"repository":{"type":"git","url":"https://github.com/jshint/jshint.git"},"readme":"# JSHint, A Static Code Analysis Tool for JavaScript\n\n\\[ [Use it online](http://jshint.com/) • [About](http://jshint.com/about/) •\n[Docs](http://jshint.com/docs/) • [FAQ](http://jshint.com/docs/faq) •\n[Install](http://jshint.com/install/) • [Hack](http://jshint.com/hack/) •\n[Blog](http://jshint.com/blog/) • [Twitter](https://twitter.com/jshint/) \\]\n\n[![NPM version](https://img.shields.io/npm/v/jshint.svg?style=flat)](https://www.npmjs.com/package/jshint)\n[![Linux Build Status](https://img.shields.io/travis/jshint/jshint/master.svg?style=flat&label=Linux%20build)](https://travis-ci.org/jshint/jshint)\n[![Windows Build status](https://img.shields.io/appveyor/ci/jshint/jshint/master.svg?style=flat&label=Windows%20build)](https://ci.appveyor.com/project/jshint/jshint/branch/master)\n[![Dependency Status](https://img.shields.io/david/jshint/jshint.svg?style=flat)](https://david-dm.org/jshint/jshint)\n[![devDependency Status](https://img.shields.io/david/dev/jshint/jshint.svg?style=flat)](https://david-dm.org/jshint/jshint#info=devDependencies)\n[![Coverage Status](https://img.shields.io/coveralls/jshint/jshint.svg?style=flat)](https://coveralls.io/r/jshint/jshint?branch=master)\n\nJSHint is a community-driven tool to detect errors and potential problems\nin JavaScript code. It is very flexible so you can easily adjust it to your\nparticular coding guidelines and the environment you expect your code to\nexecute in.\n\n## Reporting a bug\n\nTo report a bug simply create a\n[new GitHub Issue](https://github.com/jshint/jshint/issues/new) and describe\nyour problem or suggestion. We welcome all kinds of feedback regarding\nJSHint including but not limited to:\n\n * When JSHint doesn't work as expected\n * When JSHint complains about valid JavaScript code that works in all browsers\n * When you simply want a new option or feature\n\nBefore reporting a bug look around to see if there are any open or closed tickets\nthat cover your issue. And remember the wisdom: pull request > bug report > tweet.\n\n## Issue Priority\n\n- *P1:* Something is throwing exceptions; broken JSHint backward compatibility.\n- *P2:* Something is not being parsed correctly.\n- *P3:* Features that the core team will work on once P2s and P1s are done.\n- *P4:* Patches welcome; The request is good, but low priority.\n\n\n## License\n\nJSHint is distributed under the MIT License. One file and one file only\n(src/stable/jshint.js) is distributed under the slightly modified MIT License.\n\n## The JSHint Team\n\nJSHint is maintained by [Rick Waldron](https://github.com/rwaldron/), [Caitlin\nPotter](https://github.com/caitp/), [Mike\nSherov](https://github.com/mikesherov/), and [Mike\nPennisi](https://github.com/jugglinmike/).\n\n## Thank you!\n\nWe really appreciate all kinds of feedback and contributions. Thanks for using and supporting JSHint!\n","readmeFilename":"README.md","homepage":"http://jshint.com/","bugs":{"url":"https://github.com/jshint/jshint/issues"},"license":"(MIT AND JSON)","_attachments":{},"_etag":"\"G9561MH4XUZS8T2K8YB5INUN\""} \ No newline at end of file diff --git a/deps/npm/test/tap/00-config-setup.js b/deps/npm/test/tap/00-config-setup.js index 33581eb138ff6f..0daf0decd6a546 100644 --- a/deps/npm/test/tap/00-config-setup.js +++ b/deps/npm/test/tap/00-config-setup.js @@ -1,3 +1,4 @@ +var fs = require("graceful-fs") var path = require("path") var userconfigSrc = path.resolve(__dirname, "..", "fixtures", "config", "userconfig") exports.userconfig = userconfigSrc + "-with-gc" @@ -55,10 +56,24 @@ exports.envDataFix = { "other-env-thing": 1000 } +var projectConf = path.resolve(__dirname, '..', '..', '.npmrc') +try { + fs.statSync(projectConf) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectConf, 'save-prefix = ~\nproprietary-attribs = false\n') +} + +var projectRc = path.join(__dirname, '..', 'fixtures', 'config', '.npmrc') +try { + fs.statSync(projectRc) +} catch (er) { + // project conf not found, probably working with packed npm + fs.writeFileSync(projectRc, 'just = testing') +} if (module === require.main) { // set the globalconfig in the userconfig - var fs = require("fs") var uc = fs.readFileSync(userconfigSrc) var gcini = "globalconfig = " + exports.globalconfig + "\n" fs.writeFileSync(exports.userconfig, gcini + uc) 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 9e05f483ebe865..bc716b1702c371 100644 --- a/deps/npm/test/tap/404-private-registry.js +++ b/deps/npm/test/tap/404-private-registry.js @@ -1,22 +1,39 @@ -var nock = require('nock') var test = require('tap').test -var npm = require('../../') -var addNamed = require('../../lib/cache/add-named') +var path = require('path') +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') +var server -test('package names not mangled on error with non-root registry', function test404 (t) { - nock('http://localhost:1337') - .get('/registry/foo') - .reply(404, { - error: 'not_found', - reason: 'document not found' - }) +var packageName = path.basename(__filename,'.js') - npm.load({registry: 'http://localhost:1337/registry', global: true}, function () { - addNamed('foo', '*', null, function checkError (err) { - t.ok(err, 'should error') - t.equal(err.message, '404 Not Found: foo', 'should have package name in error') - t.equal(err.pkgid, 'foo', 'err.pkgid should match package name') - t.end() - }) +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() }) }) + +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 5ac1d613841301..41d2c93607ea5f 100644 --- a/deps/npm/test/tap/access.js +++ b/deps/npm/test/tap/access.js @@ -1,43 +1,33 @@ -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, "access") +var pkg = path.resolve(__dirname, 'access') var server var scoped = { - name : "@scoped/pkg", - version : "1.1.1" + name: '@scoped/pkg', + version: '1.1.1' } -var body = { - access : "public" -} - -function mocks (server) { - server.post("/-/package/@scoped%2fpkg/access", JSON.stringify(body)) - .reply(200, { "access" : "public" }) - server.post("/-/package/@scoped%2fanother/access", JSON.stringify(body)) - .reply(200, { "access" : "public" }) -} - -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 (err, s) { + mr({port: common.port}, function (err, s) { + t.ifError(err, 'registry mocked successfully') 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() } ) @@ -45,103 +35,452 @@ test("setup", function (t) { }) }) -test("npm access on current package", function (t) { +test('npm access public on current package', function (t) { + server.post('/-/package/%40scoped%2Fpkg/access', JSON.stringify({ + access: 'public' + })).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 + ], { + cwd: missing + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + t.match(stderr, /no package name passed to command and no package.json found/) + rimraf.sync(missing) + t.end() + }) +}) + +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', + 'public', + '--registry', common.registry + ], { + cwd: invalid + }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access') + 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' + }).reply(200, { + accessChaged: true + }) common.npm( [ - "access", - "public", - "--registry", common.registry, - "--loglevel", "silent" + 'access', + 'public', '@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.ifError(er, 'npm access') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + + t.end() + } + ) +}) +test('npm change access on unscoped package', function (t) { + common.npm( + [ + 'access', + 'restricted', 'yargs', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ok(code, 'exited with Error') + t.matches( + stderr, /access commands are only accessible for scoped packages/) t.end() } ) }) -test("npm access on named package", function (t) { +test('npm access grant read-only', function (t) { + server.put('/-/team/myorg/myteam/package', { + permissions: 'read-only', + package: '@scoped/another' + }).reply(201, { + accessChaged: true + }) common.npm( [ - "access", - "public", "@scoped/another", - "--registry", common.registry, - "--loglevel", "silent" + 'access', + 'grant', 'read-only', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry ], - { 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.ifError(er, 'npm access grant') + t.equal(code, 0, 'exited with Error') + t.end() + } + ) +}) +test('npm access grant read-write', function (t) { + server.put('/-/team/myorg/myteam/package', { + permissions: 'read-write', + package: '@scoped/another' + }).reply(201, { + accessChaged: true + }) + common.npm( + [ + 'access', + 'grant', 'read-write', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access grant') + t.equal(code, 0, 'exited with Error') t.end() } ) }) -test("npm change access on unscoped package", function (t) { +test('npm access grant others', function (t) { common.npm( [ - "access", - "restricted", "yargs", - "--registry", common.registry + 'access', + 'grant', 'rerere', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { t.ok(code, 'exited with Error') - t.ok(stderr.match(/you can't change the access level of unscoped packages/)) + t.matches(stderr, /read-only/) + t.matches(stderr, /read-write/) t.end() } ) }) -test('npm access add', function (t) { +test('npm access revoke', function (t) { + server.delete('/-/team/myorg/myteam/package', { + package: '@scoped/another' + }).reply(200, { + accessChaged: true + }) common.npm( [ - "access", - "add", "@scoped/another", - "--registry", common.registry + 'access', + 'revoke', + 'myorg:myteam', + '@scoped/another', + '--registry', common.registry ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ok(code, 'exited with Error') - t.ok(stderr.match(/npm access add isn't implemented yet!/)) + t.ifError(er, 'npm access grant') + t.equal(code, 0, 'exited with Error') t.end() } ) }) -test('npm access rm', 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", - "rm", "@scoped/another", - "--registry", common.registry + 'access', + 'ls-packages', + '--registry', common.registry ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ok(code, 'exited with Error') - t.ok(stderr.match(/npm access rm isn't implemented yet!/)) + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) t.end() } ) }) -test('npm access ls', function (t) { +test('npm access ls-packages on team', function (t) { + var serverPackages = { + '@foo/bar': 'write', + '@foo/util': 'read' + } + var clientPackages = { + '@foo/bar': 'read-write', + '@foo/util': 'read-only' + } + server.get( + '/-/team/myorg/myteam/package?format=cli' + ).reply(200, serverPackages) common.npm( [ - "access", - "ls", "@scoped/another", - "--registry", common.registry + 'access', + 'ls-packages', + 'myorg:myteam', + '--registry', common.registry ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { - t.ok(code, 'exited with Error') - t.ok(stderr.match(/npm access ls isn't implemented yet!/)) + t.ifError(er, 'npm access ls-packages') + t.same(JSON.parse(stdout), clientPackages) + t.end() + } + ) +}) + +test('npm access ls-packages on org', function (t) { + 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(200, serverPackages) + common.npm( + [ + 'access', + 'ls-packages', + 'myorg', + '--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 user', function (t) { + 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: 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 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', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/%40scoped%2Fpkg/collaborators?format=cli' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) + t.end() + } + ) +}) + +test('npm access ls-collaborators on package', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/%40scoped%2Fanother/collaborators?format=cli' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + '@scoped/another', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) + t.end() + } + ) +}) + +test('npm access ls-collaborators on current w/user filter', function (t) { + var serverCollaborators = { + 'myorg:myteam': 'write', + 'myorg:anotherteam': 'read' + } + var clientCollaborators = { + 'myorg:myteam': 'read-write', + 'myorg:anotherteam': 'read-only' + } + server.get( + '/-/package/%40scoped%2Fanother/collaborators?format=cli&user=zkat' + ).reply(200, serverCollaborators) + common.npm( + [ + 'access', + 'ls-collaborators', + '@scoped/another', + 'zkat', + '--registry', common.registry + ], + { cwd: pkg }, + function (er, code, stdout, stderr) { + t.ifError(er, 'npm access ls-collaborators') + t.same(JSON.parse(stdout), clientCollaborators) t.end() } ) @@ -150,14 +489,14 @@ test('npm access ls', function (t) { test('npm access edit', function (t) { common.npm( [ - "access", - "edit", "@scoped/another", - "--registry", common.registry + 'access', + 'edit', '@scoped/another', + '--registry', common.registry ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { t.ok(code, 'exited with Error') - t.ok(stderr.match(/npm access edit isn't implemented yet!/)) + t.match(stderr, /edit subcommand is not implemented yet/) t.end() } ) @@ -166,22 +505,23 @@ test('npm access edit', function (t) { test('npm access blerg', function (t) { common.npm( [ - "access", - "blerg", "@scoped/another", - "--registry", common.registry + 'access', + 'blerg', '@scoped/another', + '--registry', common.registry ], - { cwd : pkg }, + { cwd: pkg }, function (er, code, stdout, stderr) { t.ok(code, 'exited with Error') - t.ok(stderr.match(/Usage:/)) + t.matches(stderr, /Usage:/) t.end() } ) }) -test("cleanup", function (t) { - t.pass("cleaned up") +test('cleanup', function (t) { + t.pass('cleaned up') rimraf.sync(pkg) + server.done() server.close() t.end() }) diff --git a/deps/npm/test/tap/add-named-update-protocol-port.js b/deps/npm/test/tap/add-named-update-protocol-port.js new file mode 100644 index 00000000000000..38b500d0c0ad52 --- /dev/null +++ b/deps/npm/test/tap/add-named-update-protocol-port.js @@ -0,0 +1,113 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var common = require('../common-tap') +var mr = require('npm-registry-mock') +var server1 +var server2 + +var packageName = path.basename(__filename, '.js') + +var fooPkg = { + name: packageName, + versions: { + '0.0.0': { + name: packageName, + version: '0.0.0', + dist: { + tarball: 'https://localhost:1338/registry/' + packageName + '/-/' + packageName + '-0.0.0.tgz', + shasum: '356a192b7913b04c54574d18c28d46e6395428ab' + } + } + } +} + +var iPackageName = packageName + 'i' +var fooiPkg = { + name: iPackageName, + versions: { + '0.0.0': { + name: iPackageName, + version: '0.0.0', + dist: { + tarball: 'http://127.0.0.1:1338/registry/' + iPackageName + '/-/' + iPackageName + '-0.0.0.tgz', + shasum: '356a192b7913b04c54574d18c28d46e6395428ab' + } + } + } +} + +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 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') + + 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() + } + ) +}) + +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') + + 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..66d70800f54d54 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' @@ -93,7 +93,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-shrinkwrap.js b/deps/npm/test/tap/add-remote-git-shrinkwrap.js index f2982355e14b12..e1882d8ee7d6a4 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' @@ -68,7 +68,7 @@ test('shrinkwrap gets correct _from and _resolved (#7121)', function (t) { 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.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..db0e8b47617835 100644 --- a/deps/npm/test/tap/adduser-always-auth.js +++ b/deps/npm/test/tap/adduser-always-auth.js @@ -14,7 +14,24 @@ var responses = { "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" @@ -46,17 +63,140 @@ test("npm login", function (t) { }) }) - 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)) + }) + }) +}) + +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( + [ + '--userconfig', outfile, + 'config', + 'set', + prefixedScope + ':registry', + uri + ], + 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)) + }) + }) +}) + +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') + + 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() + }) + }) + + 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 }) }) }) @@ -83,17 +223,8 @@ test("npm login --always-auth", function (t) { }) }) - 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]) - - if (remaining === 0) runner.stdin.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)) }) }) @@ -120,17 +251,8 @@ test("npm login --no-always-auth", function (t) { }) }) - 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]) - - if (remaining === 0) runner.stdin.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)) }) }) diff --git a/deps/npm/test/tap/adduser-legacy-auth.js b/deps/npm/test/tap/adduser-legacy-auth.js index f9829c618ac7e8..890a3fd2749858 100644 --- a/deps/npm/test/tap/adduser-legacy-auth.js +++ b/deps/npm/test/tap/adduser-legacy-auth.js @@ -73,17 +73,20 @@ test('npm login', function (t) { }) }) - 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/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/deprecate.js b/deps/npm/test/tap/deprecate.js new file mode 100644 index 00000000000000..0c46453559609d --- /dev/null +++ b/deps/npm/test/tap/deprecate.js @@ -0,0 +1,139 @@ +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 = { + '_id': 'cond', + '_rev': '19-d458a706de1740662cd7728d7d7ddf07', + 'name': 'cond', + 'time': { + 'modified': '2015-02-13T07:33:58.120Z', + 'created': '2014-03-16T20:52:52.236Z', + '0.0.0': '2014-03-16T20:52:52.236Z', + '0.0.1': '2014-03-16T21:12:33.393Z', + '0.0.2': '2014-03-16T21:15:25.430Z' + }, + 'versions': { + '0.0.0': {}, + '0.0.1': {}, + '0.0.2': {} + }, + 'dist-tags': { + 'latest': '0.0.2' + }, + 'description': 'Restartable error handling system', + 'license': 'CC0' +} + +test('setup', function (t) { + mr({port: common.port}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.ok(true) + t.end() + }) +}) + +test('npm deprecate an unscoped package', function (t) { + var deprecated = JSON.parse(JSON.stringify(cache)) + deprecated.versions = { + '0.0.0': {}, + '0.0.1': { deprecated: 'make it dead' }, + '0.0.2': {} + } + server.get('/cond?write=true').reply(200, cache) + server.put('/cond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + 'cond@0.0.1', + '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('npm deprecate a scoped package', function (t) { + var cacheCopy = JSON.parse(JSON.stringify(cache)) + cacheCopy.name = '@scope/cond' + cacheCopy._id = '@scope/cond' + var deprecated = JSON.parse(JSON.stringify(cacheCopy)) + deprecated.versions = { + '0.0.0': {}, + '0.0.1': { deprecated: 'make it dead' }, + '0.0.2': {} + } + server.get('/@scope%2fcond?write=true').reply(200, cacheCopy) + server.put('/@scope%2fcond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + '@scope/cond@0.0.1', + '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('npm deprecate 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': {} + } + server.get('/cond?write=true').reply(200, cache) + server.put('/cond', deprecated).reply(201, { deprecated: true }) + common.npm([ + 'deprecate', + 'cond@<0.0.2', + '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('npm deprecate bad semver range', function (t) { + common.npm([ + 'deprecate', + 'cond@-9001', + 'make it dead', + '--registry', common.registry + ], {}, + function (er, code, stdout, stderr) { + t.equal(code, 1, 'errored') + t.match(stderr, /invalid version range/, 'bad semver') + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + t.ok(true) + 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..4fb141578f19d4 100644 --- a/deps/npm/test/tap/git-dependency-install-link.js +++ b/deps/npm/test/tap/git-dependency-install-link.js @@ -135,6 +135,7 @@ function setup (cb) { '--listen=localhost', '--export-all', '--base-path=.', + '--reuseaddr', '--port=1234' ], { diff --git a/deps/npm/test/tap/install-link-scripts.js b/deps/npm/test/tap/install-link-scripts.js new file mode 100644 index 00000000000000..5ad2feafe85b74 --- /dev/null +++ b/deps/npm/test/tap/install-link-scripts.js @@ -0,0 +1,132 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, 'install-link-scripts') +var tmp = path.join(pkg, 'tmp') +var dep = path.join(pkg, 'dep') + +var json = { + name: 'install-link-scripts', + version: '1.0.0', + description: 'a test', + repository: 'git://github.com/npm/npm.git', + license: 'ISC' +} + +var dependency = { + name: 'dep', + version: '1.0.0', + scripts: { + install: './bin/foo' + } +} + +var foo = function () {/* +#!/usr/bin/env node + +console.log('hey sup') +*/}.toString().split('\n').slice(1, -1).join('\n') + +process.env.npm_config_prefix = tmp + +test('plain install', function (t) { + setup() + + common.npm( + [ + 'install', dep, + '--tmp', tmp + ], + { cwd: pkg }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm install ' + dep + ' finished without error') + t.equal(code, 0, 'exited ok') + t.notOk(stderr, 'no output stderr') + t.match(stdout, /hey sup/, 'postinstall script for dep ran') + t.end() + } + ) +}) + +test('link', function (t) { + setup() + + common.npm( + [ + 'link', + '--tmp', tmp + ], + { cwd: dep }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm link finished without error') + t.equal(code, 0, 'exited ok') + t.notOk(stderr, 'no output stderr') + t.match(stdout, /hey sup/, 'script ran') + t.end() + } + ) +}) + +test('install --link', function (t) { + setup() + + common.npm( + [ + 'link', + '--tmp', tmp + ], + { cwd: dep }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm link finished without error') + + common.npm( + [ + 'install', '--link', dependency.name, + '--tmp', tmp + ], + { cwd: pkg }, + function (err, code, stdout, stderr) { + t.ifErr(err, 'npm install --link finished without error') + t.equal(code, 0, 'exited ok') + t.notOk(stderr, 'no output stderr') + t.notMatch(stdout, /hey sup/, "script didn't run") + t.end() + } + ) + } + ) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(tmp) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + mkdirp.sync(path.join(dep, 'bin')) + fs.writeFileSync( + path.join(dep, 'package.json'), + JSON.stringify(dependency, null, 2) + ) + fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo) + fs.chmod(path.join(dep, 'bin', 'foo'), '0755') +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/install-preferglobal-warnings.js b/deps/npm/test/tap/install-preferglobal-warnings.js new file mode 100644 index 00000000000000..9cd2644c5df879 --- /dev/null +++ b/deps/npm/test/tap/install-preferglobal-warnings.js @@ -0,0 +1,131 @@ +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 preferGlobalJson = { + name: 'npm-test-preferglobal-dep', + version: '0.0.0', + preferGlobal: true +} + +var dependenciesJson = { + name: 'npm-test-preferglobal-dependency-check', + version: '0.0.0', + dependencies: { + 'npm-test-preferglobal-dep': 'file:../' + preferGlobalJson.name + } +} + +var devDependenciesJson = { + name: 'npm-test-preferglobal-devDependency-check', + version: '0.0.0', + devDependencies: { + 'npm-test-preferglobal-dep': 'file:../' + preferGlobalJson.name + } +} + +var emptyPackage = { + name: 'npm-test-preferglobal-empty-package', + version: '0.0.0' +} + +test('install a preferGlobal dependency without warning', function (t) { + setup(dependenciesJson) + common.npm([ + 'install', + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.notMatch( + stderr, + /WARN.*prefer global/, + 'install should not warn when dependency is preferGlobal') + t.end() + }) +}) + +test('install a preferGlobal dependency without warning', function (t) { + setup(devDependenciesJson) + common.npm([ + 'install', + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.notMatch( + stderr, + /WARN.*prefer global/, + 'install should not warn when devDependency is preferGlobal') + t.end() + }) +}) + +test('warn if a preferGlobal package is being installed direct', function (t) { + setup(emptyPackage) + common.npm([ + 'install', + 'file:../' + preferGlobalJson.name, + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.match( + stderr, + /WARN.*prefer global/, + 'install should warn when new package is preferGlobal') + t.end() + }) +}) + +test('warn if a preferGlobal package is being saved', function (t) { + setup(emptyPackage) + common.npm([ + 'install', + 'file:../' + preferGlobalJson.name, + '--save', + '--loglevel=warn' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'packages were installed') + t.match( + stderr, + /WARN.*prefer global/, + 'install should warn when new package is preferGlobal') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function setup (json) { + cleanup() + mkPkg(preferGlobalJson) + process.chdir(mkPkg(json)) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + var pkgs = [preferGlobalJson, + dependenciesJson, + devDependenciesJson, + emptyPackage] + 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/ls-depth-cli.js b/deps/npm/test/tap/ls-depth-cli.js index 77689cbc54d70f..760681427c6be1 100644 --- a/deps/npm/test/tap/ls-depth-cli.js +++ b/deps/npm/test/tap/ls-depth-cli.js @@ -113,6 +113,52 @@ 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('cleanup', function (t) { cleanup() 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..28aa8f2fcf2bcb 100644 --- a/deps/npm/test/tap/noargs-install-config-save.js +++ b/deps/npm/test/tap/noargs-install-config-save.js @@ -1,18 +1,14 @@ -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 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() { rimraf.sync(pkg) @@ -29,33 +25,32 @@ function writePackageJson() { }), "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) { 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) }) @@ -64,11 +59,12 @@ test("does not update the package.json with empty arguments", 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) 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/outdated-symlink.js b/deps/npm/test/tap/outdated-symlink.js new file mode 100644 index 00000000000000..39a8072984d40b --- /dev/null +++ b/deps/npm/test/tap/outdated-symlink.js @@ -0,0 +1,89 @@ +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/ + var regOutInstallOne = /async\s*0.2.9\s*1.5.2\s*1.5.2/ + var regOutInstallTwo = /underscore\s*1.3.1\s*1.8.3\s*1.8.3/ + + console.log = function () {} + mr({ port: common.port }, function (er, s) { + common.npm(['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/publish-access-scoped.js b/deps/npm/test/tap/publish-access-scoped.js index e734ebfd783193..5d2b4e30e2506c 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 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") -// 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) +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"), JSON.stringify({ - name: "@bigco/publish-access", - version: "1.2.5" + name: '@bigco/publish-access', + version: '1.2.5', + public: true }), "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) { process.chdir(__dirname) + server.close() 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..4d193cffd99a77 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 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") -// 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) +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"), JSON.stringify({ - name: "publish-access", - version: "1.2.5" + name: 'publish-access', + version: '1.2.5', + public: true }), "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) { process.chdir(__dirname) + server.close() rimraf(pkg, function (er) { t.ifError(er) diff --git a/deps/npm/test/tap/publish-scoped.js b/deps/npm/test/tap/publish-scoped.js index f74ca2e6160f60..cf0daed486d6ca 100644 --- a/deps/npm/test/tap/publish-scoped.js +++ b/deps/npm/test/tap/publish-scoped.js @@ -1,68 +1,64 @@ 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 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") -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 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"] @@ -79,15 +75,17 @@ test("npm publish should honor scoping", function (t) { ) }, "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/registry.js b/deps/npm/test/tap/registry.js index 060d9b67b67fcc..fef099f0af8092 100644 --- a/deps/npm/test/tap/registry.js +++ b/deps/npm/test/tap/registry.js @@ -38,11 +38,14 @@ function runTests () { cwd: ca, stdio: "inherit" } - common.npm(["install"], opts, function (err, code) { + common.npm(["install"], opts, function (err, code, stdout, stderr) { if (err) { throw err } if (code) { return test("need install to work", function (t) { - t.fail("install failed with: " + code) + t.fail( + "install failed with: " + code + + '\nstdout: ' + stdout + + '\nstderr: ' + stderr) t.end() }) @@ -52,24 +55,32 @@ function runTests () { env: env, stdio: "inherit" } - 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) - t.end() + common.npm( + [ + "test", "--", "-Rtap" + ], + opts, + function (err, code, stdout, stderr) { + if (err) { throw err } + if (code) { + return test("need test to work", function (t) { + t.fail( + "test failed with: " + code + + '\nstdout: ' + stdout + + '\nstderr: ' + stderr) + t.end() + }) + } + opts = { + cwd: ca, + env: env, + stdio: "inherit" + } + common.npm(["prune", "--production"], opts, function (err, code) { + if (err) { throw err } + process.exit(code || 0) + }) }) } - opts = { - cwd: ca, - env: env, - stdio: "inherit" - } - common.npm(["prune", "--production"], opts, function (err, code) { - if (err) { throw err } - process.exit(code || 0) - }) - }) - } }) } diff --git a/deps/npm/test/tap/run-script-filter-private.js b/deps/npm/test/tap/run-script-filter-private.js new file mode 100644 index 00000000000000..631759c13a7336 --- /dev/null +++ b/deps/npm/test/tap/run-script-filter-private.js @@ -0,0 +1,52 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap') + +var pkg = path.resolve(__dirname, 'run-script-filter-private') + +var opts = { cwd: pkg } + +var json = { + name: 'run-script-filter-private', + version: '1.2.3' +} + +var npmrc = '//blah.com:_harsh=realms\n' + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.resolve(pkg, 'package.json'), + JSON.stringify(json, null, 2) + '\n' + ) + fs.writeFileSync( + path.resolve(pkg, '.npmrc'), + npmrc + ) + t.end() +}) + +test('npm run-script env', function (t) { + common.npm(['run-script', 'env'], opts, function (er, code, stdout, stderr) { + t.ifError(er, 'using default env script') + t.notOk(stderr, 'should not generate errors') + t.ok(stdout.indexOf('npm_config_init_version') > 0, 'expected values in var list') + t.notMatch(stdout, /harsh/, 'unexpected config not there') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/run-script.js b/deps/npm/test/tap/run-script.js index 8dfe574e139d69..5d414d8e9249f9 100644 --- a/deps/npm/test/tap/run-script.js +++ b/deps/npm/test/tap/run-script.js @@ -1,4 +1,4 @@ -var fs = require('fs') +var fs = require('graceful-fs') var path = require('path') var mkdirp = require('mkdirp') @@ -54,6 +54,14 @@ var both = { } } +var preversionOnly = { + name: 'scripted', + version: '1.2.3', + scripts: { + 'preversion': 'echo preversion' + } +} + function testOutput (t, command, er, code, stdout, stderr) { var lines @@ -192,6 +200,25 @@ test('npm run-script no-params (lifecycle only)', function (t) { }) }) +test('npm run-script no-params (preversion only)', function (t) { + var expected = [ + 'Lifecycle scripts included in scripted:', + ' preversion', + ' echo preversion', + '' + ].join('\n') + + writeMetadata(preversionOnly) + + common.npm(['run-script'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without parameters without crashing') + t.notOk(code, 'npm exited without error code') + t.notOk(stderr, 'npm printed nothing to stderr') + t.equal(stdout, expected, 'got expected output') + t.end() + }) +}) + test('npm run-script no-params (direct only)', function (t) { var expected = [ 'Scripts available in scripted via `npm run-script`:', diff --git a/deps/npm/test/tap/sorted-package-json.js b/deps/npm/test/tap/sorted-package-json.js index 6853cf3020637d..726b56f46d2e16 100644 --- a/deps/npm/test/tap/sorted-package-json.js +++ b/deps/npm/test/tap/sorted-package-json.js @@ -27,7 +27,7 @@ test("sorting dependencies", function (t) { 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, @@ -38,7 +38,8 @@ test("sorting dependencies", function (t) { HOME: process.env.HOME, Path: process.env.PATH, PATH: process.env.PATH - } + }, + stdio: ['ignore', 'ignore', process.stderr] }) child.on("close", function (code) { 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..b212b86a6bbf11 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,9 +1,11 @@ 'use strict' var test = require('tap').test var npm = require('../../lib/npm') -var log = require('npmlog') var stream = require('readable-stream') +// set up environment +require('../common-tap.js') + var moduleName = 'xyzzy-wibble' var testModule = { name: moduleName, @@ -42,13 +44,12 @@ 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) { @@ -57,7 +58,6 @@ test('setup', function (t) { }) }, fetch: function (u, opts, cb) { - lastFetched = u setImmediate(function () { var empty = new stream.Readable() empty.push(null) @@ -69,7 +69,6 @@ test('setup', function (t) { }) }) - test('splat', function (t) { t.plan(3) var addNamed = require('../../lib/cache/add-named.js') diff --git a/deps/npm/test/tap/tag-version-prefix.js b/deps/npm/test/tap/tag-version-prefix.js index efd2d14d4f6da5..f4ba32b1255618 100644 --- a/deps/npm/test/tap/tag-version-prefix.js +++ b/deps/npm/test/tap/tag-version-prefix.js @@ -19,70 +19,75 @@ var json = { name: 'blah', version: '0.1.2' } var configContents = 'sign-git-tag=false\nmessage=":bookmark: %s"\n' test('npm version with message config', function (t) { - setup() - - npm.load({ prefix: pkg, userconfig: npmrc }, function () { - var git = require('../../lib/utils/git.js') - - common.makeGitRepo({ path: pkg }, function (er) { - t.ifErr(er, 'git bootstrap ran without error') - - common.npm([ - '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') + setup() + + npm.load({ prefix: pkg, userconfig: npmrc }, function () { + 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') - 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() - } - ) - } + 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() + } ) - }) - }) - }) + } + ) + } + ) + } + ) + }) }) test('cleanup', function (t) { - cleanup() - t.end() + cleanup() + t.end() }) function cleanup () { - // windows fix for locked files - process.chdir(osenv.tmpdir()) + // windows fix for locked files + process.chdir(osenv.tmpdir()) - rimraf.sync(pkg) + rimraf.sync(pkg) } function setup () { - cleanup() - mkdirp.sync(cache) - process.chdir(pkg) + cleanup() + mkdirp.sync(cache) + process.chdir(pkg) - fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') - fs.writeFileSync(npmrc, configContents, 'ascii') + fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8') + fs.writeFileSync(npmrc, configContents, 'ascii') } diff --git a/deps/npm/test/tap/team.js b/deps/npm/test/tap/team.js new file mode 100644 index 00000000000000..4bfcbaddb2d90b --- /dev/null +++ b/deps/npm/test/tap/team.js @@ -0,0 +1,136 @@ +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 server + +test('setup', function (t) { + mr({port: common.port}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +test('team create basic', function (t) { + var teamData = { + name: 'test', + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: null + } + server.put('/-/org/myorg/team', JSON.stringify({ + name: teamData.name + })).reply(200, teamData) + common.npm([ + 'team', 'create', 'myorg:' + teamData.name, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), teamData) + t.end() + }) +}) + +test('team destroy', function (t) { + var teamData = { + name: 'myteam', + scope_id: 1234, + created: '2015-07-23T18:07:49.959Z', + updated: '2015-07-23T18:07:49.959Z', + deleted: '2015-07-23T18:27:27.178Z' + } + server.delete('/-/team/myorg/' + teamData.name).reply(200, teamData) + common.npm([ + 'team', 'destroy', 'myorg:' + teamData.name, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), teamData) + t.end() + }) +}) + +test('team add', function (t) { + var user = 'zkat' + server.put('/-/team/myorg/myteam/user', JSON.stringify({ + user: user + })).reply(200) + common.npm([ + 'team', 'add', 'myorg:myteam', user, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + }) +}) + +test('team rm', function (t) { + var user = 'zkat' + server.delete('/-/team/myorg/myteam/user', JSON.stringify({ + user: user + })).reply(200) + common.npm([ + 'team', 'rm', 'myorg:myteam', user, + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.end() + }) +}) + +test('team ls (on org)', function (t) { + var teams = ['myorg:team1', 'myorg:team2', 'myorg:team3'] + server.get('/-/org/myorg/team?format=cli').reply(200, teams) + common.npm([ + 'team', 'ls', 'myorg', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), teams) + t.end() + }) +}) + +test('team ls (on team)', function (t) { + var users = ['zkat', 'bcoe'] + server.get('/-/team/myorg/myteam/user?format=cli').reply(200, users) + common.npm([ + 'team', 'ls', 'myorg:myteam', + '--registry', common.registry, + '--loglevel', 'silent' + ], {}, function (err, code, stdout, stderr) { + t.ifError(err, 'npm team') + t.equal(code, 0, 'exited OK') + t.equal(stderr, '', 'no error output') + t.same(JSON.parse(stdout), users) + t.end() + }) +}) + +test('cleanup', function (t) { + t.pass('cleaned up') + server.done() + server.close() + t.end() +}) diff --git a/deps/npm/test/tap/update-examples.js b/deps/npm/test/tap/update-examples.js index 633713d9d7a8cf..44b615b91519dd 100644 --- a/deps/npm/test/tap/update-examples.js +++ b/deps/npm/test/tap/update-examples.js @@ -30,7 +30,10 @@ var DEP_PKG = { var INSTALLED = { dependencies: { - 'dep1': '1.1.1' + 'dep1': { + version: '1.1.1', + link: false + } } } @@ -91,7 +94,7 @@ function resetPackage (options) { } if (options.installed) { - mockInstalled.dependencies.dep1 = options.installed + mockInstalled.dependencies.dep1.version = options.installed mockDepJson.version = options.installed } } diff --git a/deps/npm/test/tap/version-no-package.js b/deps/npm/test/tap/version-no-package.js index 539f53feb72ca9..678ce1779dcb45 100644 --- a/deps/npm/test/tap/version-no-package.js +++ b/deps/npm/test/tap/version-no-package.js @@ -26,8 +26,8 @@ test("npm version in a prefix with no package.json", function(t) { 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.end() } ) }) 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/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 @ a1b1 + 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 @ a0b0 + 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.loXi.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.hiXi.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 @ HIi+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.loXi.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.hiXi.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 @ HIi+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.loXi.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.hiXi.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.loXi.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.hiXi.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 //HIi+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.loXi.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.hiXi.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 //HIi+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.loXi.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.hiXi.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 @ a1b1 + 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 @ a0b0 + 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.loXi.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.hiXi.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 @ HIi+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.loXi.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.hiXi.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 @ HIi+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.loXi.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.hiXi.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.loXi.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.hiXi.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 //HIi+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.loXi.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.hiXi.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 //HIi+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.loXi.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.hiXi.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 1d4b1570122bfd..b56e9004c3b732 100644 --- a/deps/openssl/config/Makefile +++ b/deps/openssl/config/Makefile @@ -2,10 +2,10 @@ PERL = perl CONFIGURE = ./Configure COPT = no-shared no-symlinks -ARCHS = 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 +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 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..31e9f5416eaa29 100644 --- a/deps/openssl/config/archs/BSD-x86/opensslconf.h +++ b/deps/openssl/config/archs/BSD-x86/opensslconf.h @@ -221,7 +221,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..865473bac93752 100644 --- a/deps/openssl/config/archs/BSD-x86_64/opensslconf.h +++ b/deps/openssl/config/archs/BSD-x86_64/opensslconf.h @@ -221,7 +221,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..d49ebfa3defa3a 100644 --- a/deps/openssl/config/archs/VC-WIN32/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN32/opensslconf.h @@ -222,7 +222,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..b248dac0208d69 100644 --- a/deps/openssl/config/archs/VC-WIN64A/opensslconf.h +++ b/deps/openssl/config/archs/VC-WIN64A/opensslconf.h @@ -222,7 +222,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 new file mode 100644 index 00000000000000..7c71fad1c469d8 --- /dev/null +++ b/deps/openssl/config/archs/aix-gcc/opensslconf.h @@ -0,0 +1,261 @@ +/* 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_SYSNAME_AIX +# define OPENSSL_SYSNAME_AIX +#endif +#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_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#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_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# 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. + */ +#undef RC4_CHUNK +#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 long +#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 +#undef 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/aix64-gcc/opensslconf.h b/deps/openssl/config/archs/aix64-gcc/opensslconf.h new file mode 100644 index 00000000000000..37490dfb5bbd65 --- /dev/null +++ b/deps/openssl/config/archs/aix64-gcc/opensslconf.h @@ -0,0 +1,261 @@ +/* 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_SYSNAME_AIX +# define OPENSSL_SYSNAME_AIX +#endif +#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_STORE +# define OPENSSL_NO_STORE +#endif +#ifndef OPENSSL_NO_UNIT_TEST +# define OPENSSL_NO_UNIT_TEST +#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_STORE) && !defined(NO_STORE) +# define NO_STORE +# endif +# if defined(OPENSSL_NO_UNIT_TEST) && !defined(NO_UNIT_TEST) +# define NO_UNIT_TEST +# 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. + */ +#undef RC4_CHUNK +#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 long +#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 +#undef 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/darwin-i386-cc/opensslconf.h b/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h index 4dedfacceea277..02328a5333b06b 100644 --- a/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h +++ b/deps/openssl/config/archs/darwin-i386-cc/opensslconf.h @@ -224,7 +224,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..d7be6bbc4b77e1 100644 --- a/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h +++ b/deps/openssl/config/archs/darwin64-x86_64-cc/opensslconf.h @@ -224,7 +224,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..92d6937741a2dd 100644 --- a/deps/openssl/config/archs/linux-aarch64/opensslconf.h +++ b/deps/openssl/config/archs/linux-aarch64/opensslconf.h @@ -221,7 +221,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..24d98356f6e978 100644 --- a/deps/openssl/config/archs/linux-armv4/opensslconf.h +++ b/deps/openssl/config/archs/linux-armv4/opensslconf.h @@ -221,7 +221,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..31e9f5416eaa29 100644 --- a/deps/openssl/config/archs/linux-elf/opensslconf.h +++ b/deps/openssl/config/archs/linux-elf/opensslconf.h @@ -221,7 +221,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..f5a03b47e54185 100644 --- a/deps/openssl/config/archs/linux-ppc/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc/opensslconf.h @@ -202,7 +202,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 +221,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..900aa7017509f2 100644 --- a/deps/openssl/config/archs/linux-ppc64/opensslconf.h +++ b/deps/openssl/config/archs/linux-ppc64/opensslconf.h @@ -202,7 +202,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 +221,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..79706e45b2c998 100644 --- a/deps/openssl/config/archs/linux-x32/opensslconf.h +++ b/deps/openssl/config/archs/linux-x32/opensslconf.h @@ -221,7 +221,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..865473bac93752 100644 --- a/deps/openssl/config/archs/linux-x86_64/opensslconf.h +++ b/deps/openssl/config/archs/linux-x86_64/opensslconf.h @@ -221,7 +221,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/solaris-x86-gcc/opensslconf.h b/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h index d93c0bfbb5a0aa..31e9f5416eaa29 100644 --- a/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h +++ b/deps/openssl/config/archs/solaris-x86-gcc/opensslconf.h @@ -221,7 +221,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..865473bac93752 100644 --- a/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h +++ b/deps/openssl/config/archs/solaris64-x86_64-gcc/opensslconf.h @@ -221,7 +221,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 66cea5c2851c89..9a7cda94543e68 100644 --- a/deps/openssl/config/opensslconf.h +++ b/deps/openssl/config/opensslconf.h @@ -18,6 +18,8 @@ | --dest-os | --dest-cpu | OpenSSL target arch | CI | | --------- | ---------- | -------------------- | --- | + | aix | ppc | aix-gcc | o | + | aix | ppc64 | aix64-gcc | o | | linux | ia32 | linux-elf | o | | linux | x32 | linux-x32 | - | | linux | x64 | linux-x86_64 | o | @@ -41,6 +43,7 @@ | --dest-os | pre-defined macro | | ------------------ | ------------------------- | + | aix | _AIX | | win | _WIN32 | | win(64bit) | _WIN64 | | mac | __APPLE__ && __MACH__ | @@ -62,7 +65,9 @@ | x64 | __x86_64__ | | x64(win) | _M_X64 | | ppc | __PPC__ | + | | _ARCH_PPC | | ppc64 | __PPC64__ | + | | _ARCH_PPC64 | These are the list which is not implemented yet. @@ -115,6 +120,10 @@ # include "./archs/linux-ppc64/opensslconf.h" #elif defined(OPENSSL_LINUX) && !defined(__PPC64__) && defined(__ppc__) # include "./archs/linux-ppc/opensslconf.h" +#elif defined(_AIX) && defined(_ARCH_PPC64) +# include "./archs/aix64-gcc/opensslconf.h" +#elif defined(_AIX) && !defined(_ARCH_PPC64) && defined(_ARCH_PPC) +# include "./archs/aix-gcc/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 0389abdd149184..3a319d91f0df7a 100644 --- a/deps/openssl/openssl.gyp +++ b/deps/openssl/openssl.gyp @@ -43,6 +43,14 @@ ], }, }], + [ 'OS=="aix"', { + # AIX is missing /usr/include/endian.h + 'defines': [ + '__LITTLE_ENDIAN=1234', + '__BIG_ENDIAN=4321', + '__BYTE_ORDER=__BIG_ENDIAN', + '__FLOAT_WORD_ORDER=__BIG_ENDIAN'], + }], [ 'node_byteorder=="big"', { # Define Big Endian 'defines': ['B_ENDIAN'] 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 Bck. + independently by Hanno Böck. (CVE-2015-1789) - [Emilia Ksper] + [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 Ksper] + [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 Ksper] + [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 Ksper + This issue was discovered by Sean Burford (Google) and Emilia Käsper (OpenSSL development team). (CVE-2015-0293) - [Emilia Ksper] + [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 Ksper] + [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 Ksper] + [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 Ksper] + [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 Grbert (Google) for discovering and researching this + Thanks to Felix Gröbert (Google) for discovering and researching this issue. (CVE-2014-3510) - [Emilia Ksper] + [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 Hietamki (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 Ksper, 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 Jri Aedla for reporting this issue. (CVE-2014-0195) - [Jri 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 Grbert 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 Grbert, 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 Ksper for the initial patch. + Emilia Käsper for the initial patch. (CVE-2013-0169) - [Emilia Ksper, 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 Ksper, 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 Ksper (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 Ksper (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. - [Zoltn Glzik , 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 Mller] + [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 Mller] + [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. - [Gtz 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 Mller] + [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 Mller] + [Ulf Möller] *) Fix hang in EGD/PRNGD query when communication socket is closed prematurely by EGD/PRNGD. - [Darren Tucker via Lutz Jnicke, 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. - [Gtz 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 Mller, 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 Mller, Bodo Mller] + [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 Mller] + [Ulf Möller] *) rand_win.c fix for Borland C. - [Ulf Mller] + [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 Mller] + [Bodo Möller] *) Add DSO method for VMS. [Richard Levitte] *) Bug fix: Montgomery multiplication could produce results with the wrong sign. - [Ulf Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller, 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 Mller] + [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 Mller] + [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 Mller, 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 Mller] + [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 Mller] + [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 Mller] + [Ulf Möller] *) More tests in bntest.c, and changed test_bn output. - [Ulf Mller] + [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 Mller] + [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 Mller] + [Ulf Möller] *) Correct return values in BN_mod_exp_mont() and BN_mod_exp2_mont() for p == 0. - [Ulf Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller, Bodo Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller, 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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [Janez Jere , modified by Ulf Möller] *) Support Mingw32. - [Ulf Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [Ulf Möller] *) Fix typos in error codes. - [Martin Kraemer , Ulf Mller] + [Martin Kraemer , Ulf Möller] *) Remove defunct assembler files from Configure. - [Ulf Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller] + [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 Mller ] + [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 Mller ] + [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 Mller ] + [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 index f36147287f5dfa..ee04c02cc1ca9e 100644 --- a/deps/openssl/openssl/Makefile +++ b/deps/openssl/openssl/Makefile @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2d +VERSION=1.0.2f MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -182,8 +182,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 @@ -205,7 +204,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)' \ @@ -499,35 +500,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.bak b/deps/openssl/openssl/Makefile.bak index 9a3e50df6011bb..96d8e0f1999f1e 100644 --- a/deps/openssl/openssl/Makefile.bak +++ b/deps/openssl/openssl/Makefile.bak @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2d-dev +VERSION=1.0.2f-dev MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -182,8 +182,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 @@ -205,7 +204,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)' \ @@ -499,35 +500,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.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/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%. # -# Cmara, D.; Gouva, C. P. L.; Lpez, 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]=a1a0b1b0 +# 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 @ a1b1 + 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 @ a0b0 + 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 # a1b1 + 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 # a0b0 + 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"); # a1b1 + &call ("_mul_1x1_mmx"); # a1·b1 &movq ("mm7",$R); &mov ($a,&wparam(2)); &mov ($b,&wparam(4)); - &call ("_mul_1x1_mmx"); # a0b0 + &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)-a1b1-a0b0 + &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"); # a1b1 + &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"); # a0b0 + &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 # a1b1 + pclmulqdq \$0,%xmm1,%xmm0 # a1·b1 pxor %xmm2,%xmm4 pxor %xmm3,%xmm5 - pclmulqdq \$0,%xmm3,%xmm2 # a0b0 - 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)-a0b0-a1b1 + 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 # a1b1 + call _mul_1x1 # a1·b1 mov $lo,16(%rsp) mov $hi,24(%rsp) mov 48(%rsp),$a mov 64(%rsp),$b - call _mul_1x1 # a0b0 + 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. # -# Cmara, D.; Gouva, C. P. L.; Lpez, 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.loXi.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.hiXi.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 ! (0xE0i)&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 ! (0xE0i)&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 ! ($C00xE1)<<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 ! (0xE0i)&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 ! ($C00xE1)<<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.loXi.lo - vpmsumd $Xm,$IN,$H # H.hiXi.lo+H.loXi.hi - vpmsumd $Xh,$IN,$Hh # H.hiXi.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.loXi.lo + vpmsumd $Xl,$IN,$Hl # H.lo·Xi.lo subfe. r0,r0,r0 # borrow?-1:0 - vpmsumd $Xm,$IN,$H # H.hiXi.lo+H.loXi.hi + vpmsumd $Xm,$IN,$H # H.hi·Xi.lo+H.lo·Xi.hi and r0,r0,$len - vpmsumd $Xh,$IN,$Hh # H.hiXi.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.loXi.lo + vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo veor $t1,$t1,$IN @ Karatsuba pre-processing - vpmull2.p64 $Xh,$H,$IN @ H.hiXi.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 @ HIi+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.loXi.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.hiXi.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 @ HIi+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.loXi.lo + vpmull.p64 $Xl,$H,$IN @ H.lo·Xi.lo veor $t1,$t1,$IN @ Karatsuba pre-processing - vpmull2.p64 $Xh,$H,$IN @ H.hiXi.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 callers 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 Hgskolan +/* 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 Hgskolan +/* 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 Mller +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/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/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 bbb8f4d8cdcadb..8dc3955cad5bf3 100644 --- a/deps/uv/AUTHORS +++ b/deps/uv/AUTHORS @@ -200,3 +200,43 @@ farblue68 Jason Williams Igor Soarez Miodrag Milanovic +Cheng Zhao +Michael Neumann +Stefano Cristiano +heshamsafi +A. Hauptmann +John McNamee +Yosuke Furukawa +Santiago Gimeno +guworks +RossBencina +Roger A. Light +chenttuuvv +Richard Lau +ronkorving +Corbin Simpson +Zachary Hamm +Karl Skomski +Jeremy Whitlock +Willem Thiart +Ben Trask +Jianghua Yang +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/CONTRIBUTING.md b/deps/uv/CONTRIBUTING.md index 332ed1129b848c..b46edd492aab47 100644 --- a/deps/uv/CONTRIBUTING.md +++ b/deps/uv/CONTRIBUTING.md @@ -49,7 +49,7 @@ the [Google C/C++ style guide]. Some of the key points, as well as some additional guidelines, are enumerated below. * Code that is specific to unix-y platforms should be placed in `src/unix`, and - declarations go into `src/uv-unix.h`. + declarations go into `include/uv-unix.h`. * Source code that is Windows-specific goes into `src/win`, and related publicly exported types, functions and macro declarations should generally diff --git a/deps/uv/ChangeLog b/deps/uv/ChangeLog index 5d3a4cad46b383..af0743af72c8db 100644 --- a/deps/uv/ChangeLog +++ b/deps/uv/ChangeLog @@ -1,3 +1,314 @@ +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: + +* unix: Support atomic compare & swap xlC on AIX (nmushell) + +* unix: Fix including uv-aix.h on AIX (nmushell) + +* unix: consolidate rwlock tryrdlock trywrlock errors (Saúl Ibarra Corretgé) + +* unix, win: consolidate mutex trylock errors (Saúl Ibarra Corretgé) + +* darwin: fix memory leak in uv_cpu_info (Jianghua Yang) + +* test: add tests for the uv_rwlock implementation (Bert Belder) + +* win: redo/fix the uv_rwlock APIs (Bert Belder) + +* win: don't fetch function pointers to SRWLock APIs (Bert Belder) + + +2015.09.12, Version 1.7.4 (Stable), a7ad4f52189d89cfcba35f78bfc5ff3b1f4105c4 + +Changes since version 1.7.3: + +* doc: uv_read_start and uv_read_cb clarifications (Ben Trask) + +* freebsd: obtain true uptime through clock_gettime() (Jianghua Yang) + +* win, tty: do not convert \r to \r\n (Colin Snover) + +* build,gyp: add DragonFly to the list of OSes (Michael Neumann) + +* fs: fix bug in sendfile for DragonFly (Michael Neumann) + +* doc: add uv_dlsym() return type (Brian White) + +* tests: fix fs tests run w/o full getdents support (Jeremy Whitlock) + +* doc: fix typo (Devchandra Meetei Leishangthem) + +* doc: fix uv-unix.h location (Sakthipriyan Vairamani) + +* unix: fix error check when closing process pipe fd (Ben Noordhuis) + +* test,freebsd: fix ipc_listen_xx_write tests (Santiago Gimeno) + +* win: fix unsavory rwlock fallback implementation (Bert Belder) + +* doc: clarify repeat timer behavior (Eli Skeggs) + + +2015.08.28, Version 1.7.3 (Stable), 93877b11c8b86e0a6befcda83a54555c1e36e4f0 + +Changes since version 1.7.2: + +* threadpool: fix thread starvation bug (Ben Noordhuis) + + +2015.08.25, Version 1.7.2 (Stable), 4d13a013fcfa72311f0102751fdc7951873f466c + +Changes since version 1.7.1: + +* unix, win: make uv_loop_init return on error (Willem Thiart) + +* win: reset pipe handle for pipe servers (Saúl Ibarra Corretgé) + +* win: fix replacing pipe handle for pipe servers (Saúl Ibarra Corretgé) + +* win: fix setting pipe pending instances after bind (Saúl Ibarra Corretgé) + + +2015.08.20, Version 1.7.1 (Stable), 44f4b6bd82d8ae4583ccc4768a83af778ef69f85 + +Changes since version 1.7.0: + +* doc: document the procedure for verifying releases (Saúl Ibarra Corretgé) + +* doc: add note about Windows binaries to the README (Saúl Ibarra Corretgé) + +* doc: use long GPG IDs in MAINTAINERS.md (Saúl Ibarra Corretgé) + +* Revert "stream: squelch ECONNRESET error if already closed" (Saúl Ibarra + Corretgé) + +* doc: clarify uv_read_stop() is idempotent (Corbin Simpson) + +* unix: OpenBSD's setsockopt needs an unsigned char for multicast (Zachary + Hamm) + +* test: Fix two memory leaks (Karl Skomski) + +* unix,win: return EINVAL on nullptr args in uv_fs_{read,write} (Karl Skomski) + +* win: set accepted TCP sockets as non-inheritable (Saúl Ibarra Corretgé) + +* unix: remove superfluous parentheses in fs macros (Ben Noordhuis) + +* unix: don't copy arguments for sync fs requests (Ben Noordhuis) + +* test: plug small memory leak in unix test runner (Ben Noordhuis) + +* unix,windows: allow NULL loop for sync fs requests (Ben Noordhuis) + +* unix,windows: don't assert on unknown error code (Ben Noordhuis) + +* stream: retry write on EPROTOTYPE on OSX (Brian White) + +* common: fix use of snprintf on Windows (Saúl Ibarra Corretgé) + +* tests: refactored fs watch_dir tests for stability (Jeremy Whitlock) + + +2015.08.06, Version 1.7.0 (Stable), 415a865d6365ba58d02b92b89d46ba5d7744ec8b + +Changes since version 1.6.1: + +* win,stream: add slot to remember CRT fd (Bert Belder) + +* win,pipe: properly close when created from CRT fd (Bert Belder) + +* win,pipe: don't close fd 0-2 (Bert Belder) + +* win,tty: convert fd -> handle safely (Bert Belder) + +* win,tty: properly close when created from CRT fd (Bert Belder) + +* win,tty: don't close fd 0-2 (Bert Belder) + +* win,fs: don't close fd 0-2 (Bert Belder) + +* win: include "malloc.h" (Cheng Zhao) + +* windows: MSVC 2015 has C99 inline (Jason Williams) + +* dragonflybsd: fixes for nonblocking and cloexec (Michael Neumann) + +* dragonflybsd: use sendfile(2) for uv_fs_sendfile (Michael Neumann) + +* dragonflybsd: fix uv_exepath (Michael Neumann) + +* win,fs: Fixes align(8) directive on mingw (Stefano Cristiano) + +* unix, win: prevent replacing fd in uv_{udp,tcp,pipe}_t (Saúl Ibarra Corretgé) + +* win: move logic to set socket non-inheritable to uv_tcp_set_socket (Saúl + Ibarra Corretgé) + +* unix, win: add ability to create tcp/udp sockets early (Saúl Ibarra Corretgé) + +* test: retry select() on EINTR, honor milliseconds (Ben Noordhuis) + +* unix: consolidate tcp and udp bind error (Saúl Ibarra Corretgé) + +* test: conditionally skip udp_ipv6_multicast_join6 (heshamsafi) + +* core: add UV_VERSION_HEX macro (Saúl Ibarra Corretgé) + +* doc: add section with version-checking macros and functions (Saúl Ibarra + Corretgé) + +* tty: cleanup handle if uv_tty_init fails (Saúl Ibarra Corretgé) + +* darwin: save a fd when FSEvents is used (Saúl Ibarra Corretgé) + +* win: fix returning thread id in uv_thread_self (Saúl Ibarra Corretgé) + +* common: use offsetof for QUEUE_DATA (Saúl Ibarra Corretgé) + +* win: remove UV_HANDLE_CONNECTED (A. Hauptmann) + +* docs: add Windows specific note for uv_fs_open (Saúl Ibarra Corretgé) + +* doc: add note about uv_fs_scandir (Saúl Ibarra Corretgé) + +* test,unix: reduce stack size of watchdog threads (Ben Noordhuis) + +* win: add support for recursive file watching (Saúl Ibarra Corretgé) + +* win,tty: support consoles with non-default colors (John McNamee) + +* doc: add missing variable name (Yosuke Furukawa) + +* stream: squelch ECONNRESET error if already closed (Santiago Gimeno) + +* build: remove ancient condition from common.gypi (Saúl Ibarra Corretgé) + +* tests: skip some tests when network is unreachable (Luca Bruno) + +* build: proper support for android cross compilation (guworks) + +* android: add missing include to pthread-fixes.c (RossBencina) + +* test: fix compilation warning (Saúl Ibarra Corretgé) + +* doc: add a note about uv_dirent_t.type (Saúl Ibarra Corretgé) + +* win,test: fix shared library build (Saúl Ibarra Corretgé) + +* test: fix compilation warning (Santiago Gimeno) + +* build: add experimental Windows installer (Roger A. Light) + +* threadpool: send signal only when queue is empty (chenttuuvv) + +* aix: fix uv_exepath with relative paths (Richard Lau) + +* build: fix version syntax in AppVeyor file (Saúl Ibarra Corretgé) + +* unix: allow nbufs > IOV_MAX in uv_fs_{read,write} (ronkorving) + + 2015.06.06, Version 1.6.1 (Stable), 30c8be07bb78a66fdee5141626bf53a49a17094a Changes since version 1.6.0: diff --git a/deps/uv/MAINTAINERS.md b/deps/uv/MAINTAINERS.md new file mode 100644 index 00000000000000..4db2f5130c060d --- /dev/null +++ b/deps/uv/MAINTAINERS.md @@ -0,0 +1,36 @@ + +# Project Maintainers + +libuv is currently managed by the following individuals: + +* **Ben Noordhuis** ([@bnoordhuis](https://github.com/bnoordhuis)) + - GPG key: D77B 1E34 243F BAF0 5F8E 9CC3 4F55 C8C8 46AB 89B9 (pubkey-bnoordhuis) +* **Bert Belder** ([@piscisaureus](https://github.com/piscisaureus)) +* **Fedor Indutny** ([@indutny](https://github.com/indutny)) + - GPG key: AF2E EA41 EC34 47BF DD86 FED9 D706 3CCE 19B7 E890 (pubkey-indutny) +* **Saúl Ibarra Corretgé** ([@saghul](https://github.com/saghul)) + - GPG key: FDF5 1936 4458 319F A823 3DC9 410E 5553 AE9B C059 (pubkey-saghul) + +## Storing a maintainer key in Git + +It's quite handy to store a maintainer's signature as a git blob, and have +that object tagged and signed with such key. + +Export your public key: + + $ gpg --armor --export saghul@gmail.com > saghul.asc + +Store it as a blob on the repo: + + $ git hash-object -w saghul.asc + +The previous command returns a hash, copy it. For the sake of this explanation, +we'll assume it's 'abcd1234'. Storing the blob in git is not enough, it could +be garbage collected since nothing references it, so we'll create a tag for it: + + $ git tag -s pubkey-saghul abcd1234 + +Commit the changes and push: + + $ git push origin pubkey-saghul + diff --git a/deps/uv/Makefile.am b/deps/uv/Makefile.am index e9814d7b703e14..0ef781ff198804 100644 --- a/deps/uv/Makefile.am +++ b/deps/uv/Makefile.am @@ -186,8 +186,10 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-ping-pong.c \ test/test-pipe-bind-error.c \ test/test-pipe-connect-error.c \ + test/test-pipe-connect-multiple.c \ test/test-pipe-connect-prepare.c \ test/test-pipe-getsockname.c \ + test/test-pipe-pending-instances.c \ test/test-pipe-sendmsg.c \ test/test-pipe-server-close.c \ test/test-pipe-close-stdout-read-stdin.c \ @@ -198,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 \ @@ -215,6 +218,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-tcp-close-accept.c \ test/test-tcp-close-while-connecting.c \ test/test-tcp-close.c \ + test/test-tcp-create-socket-early.c \ test/test-tcp-connect-error-after-write.c \ test/test-tcp-connect-error.c \ test/test-tcp-connect-timeout.c \ @@ -240,6 +244,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \ test/test-timer.c \ test/test-tty.c \ test/test-udp-bind.c \ + test/test-udp-create-socket-early.c \ test/test-udp-dgram-too-big.c \ test/test-udp-ipv6.c \ test/test-udp-multicast-interface.c \ @@ -276,6 +281,7 @@ endif if AIX libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT +include_HEADERS += include/uv-aix.h libuv_la_SOURCES += src/unix/aix.c endif diff --git a/deps/uv/README.md b/deps/uv/README.md index f9a7a1e62e4d3f..dfd24ba79d1850 100644 --- a/deps/uv/README.md +++ b/deps/uv/README.md @@ -89,6 +89,42 @@ also serve as API specification and usage examples. These resources are not handled by libuv maintainers and might be out of date. Please verify it before opening new issues. +## Downloading + +libuv can be downloaded either from the +[GitHub repository](https://github.com/libuv/libuv) +or from the [downloads site](http://dist.libuv.org/dist/). + +Starting with libuv 1.7.0, binaries for Windows are also provided. This is to +be considered EXPERIMENTAL. + +Before verifying the git tags or signature files, importing the relevant keys +is necessary. Key IDs are listed in the +[MAINTAINERS](https://github.com/libuv/libuv/blob/master/MAINTAINERS.md) +file, but are also available as git blob objects for easier use. + +Importing a key the usual way: + + $ gpg --keyserver pool.sks-keyservers.net \ + --recv-keys AE9BC059 + +Importing a key from a git blob object: + + $ git show pubkey-saghul | gpg --import + +### Verifying releases + +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 accompanying +signature file sit alongside each. Once both the release tarball and the +signature file are downloaded, the file can be verified as follows: + + $ gpg --verify libuv-1.7.0.tar.gz.sign + ## Build Instructions For GCC there are two build methods: via autotools or via [GYP][]. diff --git a/deps/uv/android-configure b/deps/uv/android-configure index 9750581206e27a..e0b250fb6348e2 100755 --- a/deps/uv/android-configure +++ b/deps/uv/android-configure @@ -6,7 +6,7 @@ $1/build/tools/make-standalone-toolchain.sh \ --toolchain=arm-linux-androideabi-4.8 \ --arch=arm \ --install-dir=$TOOLCHAIN \ - --platform=android-9 + --platform=android-21 export PATH=$TOOLCHAIN/bin:$PATH export AR=arm-linux-androideabi-ar export CC=arm-linux-androideabi-gcc @@ -16,5 +16,5 @@ export PLATFORM=android if [ $2 -a $2 == 'gyp' ] then - ./gyp_uv.py -Dtarget_arch=arm -DOS=android + ./gyp_uv.py -Dtarget_arch=arm -DOS=android -f make-android fi diff --git a/deps/uv/appveyor.yml b/deps/uv/appveyor.yml new file mode 100644 index 00000000000000..9aa63c5a5d2e73 --- /dev/null +++ b/deps/uv/appveyor.yml @@ -0,0 +1,36 @@ +version: v1.8.0.build{build} + +install: + - cinst -y nsis + +matrix: + fast_finish: true + allow_failures: + - platform: x86 + configuration: Release + - platform: x64 + configuration: Release + +platform: + - x86 + - x64 + +configuration: + - Release + +build_script: + # Fixed tag version number if using a tag. + - cmd: if "%APPVEYOR_REPO_TAG%" == "true" set APPVEYOR_BUILD_VERSION=%APPVEYOR_REPO_TAG_NAME% + # vcbuild overwrites the platform variable. + - cmd: set ARCH=%platform% + - cmd: vcbuild.bat release %ARCH% shared + +after_build: + - '"%PROGRAMFILES(x86)%\NSIS\makensis" /DVERSION=%APPVEYOR_BUILD_VERSION% /DARCH=%ARCH% libuv.nsi' + +artifacts: + - name: Installer + path: 'libuv-*.exe' + +cache: + - C:\projects\libuv\build\gyp diff --git a/deps/uv/common.gypi b/deps/uv/common.gypi index ecf9475234f3da..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 }, @@ -37,9 +36,10 @@ 'OTHER_CFLAGS': [ '-Wno-strict-aliasing' ], }, 'conditions': [ - ['OS != "win"', { - 'defines': [ 'EV_VERIFY=2' ], - }], + ['OS == "android"', { + 'cflags': [ '-fPIE' ], + 'ldflags': [ '-fPIE', '-pie' ] + }] ] }, 'Release': { @@ -128,7 +128,7 @@ }] ] }], - ['OS in "freebsd linux openbsd solaris android"', { + ['OS in "freebsd dragonflybsd linux openbsd solaris android"', { 'cflags': [ '-Wall' ], 'cflags_cc': [ '-fno-rtti', '-fno-exceptions' ], 'target_conditions': [ diff --git a/deps/uv/configure.ac b/deps/uv/configure.ac index fe7228e2b726c2..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.6.1], [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/check.rst b/deps/uv/docs/src/check.rst index 8d48f222767b4c..36c93cf03d99c0 100644 --- a/deps/uv/docs/src/check.rst +++ b/deps/uv/docs/src/check.rst @@ -31,7 +31,7 @@ N/A API --- -.. c:function:: int uv_check_init(uv_loop_t*, uv_check_t* check) +.. c:function:: int uv_check_init(uv_loop_t* loop, uv_check_t* check) Initialize the handle. diff --git a/deps/uv/docs/src/dll.rst b/deps/uv/docs/src/dll.rst index 3fb11e192db411..fb13f90815996b 100644 --- a/deps/uv/docs/src/dll.rst +++ b/deps/uv/docs/src/dll.rst @@ -34,7 +34,7 @@ API Close the shared library. -.. c:function:: uv_dlsym(uv_lib_t* lib, const char* name, void** ptr) +.. c:function:: int uv_dlsym(uv_lib_t* lib, const char* name, void** ptr) Retrieves a data pointer from a dynamic library. It is legal for a symbol to map to NULL. Returns 0 on success and -1 if the symbol was not found. diff --git a/deps/uv/docs/src/errors.rst b/deps/uv/docs/src/errors.rst index 5d59dc30f2859d..cec25f5187e1ce 100644 --- a/deps/uv/docs/src/errors.rst +++ b/deps/uv/docs/src/errors.rst @@ -322,8 +322,10 @@ API .. c:function:: const char* uv_strerror(int err) - Returns the error message for the given error code. + Returns the error message for the given error code. Leaks a few bytes + of memory when you call it with an unknown error code. .. c:function:: const char* uv_err_name(int err) - Returns the error name for the given error code. + Returns the error name for the given error code. Leaks a few bytes + of memory when you call it with an unknown error code. diff --git a/deps/uv/docs/src/fs.rst b/deps/uv/docs/src/fs.rst index c2a3fc252a1ffe..69e283f4c67fc6 100644 --- a/deps/uv/docs/src/fs.rst +++ b/deps/uv/docs/src/fs.rst @@ -168,6 +168,11 @@ API Equivalent to :man:`open(2)`. + .. note:: + On Windows libuv uses `CreateFileW` and thus the file is always opened + in binary mode. Because of this the O_BINARY and O_TEXT flags are not + supported. + .. c:function:: int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, uv_file file, const uv_buf_t bufs[], unsigned int nbufs, int64_t offset, uv_fs_cb cb) Equivalent to :man:`preadv(2)`. @@ -206,6 +211,13 @@ API get `ent` populated with the next directory entry data. When there are no more entries ``UV_EOF`` will be returned. + .. note:: + Unlike `scandir(3)`, this function does not return the "." and ".." entries. + + .. note:: + On Linux, getting the type of an entry is only supported by some filesystems (btrfs, ext2, + ext3 and ext4 at the time of this writing), check the :man:`getdents(2)` man page. + .. c:function:: int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) .. c:function:: int uv_fs_fstat(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) .. c:function:: int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) @@ -267,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/fs_event.rst b/deps/uv/docs/src/fs_event.rst index 681ae52f95c7a4..c2d7f520236856 100644 --- a/deps/uv/docs/src/fs_event.rst +++ b/deps/uv/docs/src/fs_event.rst @@ -88,7 +88,7 @@ API `path` for changes. `flags` can be an ORed mask of :c:type:`uv_fs_event_flags`. .. note:: Currently the only supported flag is ``UV_FS_EVENT_RECURSIVE`` and - only on OSX. + only on OSX and Windows. .. c:function:: int uv_fs_event_stop(uv_fs_event_t* handle) diff --git a/deps/uv/docs/src/idle.rst b/deps/uv/docs/src/idle.rst index 81f51d2076e2ca..1f51c4a19e4a0b 100644 --- a/deps/uv/docs/src/idle.rst +++ b/deps/uv/docs/src/idle.rst @@ -39,7 +39,7 @@ N/A API --- -.. c:function:: int uv_idle_init(uv_loop_t*, uv_idle_t* idle) +.. c:function:: int uv_idle_init(uv_loop_t* loop, uv_idle_t* idle) Initialize the handle. diff --git a/deps/uv/docs/src/index.rst b/deps/uv/docs/src/index.rst index 9cdc494aecba79..fa89c4bffe580c 100644 --- a/deps/uv/docs/src/index.rst +++ b/deps/uv/docs/src/index.rst @@ -68,6 +68,7 @@ Documentation design errors + version loop handle request diff --git a/deps/uv/docs/src/misc.rst b/deps/uv/docs/src/misc.rst index 9708c5dea476cf..2ce0887db0c278 100644 --- a/deps/uv/docs/src/misc.rst +++ b/deps/uv/docs/src/misc.rst @@ -135,17 +135,6 @@ API For :man:`isatty(3)` equivalent functionality use this function and test for ``UV_TTY``. -.. c:function:: unsigned int uv_version(void) - - Returns the libuv version packed into a single integer. 8 bits are used for - each component, with the patch number stored in the 8 least significant - bits. E.g. for libuv 1.2.3 this would return 0x010203. - -.. c:function:: const char* uv_version_string(void) - - Returns the libuv version number as a string. For non-release versions - "-pre" is appended, so the version number could be "1.2.3-pre". - .. c:function:: int uv_replace_allocator(uv_malloc_func malloc_func, uv_realloc_func realloc_func, uv_calloc_func calloc_func, uv_free_func free_func) .. versionadded:: 1.6.0 @@ -299,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/pipe.rst b/deps/uv/docs/src/pipe.rst index df896a0583447f..d33b0f2b977b5b 100644 --- a/deps/uv/docs/src/pipe.rst +++ b/deps/uv/docs/src/pipe.rst @@ -29,12 +29,12 @@ N/A API --- -.. c:function:: int uv_pipe_init(uv_loop_t*, uv_pipe_t* handle, int ipc) +.. c:function:: int uv_pipe_init(uv_loop_t* loop, uv_pipe_t* handle, int ipc) Initialize a pipe handle. The `ipc` argument is a boolean to indicate if this pipe will be used for handle passing between processes. -.. c:function:: int uv_pipe_open(uv_pipe_t*, uv_file file) +.. c:function:: int uv_pipe_open(uv_pipe_t* handle, uv_file file) Open an existing file descriptor or HANDLE as a pipe. diff --git a/deps/uv/docs/src/request.rst b/deps/uv/docs/src/request.rst index 2f58d46b143c6d..660b80ae9573b3 100644 --- a/deps/uv/docs/src/request.rst +++ b/deps/uv/docs/src/request.rst @@ -25,7 +25,7 @@ Data types Public members ^^^^^^^^^^^^^^ -.. c:member:: void* uv_request_t.data +.. c:member:: void* uv_req_t.data Space for user-defined arbitrary data. libuv does not use this field. diff --git a/deps/uv/docs/src/signal.rst b/deps/uv/docs/src/signal.rst index 21675945fc4ba9..dc1223b90ac5e2 100644 --- a/deps/uv/docs/src/signal.rst +++ b/deps/uv/docs/src/signal.rst @@ -62,7 +62,7 @@ Public members API --- -.. c:function:: int uv_signal_init(uv_loop_t*, uv_signal_t* signal) +.. c:function:: int uv_signal_init(uv_loop_t* loop, uv_signal_t* signal) Initialize the handle. diff --git a/deps/uv/docs/src/stream.rst b/deps/uv/docs/src/stream.rst index 880f0e2ebc75d3..9f0aacd16435d0 100644 --- a/deps/uv/docs/src/stream.rst +++ b/deps/uv/docs/src/stream.rst @@ -32,8 +32,14 @@ Data types Callback called when data was read on a stream. - `nread` is > 0 if there is data available, 0 if libuv is done reading for - now, or < 0 on error. + `nread` is > 0 if there is data available or < 0 on error. When we've + reached EOF, `nread` will be set to ``UV_EOF``. When `nread` < 0, + the `buf` parameter might not point to a valid buffer; in that case + `buf.len` and `buf.base` are both set to 0. + + .. note:: + `nread` might be 0, which does *not* indicate an error or EOF. This + is equivalent to ``EAGAIN`` or ``EWOULDBLOCK`` under ``read(2)``. The callee is responsible for stopping closing the stream when an error happens by calling :c:func:`uv_read_stop` or :c:func:`uv_close`. Trying to read @@ -123,25 +129,19 @@ API .. note:: `server` and `client` must be handles running on the same loop. -.. c:function:: int uv_read_start(uv_stream_t*, uv_alloc_cb alloc_cb, uv_read_cb read_cb) - - Read data from an incoming stream. The callback will be made several - times until there is no more data to read or :c:func:`uv_read_stop` is called. - When we've reached EOF `nread` will be set to ``UV_EOF``. +.. c:function:: int uv_read_start(uv_stream_t* stream, uv_alloc_cb alloc_cb, uv_read_cb read_cb) - When `nread` < 0, the `buf` parameter might not point to a valid buffer; - in that case `buf.len` and `buf.base` are both set to 0. - - .. note:: - `nread` might also be 0, which does *not* indicate an error or EOF, it happens when - libuv requested a buffer through the alloc callback but then decided that it didn't - need that buffer. + Read data from an incoming stream. The :c:type:`uv_read_cb` callback will + be made several times until there is no more data to read or + :c:func:`uv_read_stop` is called. .. c:function:: int uv_read_stop(uv_stream_t*) Stop reading data from the stream. The :c:type:`uv_read_cb` callback will no longer be called. + This function is idempotent and may be safely called on a stopped stream. + .. c:function:: int uv_write(uv_write_t* req, uv_stream_t* handle, const uv_buf_t bufs[], unsigned int nbufs, uv_write_cb cb) Write data to stream. Buffers are written in order. Example: diff --git a/deps/uv/docs/src/tcp.rst b/deps/uv/docs/src/tcp.rst index dd746fe87fba76..ca0c9b4ac5af4c 100644 --- a/deps/uv/docs/src/tcp.rst +++ b/deps/uv/docs/src/tcp.rst @@ -28,9 +28,18 @@ N/A API --- -.. c:function:: int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle) +.. c:function:: int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* handle) - Initialize the handle. + Initialize the handle. No socket is created as of yet. + +.. 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 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`. + + .. versionadded:: 1.7.0 .. c:function:: int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) diff --git a/deps/uv/docs/src/timer.rst b/deps/uv/docs/src/timer.rst index e558704cb202cf..31d733efc39cfd 100644 --- a/deps/uv/docs/src/timer.rst +++ b/deps/uv/docs/src/timer.rst @@ -54,7 +54,15 @@ API .. c:function:: void uv_timer_set_repeat(uv_timer_t* handle, uint64_t repeat) - Set the repeat value in milliseconds. + Set the repeat interval value in milliseconds. The timer will be scheduled + to run on the given interval, regardless of the callback execution + duration, and will follow normal timer semantics in the case of a + time-slice overrun. + + For example, if a 50ms repeating timer first runs for 17ms, it will be + scheduled to run again 33ms later. If other tasks consume more than the + 33ms following the first timer callback, then the callback will run as soon + as possible. .. note:: If the repeat value is set from a timer callback it does not immediately take effect. diff --git a/deps/uv/docs/src/tty.rst b/deps/uv/docs/src/tty.rst index 18f34ef46d97b5..655dca9ca20641 100644 --- a/deps/uv/docs/src/tty.rst +++ b/deps/uv/docs/src/tty.rst @@ -46,7 +46,7 @@ N/A API --- -.. c:function:: int uv_tty_init(uv_loop_t*, uv_tty_t*, uv_file fd, int readable) +.. c:function:: int uv_tty_init(uv_loop_t* loop, uv_tty_t* handle, uv_file fd, int readable) Initialize a new TTY stream with the given file descriptor. Usually the file descriptor will be: @@ -70,7 +70,7 @@ API descriptor that refers to a file returns `UV_EINVAL` on UNIX. -.. c:function:: int uv_tty_set_mode(uv_tty_t*, uv_tty_mode_t mode) +.. c:function:: int uv_tty_set_mode(uv_tty_t* handle, uv_tty_mode_t mode) .. versionchanged:: 1.2.0: the mode is specified as a :c:type:`uv_tty_mode_t` value. @@ -86,7 +86,7 @@ API code ``UV_EBUSY`` if you call it when execution is inside :c:func:`uv_tty_set_mode`. -.. c:function:: int uv_tty_get_winsize(uv_tty_t*, int* width, int* height) +.. c:function:: int uv_tty_get_winsize(uv_tty_t* handle, int* width, int* height) Gets the current Window size. On success it returns 0. diff --git a/deps/uv/docs/src/udp.rst b/deps/uv/docs/src/udp.rst index ec7ce56d38f52c..dd46603394ee7a 100644 --- a/deps/uv/docs/src/udp.rst +++ b/deps/uv/docs/src/udp.rst @@ -105,11 +105,20 @@ Public members API --- -.. c:function:: int uv_udp_init(uv_loop_t*, uv_udp_t* handle) +.. c:function:: int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) Initialize a new UDP handle. The actual socket is created lazily. Returns 0 on success. +.. c:function:: int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) + + Initialize the handle with the specified flags. At the moment 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_udp_init`. + + .. versionadded:: 1.7.0 + .. c:function:: int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) Opens an existing file descriptor or Windows SOCKET as a UDP handle. diff --git a/deps/uv/docs/src/version.rst b/deps/uv/docs/src/version.rst new file mode 100644 index 00000000000000..e1715b2d3c53fa --- /dev/null +++ b/deps/uv/docs/src/version.rst @@ -0,0 +1,60 @@ + +.. _version: + +Version-checking macros and functions +===================================== + +Starting with version 1.0.0 libuv follows the `semantic versioning`_ +scheme. This means that new APIs can be introduced throughout the lifetime of +a major release. In this section you'll find all macros and functions that +will allow you to write or compile code conditionally, in order to work with +multiple libuv versions. + +.. _semantic versioning: http://semver.org + + +Macros +------ + +.. c:macro:: UV_VERSION_MAJOR + + libuv version's major number. + +.. c:macro:: UV_VERSION_MINOR + + libuv version's minor number. + +.. c:macro:: UV_VERSION_PATCH + + libuv version's patch number. + +.. c:macro:: UV_VERSION_IS_RELEASE + + Set to 1 to indicate a release version of libuv, 0 for a development + snapshot. + +.. c:macro:: UV_VERSION_SUFFIX + + libuv version suffix. Certain development releases such as Release Candidates + might have a suffix such as "rc". + +.. c:macro:: UV_VERSION_HEX + + Returns the libuv version packed into a single integer. 8 bits are used for + each component, with the patch number stored in the 8 least significant + bits. E.g. for libuv 1.2.3 this would be 0x010203. + + .. versionadded:: 1.7.0 + + +Functions +--------- + +.. c:function:: unsigned int uv_version(void) + + Returns :c:macro:`UV_VERSION_HEX`. + +.. c:function:: const char* uv_version_string(void) + + Returns the libuv version number as a string. For non-release versions the + version suffix is included. 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 3372212c8c7cee..6e61f55ed20d85 100644 --- a/deps/uv/include/uv-version.h +++ b/deps/uv/include/uv-version.h @@ -31,9 +31,13 @@ */ #define UV_VERSION_MAJOR 1 -#define UV_VERSION_MINOR 6 -#define UV_VERSION_PATCH 1 +#define UV_VERSION_MINOR 8 +#define UV_VERSION_PATCH 0 #define UV_VERSION_IS_RELEASE 1 #define UV_VERSION_SUFFIX "" +#define UV_VERSION_HEX ((UV_VERSION_MAJOR << 16) | \ + (UV_VERSION_MINOR << 8) | \ + (UV_VERSION_PATCH)) + #endif /* UV_VERSION_H */ diff --git a/deps/uv/include/uv-win.h b/deps/uv/include/uv-win.h index fd844202b99a1a..300be476203ed4 100644 --- a/deps/uv/include/uv-win.h +++ b/deps/uv/include/uv-win.h @@ -246,14 +246,20 @@ typedef union { } uv_cond_t; typedef union { - /* srwlock_ has type SRWLOCK, but not all toolchains define this type in */ - /* windows.h. */ - SRWLOCK srwlock_; struct { - uv_mutex_t read_mutex_; - uv_mutex_t write_mutex_; unsigned int num_readers_; - } fallback_; + CRITICAL_SECTION num_readers_lock_; + HANDLE write_semaphore_; + } state_; + /* TODO: remove me in v2.x. */ + struct { + SRWLOCK unused_; + } unused1_; + /* TODO: remove me in v2.x. */ + struct { + uv_mutex_t unused1_; + uv_mutex_t unused2_; + } unused2_; } uv_rwlock_t; typedef struct { diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h index 564af5fad600c6..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" @@ -406,7 +407,10 @@ struct uv_shutdown_s { /* private */ \ uv_close_cb close_cb; \ void* handle_queue[2]; \ - void* reserved[4]; \ + union { \ + int fd; \ + void* reserved[4]; \ + } u; \ UV_HANDLE_PRIVATE_FIELDS \ /* The abstract base class of all handles. */ @@ -421,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); @@ -504,6 +512,7 @@ struct uv_tcp_s { }; UV_EXTERN int uv_tcp_init(uv_loop_t*, uv_tcp_t* handle); +UV_EXTERN int uv_tcp_init_ex(uv_loop_t*, uv_tcp_t* handle, unsigned int flags); UV_EXTERN int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock); UV_EXTERN int uv_tcp_nodelay(uv_tcp_t* handle, int enable); UV_EXTERN int uv_tcp_keepalive(uv_tcp_t* handle, @@ -594,6 +603,7 @@ struct uv_udp_send_s { }; UV_EXTERN int uv_udp_init(uv_loop_t*, uv_udp_t* handle); +UV_EXTERN int uv_udp_init_ex(uv_loop_t*, uv_udp_t* handle, unsigned int flags); UV_EXTERN int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock); UV_EXTERN int uv_udp_bind(uv_udp_t* handle, const struct sockaddr* addr, @@ -1078,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. */ @@ -1230,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, @@ -1358,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/libuv.nsi b/deps/uv/libuv.nsi new file mode 100644 index 00000000000000..159756e196ce47 --- /dev/null +++ b/deps/uv/libuv.nsi @@ -0,0 +1,86 @@ +; NSIS installer script for libuv + +!include "MUI2.nsh" + +Name "libuv" +OutFile "libuv-${ARCH}-${VERSION}.exe" + +!include "x64.nsh" +# Default install location, for 32-bit files +InstallDir "$PROGRAMFILES\libuv" + +# Override install and registry locations if this is a 64-bit install. +function .onInit + ${If} ${ARCH} == "x64" + SetRegView 64 + StrCpy $INSTDIR "$PROGRAMFILES64\libuv" + ${EndIf} +functionEnd + +;-------------------------------- +; Installer pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + + +;-------------------------------- +; Uninstaller pages +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +;-------------------------------- +; Languages +!insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +; Installer sections + +Section "Files" SecInstall + SectionIn RO + SetOutPath "$INSTDIR" + File "Release\*.dll" + File "Release\*.lib" + File "LICENSE" + File "README.md" + + SetOutPath "$INSTDIR\include" + File "include\uv.h" + File "include\uv-errno.h" + File "include\uv-threadpool.h" + File "include\uv-version.h" + File "include\uv-win.h" + File "include\tree.h" + + WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "DisplayName" "libuv-${ARCH}-${VERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "QuietUninstallString" "$\"$INSTDIR\Uninstall.exe$\" /S" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "HelpLink" "http://libuv.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "URLInfoAbout" "http://libuv.org/" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "DisplayVersion" "${VERSION}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "NoModify" "1" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" "NoRepair" "1" +SectionEnd + +Section "Uninstall" + Delete "$INSTDIR\libuv.dll" + Delete "$INSTDIR\libuv.lib" + Delete "$INSTDIR\LICENSE" + Delete "$INSTDIR\README.md" + + Delete "$INSTDIR\include\uv.h" + Delete "$INSTDIR\include\uv-errno.h" + Delete "$INSTDIR\include\uv-threadpool.h" + Delete "$INSTDIR\include\uv-version.h" + Delete "$INSTDIR\include\uv-win.h" + Delete "$INSTDIR\include\tree.h" + + Delete "$INSTDIR\Uninstall.exe" + RMDir "$INSTDIR" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libuv-${ARCH}-${VERSION}" +SectionEnd + 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 fe02b454ead24f..ff3540a0a51c84 100644 --- a/deps/uv/src/queue.h +++ b/deps/uv/src/queue.h @@ -16,6 +16,8 @@ #ifndef QUEUE_H_ #define QUEUE_H_ +#include + typedef void *QUEUE[2]; /* Private macros. */ @@ -26,8 +28,11 @@ typedef void *QUEUE[2]; /* Public macros. */ #define QUEUE_DATA(ptr, type, field) \ - ((type *) ((char *) (ptr) - ((char *) &((type *) 0)->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)) @@ -64,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 debaf5ca965847..2c5152b4200875 100644 --- a/deps/uv/src/threadpool.c +++ b/deps/uv/src/threadpool.c @@ -44,6 +44,7 @@ static void uv__req_init(uv_loop_t* loop, static uv_once_t once = UV_ONCE_INIT; static uv_cond_t cond; static uv_mutex_t mutex; +static unsigned int idle_threads; static unsigned int nthreads; static uv_thread_t* threads; static uv_thread_t default_threads[4]; @@ -69,8 +70,11 @@ static void worker(void* arg) { for (;;) { uv_mutex_lock(&mutex); - while (QUEUE_EMPTY(&wq)) + while (QUEUE_EMPTY(&wq)) { + idle_threads += 1; uv_cond_wait(&cond, &mutex); + idle_threads -= 1; + } q = QUEUE_HEAD(&wq); @@ -103,7 +107,8 @@ static void worker(void* arg) { static void post(QUEUE* q) { uv_mutex_lock(&mutex); QUEUE_INSERT_TAIL(&wq, q); - uv_cond_signal(&cond); + if (idle_threads > 0) + uv_cond_signal(&cond); uv_mutex_unlock(&mutex); } @@ -218,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/aix.c b/deps/uv/src/unix/aix.c index a2b0744a04729d..c90b7e5cb9ba0c 100644 --- a/deps/uv/src/unix/aix.c +++ b/deps/uv/src/unix/aix.c @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -288,182 +289,80 @@ uint64_t uv__hrtime(uv_clocktype_t type) { * and use it in conjunction with PATH environment variable to craft one. */ int uv_exepath(char* buffer, size_t* size) { - ssize_t res; - char cwd[PATH_MAX], cwdl[PATH_MAX]; - char symlink[PATH_MAX], temp_buffer[PATH_MAX]; - char pp[64]; - struct psinfo ps; - int fd; - char **argv; + int res; + char args[PATH_MAX]; + char abspath[PATH_MAX]; + size_t abspath_size; + struct procsinfo pi; if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; - snprintf(pp, sizeof(pp), "/proc/%lu/psinfo", (unsigned long) getpid()); - - fd = open(pp, O_RDONLY); - if (fd < 0) - return fd; - - res = read(fd, &ps, sizeof(ps)); - uv__close(fd); - if (res < 0) - return res; - - if (ps.pr_argv == 0) - return -EINVAL; - - argv = (char **) *((char ***) (intptr_t) ps.pr_argv); - - if ((argv == NULL) || (argv[0] == NULL)) + pi.pi_pid = getpid(); + res = getargs(&pi, sizeof(pi), args, sizeof(args)); + if (res < 0) return -EINVAL; /* - * Three possibilities for argv[0]: + * Possibilities for args: * i) an absolute path such as: /home/user/myprojects/nodejs/node - * ii) a relative path such as: ./node or ./myprojects/nodejs/node + * ii) a relative path such as: ./node or ../myprojects/nodejs/node * iii) a bare filename such as "node", after exporting PATH variable * to its location. */ - /* case #1, absolute path. */ - if (argv[0][0] == '/') { - snprintf(symlink, PATH_MAX-1, "%s", argv[0]); - - /* This could or could not be a symlink. */ - res = readlink(symlink, temp_buffer, PATH_MAX-1); - - /* if readlink fails, it is a normal file just copy symlink to the - * output buffer. - */ - if (res < 0) { - assert(*size > strlen(symlink)); - strcpy(buffer, symlink); - - /* If it is a link, the resolved filename is again a relative path, - * make it absolute. - */ - } else { - assert(*size > (strlen(symlink) + 1 + strlen(temp_buffer))); - snprintf(buffer, *size-1, "%s/%s", dirname(symlink), temp_buffer); - } - *size = strlen(buffer); - return 0; - - /* case #2, relative path with usage of '.' */ - } else if (argv[0][0] == '.') { - char *relative = strchr(argv[0], '/'); - if (relative == NULL) - return -EINVAL; - - /* Get the current working directory to resolve the relative path. */ - snprintf(cwd, PATH_MAX-1, "/proc/%lu/cwd", (unsigned long) getpid()); - - /* This is always a symlink, resolve it. */ - res = readlink(cwd, cwdl, sizeof(cwdl) - 1); - if (res < 0) + /* Case i) and ii) absolute or relative paths */ + if (strchr(args, '/') != NULL) { + if (realpath(args, abspath) != abspath) return -errno; - snprintf(symlink, PATH_MAX-1, "%s%s", cwdl, relative + 1); - - res = readlink(symlink, temp_buffer, PATH_MAX-1); - if (res < 0) { - assert(*size > strlen(symlink)); - strcpy(buffer, symlink); - } else { - assert(*size > (strlen(symlink) + 1 + strlen(temp_buffer))); - snprintf(buffer, *size-1, "%s/%s", dirname(symlink), temp_buffer); - } - *size = strlen(buffer); - return 0; - - /* case #3, relative path without usage of '.', such as invocations in Node test suite. */ - } else if (strchr(argv[0], '/') != NULL) { - /* Get the current working directory to resolve the relative path. */ - snprintf(cwd, PATH_MAX-1, "/proc/%lu/cwd", (unsigned long) getpid()); + abspath_size = strlen(abspath); - /* This is always a symlink, resolve it. */ - res = readlink(cwd, cwdl, sizeof(cwdl) - 1); - if (res < 0) - return -errno; + *size -= 1; + if (*size > abspath_size) + *size = abspath_size; - snprintf(symlink, PATH_MAX-1, "%s%s", cwdl, argv[0]); + memcpy(buffer, abspath, *size); + buffer[*size] = '\0'; - res = readlink(symlink, temp_buffer, PATH_MAX-1); - if (res < 0) { - assert(*size > strlen(symlink)); - strcpy(buffer, symlink); - } else { - assert(*size > (strlen(symlink) + 1 + strlen(temp_buffer))); - snprintf(buffer, *size-1, "%s/%s", dirname(symlink), temp_buffer); - } - *size = strlen(buffer); return 0; - /* Usage of absolute filename with location exported in PATH */ } else { - char clonedpath[8192]; /* assume 8k buffer will fit PATH */ + /* Case iii). Search PATH environment variable */ + char trypath[PATH_MAX]; + char *clonedpath = NULL; char *token = NULL; - struct stat statstruct; - - /* Get the paths. */ char *path = getenv("PATH"); - if(sizeof(clonedpath) <= strlen(path)) + + if (path == NULL) return -EINVAL; - /* Get a local copy. */ - strcpy(clonedpath, path); + clonedpath = uv__strdup(path); + if (clonedpath == NULL) + return -ENOMEM; - /* Tokenize. */ token = strtok(clonedpath, ":"); + while (token != NULL) { + snprintf(trypath, sizeof(trypath) - 1, "%s/%s", token, args); + if (realpath(trypath, abspath) == abspath) { + /* Check the match is executable */ + if (access(abspath, X_OK) == 0) { + abspath_size = strlen(abspath); - /* Get current working directory. (may be required in the loop). */ - snprintf(cwd, PATH_MAX-1, "/proc/%lu/cwd", (unsigned long) getpid()); - res = readlink(cwd, cwdl, sizeof(cwdl) - 1); - if (res < 0) - return -errno; - /* Run through the tokens, append our executable file name with each, - * and see which one succeeds. Exit on first match. */ - while(token != NULL) { - if (token[0] == '.') { - /* Path contains a token relative to current directory. */ - char *relative = strchr(token, '/'); - if (relative != NULL) - /* A path which is not current directory. */ - snprintf(symlink, PATH_MAX-1, "%s%s/%s", cwdl, relative+1, ps.pr_fname); - else - snprintf(symlink, PATH_MAX-1, "%s%s", cwdl, ps.pr_fname); - if (stat(symlink, &statstruct) != -1) { - /* File exists. Resolve if it is a link. */ - res = readlink(symlink, temp_buffer, PATH_MAX-1); - if (res < 0) { - assert(*size > strlen(symlink)); - strcpy(buffer, symlink); - } else { - assert(*size > (strlen(symlink) + 1 + strlen(temp_buffer))); - snprintf(buffer, *size-1, "%s/%s", dirname(symlink), temp_buffer); - } - *size = strlen(buffer); - return 0; - } + *size -= 1; + if (*size > abspath_size) + *size = abspath_size; - /* Absolute path names. */ - } else { - snprintf(symlink, PATH_MAX-1, "%s/%s", token, ps.pr_fname); - if (stat(symlink, &statstruct) != -1) { - res = readlink(symlink, temp_buffer, PATH_MAX-1); - if (res < 0) { - assert(*size > strlen(symlink)); - strcpy(buffer, symlink); - } else { - assert(*size > (strlen(symlink) + 1 + strlen(temp_buffer))); - snprintf(buffer, *size-1, "%s/%s", dirname(symlink), temp_buffer); - } - *size = strlen(buffer); + memcpy(buffer, abspath, *size); + buffer[*size] = '\0'; + + uv__free(clonedpath); return 0; } } token = strtok(NULL, ":"); } + uv__free(clonedpath); + /* Out of tokens (path entries), and no match found */ return -EINVAL; } 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 7e4e64beda101d..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)); @@ -33,6 +38,10 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) { : "r" (newval), "0" (oldval) : "memory"); return out; +#elif defined(_AIX) && defined(__xlC__) + const int out = (*(volatile int*) ptr); + __compare_and_swap(ptr, &oldval, newval); + return out; #else return __sync_val_compare_and_swap(ptr, oldval, newval); #endif @@ -46,6 +55,14 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) { : "r" (newval), "0" (oldval) : "memory"); return out; +#elif defined(_AIX) && defined(__xlC__) + const long out = (*(volatile int*) ptr); +# if defined(__64BIT__) + __compare_and_swaplp(ptr, &oldval, newval); +# else + __compare_and_swap(ptr, &oldval, newval); +# endif /* if defined(__64BIT__) */ + return out; #else return __sync_val_compare_and_swap(ptr, oldval, newval); #endif diff --git a/deps/uv/src/unix/core.c b/deps/uv/src/unix/core.c index 826b4113b2a1f4..cedd86ed34a128 100644 --- a/deps/uv/src/unix/core.c +++ b/deps/uv/src/unix/core.c @@ -35,7 +35,7 @@ #include #include #include -#include /* INT_MAX, PATH_MAX */ +#include /* INT_MAX, PATH_MAX, IOV_MAX */ #include /* writev */ #include /* getrusage */ #include @@ -55,13 +55,13 @@ # include #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__DragonFly__) # include # include # include # include # define UV__O_CLOEXEC O_CLOEXEC -# if __FreeBSD__ >= 10 +# if defined(__FreeBSD__) && __FreeBSD__ >= 10 # define uv__accept4 accept4 # define UV__SOCK_NONBLOCK SOCK_NONBLOCK # define UV__SOCK_CLOEXEC SOCK_CLOEXEC @@ -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. */ @@ -199,6 +203,25 @@ void uv__make_close_pending(uv_handle_t* handle) { handle->loop->closing_handles = handle; } +int uv__getiovmax(void) { +#if defined(IOV_MAX) + return IOV_MAX; +#elif defined(_SC_IOV_MAX) + static int 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; +#endif +} + static void uv__finish_close(uv_handle_t* handle) { /* Note: while the handle is in the UV_CLOSING state now, it's still possible @@ -477,7 +500,7 @@ int uv__close(int fd) { #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \ - defined(_AIX) + defined(_AIX) || defined(__DragonFly__) int uv__nonblock(int fd, int set) { int r; @@ -506,7 +529,8 @@ int uv__cloexec(int fd, int set) { return 0; } -#else /* !(defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) */ +#else /* !(defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \ + defined(_AIX) || defined(__DragonFly__)) */ int uv__nonblock(int fd, int set) { int flags; @@ -569,7 +593,8 @@ int uv__cloexec(int fd, int set) { return 0; } -#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) */ +#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) || \ + defined(_AIX) || defined(__DragonFly__) */ /* This function is not execve-safe, there is a race window @@ -706,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); @@ -907,7 +930,8 @@ int uv__open_cloexec(const char* path, int flags) { int err; int fd; -#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 9) +#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ >= 9) || \ + defined(__DragonFly__) static int no_cloexec; if (!no_cloexec) { @@ -940,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) @@ -960,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) @@ -974,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) @@ -1002,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; @@ -1023,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 718a81e4c1f998..cf95da21693b9a 100644 --- a/deps/uv/src/unix/darwin.c +++ b/deps/uv/src/unix/darwin.c @@ -199,8 +199,10 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) { } *cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos)); - if (!(*cpu_infos)) - return -ENOMEM; /* FIXME(bnoordhuis) Deallocate info? */ + if (!(*cpu_infos)) { + vm_deallocate(mach_task_self(), (vm_address_t)info, msg_type); + return -ENOMEM; + } *count = numcpus; @@ -256,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 44976f7fe2a3a4..b747abdf5bc46e 100644 --- a/deps/uv/src/unix/freebsd.c +++ b/deps/uv/src/unix/freebsd.c @@ -74,6 +74,30 @@ uint64_t uv__hrtime(uv_clocktype_t type) { } +#ifdef __DragonFly__ +int uv_exepath(char* buffer, size_t* size) { + char abspath[PATH_MAX * 2 + 1]; + ssize_t abspath_size; + + if (buffer == NULL || size == NULL || *size == 0) + return -EINVAL; + + abspath_size = readlink("/proc/curproc/file", abspath, sizeof(abspath)); + if (abspath_size < 0) + return -errno; + + assert(abspath_size > 0); + *size -= 1; + + if (*size > abspath_size) + *size = abspath_size; + + memcpy(buffer, abspath, *size); + buffer[*size] = '\0'; + + return 0; +} +#else int uv_exepath(char* buffer, size_t* size) { char abspath[PATH_MAX * 2 + 1]; int mib[4]; @@ -82,19 +106,12 @@ int uv_exepath(char* buffer, size_t* size) { if (buffer == NULL || size == NULL || *size == 0) return -EINVAL; -#ifdef __DragonFly__ - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_ARGS; - mib[3] = getpid(); -#else mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PATHNAME; mib[3] = -1; -#endif - abspath_size = sizeof abspath;; + abspath_size = sizeof abspath; if (sysctl(mib, 4, abspath, &abspath_size, NULL, 0)) return -errno; @@ -110,7 +127,7 @@ int uv_exepath(char* buffer, size_t* size) { return 0; } - +#endif uint64_t uv_get_free_memory(void) { int freecount; @@ -159,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; @@ -223,17 +240,13 @@ int uv_resident_set_memory(size_t* rss) { int uv_uptime(double* uptime) { - time_t now; - struct timeval info; - size_t size = sizeof(info); - static int which[] = {CTL_KERN, KERN_BOOTTIME}; - - if (sysctl(which, 2, &info, &size, NULL, 0)) + int r; + struct timespec sp; + r = clock_gettime(CLOCK_MONOTONIC, &sp); + if (r) return -errno; - now = time(NULL); - - *uptime = (double)(now - info.tv_sec); + *uptime = sp.tv_sec; return 0; } @@ -360,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 9dab202dd76f8e..57b65be25a85ea 100644 --- a/deps/uv/src/unix/fs.c +++ b/deps/uv/src/unix/fs.c @@ -58,52 +58,67 @@ # include #endif -#define INIT(type) \ +#define INIT(subtype) \ do { \ - uv__req_init((loop), (req), UV_FS); \ - (req)->fs_type = UV_FS_ ## type; \ - (req)->result = 0; \ - (req)->ptr = NULL; \ - (req)->loop = loop; \ - (req)->path = NULL; \ - (req)->new_path = NULL; \ - (req)->cb = (cb); \ + req->type = UV_FS; \ + if (cb != NULL) \ + uv__req_init(loop, req, UV_FS); \ + req->fs_type = UV_FS_ ## subtype; \ + req->result = 0; \ + req->ptr = NULL; \ + req->loop = loop; \ + req->path = NULL; \ + req->new_path = NULL; \ + req->cb = cb; \ } \ while (0) #define PATH \ do { \ - (req)->path = uv__strdup(path); \ - if ((req)->path == NULL) \ - return -ENOMEM; \ + assert(path != NULL); \ + if (cb == NULL) { \ + req->path = path; \ + } else { \ + req->path = uv__strdup(path); \ + if (req->path == NULL) { \ + uv__req_unregister(loop, req); \ + return -ENOMEM; \ + } \ + } \ } \ while (0) #define PATH2 \ do { \ - size_t path_len; \ - size_t new_path_len; \ - 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) \ - 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); \ + if (cb == NULL) { \ + req->path = path; \ + req->new_path = new_path; \ + } else { \ + size_t path_len; \ + size_t new_path_len; \ + 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) { \ + 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); \ + } \ } \ while (0) #define POST \ do { \ - if ((cb) != NULL) { \ - uv__work_submit((loop), &(req)->work_req, uv__fs_work, uv__fs_done); \ + if (cb != NULL) { \ + uv__work_submit(loop, &req->work_req, uv__fs_work, uv__fs_done); \ return 0; \ } \ else { \ - uv__fs_work(&(req)->work_req); \ - uv__fs_done(&(req)->work_req, 0); \ - return (req)->result; \ + uv__fs_work(&req->work_req); \ + return req->result; \ } \ } \ while (0) @@ -309,8 +324,6 @@ static ssize_t uv__fs_read(uv_fs_t* req) { } done: - if (req->bufs != req->bufsml) - uv__free(req->bufs); return result; } @@ -361,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) { @@ -395,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; @@ -545,7 +586,7 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) { return -1; } -#elif defined(__FreeBSD__) || defined(__APPLE__) +#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__DragonFly__) { off_t len; ssize_t r; @@ -555,7 +596,7 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) { * number of bytes have been sent, we don't consider it an error. */ -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__DragonFly__) len = 0; r = sendfile(in_fd, out_fd, req->off, req->bufsml[0].len, NULL, &len, 0); #else @@ -565,7 +606,14 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) { r = sendfile(in_fd, out_fd, req->off, &len, NULL, 0); #endif - if (r != -1 || len != 0) { + /* + * The man page for sendfile(2) on DragonFly states that `len` contains + * a meaningful value ONLY in case of EAGAIN and EINTR. + * Nothing is said about it's value in case of other errors, so better + * not depend on the potential wrong assumption that is was not modified + * by the syscall. + */ + if (r == 0 || ((errno == EAGAIN || errno == EINTR) && len != 0)) { req->off += len; return (ssize_t) len; } @@ -610,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) { @@ -667,12 +717,10 @@ 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 - if (req->bufs != req->bufsml) - uv__free(req->bufs); - return r; } @@ -777,6 +825,47 @@ static int uv__fs_fstat(int fd, uv_stat_t *buf) { } +typedef ssize_t (*uv__fs_buf_iter_processor)(uv_fs_t* req); +static ssize_t uv__fs_buf_iter(uv_fs_t* req, uv__fs_buf_iter_processor process) { + unsigned int iovmax; + unsigned int nbufs; + uv_buf_t* bufs; + ssize_t total; + ssize_t result; + + iovmax = uv__getiovmax(); + nbufs = req->nbufs; + bufs = req->bufs; + total = 0; + + while (nbufs > 0) { + req->nbufs = nbufs; + if (req->nbufs > iovmax) + req->nbufs = iovmax; + + result = process(req); + if (result <= 0) { + if (total == 0) + total = result; + break; + } + + if (req->off >= 0) + req->off += result; + + req->bufs += req->nbufs; + nbufs -= req->nbufs; + total += result; + } + + if (bufs != req->bufsml) + uv__free(bufs); + req->bufs = NULL; + + return total; +} + + static void uv__fs_work(struct uv__work* w) { int retry_on_eintr; uv_fs_t* req; @@ -810,9 +899,10 @@ static void uv__fs_work(struct uv__work* w) { X(MKDIR, mkdir(req->path, req->mode)); X(MKDTEMP, uv__fs_mkdtemp(req)); X(OPEN, uv__fs_open(req)); - X(READ, uv__fs_read(req)); + 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)); @@ -820,7 +910,7 @@ static void uv__fs_work(struct uv__work* w) { X(SYMLINK, symlink(req->path, req->new_path)); X(UNLINK, unlink(req->path)); X(UTIME, uv__fs_utime(req)); - X(WRITE, uv__fs_write(req)); + X(WRITE, uv__fs_buf_iter(req, uv__fs_write)); default: abort(); } #undef X @@ -850,8 +940,7 @@ static void uv__fs_done(struct uv__work* w, int status) { req->result = -ECANCELED; } - if (req->cb != NULL) - req->cb(req); + req->cb(req); } @@ -1009,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; } @@ -1035,6 +1127,9 @@ int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, unsigned int nbufs, int64_t off, uv_fs_cb cb) { + if (bufs == NULL || nbufs == 0) + return -EINVAL; + INIT(READ); req->file = file; @@ -1043,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)); @@ -1075,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, @@ -1157,6 +1265,9 @@ int uv_fs_write(uv_loop_t* loop, unsigned int nbufs, int64_t off, uv_fs_cb cb) { + if (bufs == NULL || nbufs == 0) + return -EINVAL; + INIT(WRITE); req->file = file; @@ -1165,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)); @@ -1176,7 +1290,14 @@ int uv_fs_write(uv_loop_t* loop, void uv_fs_req_cleanup(uv_fs_t* req) { - uv__free((void*)req->path); + /* Only necessary for asychronous requests, i.e., requests with a callback. + * Synchronous ones don't copy their arguments and have req->path and + * req->new_path pointing to user-owned memory. UV_FS_MKDTEMP is the + * exception to the rule, it always allocates memory. + */ + if (req->path != NULL && (req->cb != NULL || req->fs_type == UV_FS_MKDTEMP)) + uv__free((void*) req->path); /* Memory is shared with req->new_path. */ + req->path = NULL; req->new_path = NULL; 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/internal.h b/deps/uv/src/unix/internal.h index c31e54992d3e4f..741fa57d69cad3 100644 --- a/deps/uv/src/unix/internal.h +++ b/deps/uv/src/unix/internal.h @@ -172,6 +172,7 @@ int uv__socket(int domain, int type, int protocol); int uv__dup(int fd); ssize_t uv__recvmsg(int fd, struct msghdr *msg, int flags); void uv__make_close_pending(uv_handle_t* handle); +int uv__getiovmax(void); void uv__io_init(uv__io_t* w, uv__io_cb cb, int fd); void uv__io_start(uv_loop_t* loop, uv__io_t* w, unsigned int events); diff --git a/deps/uv/src/unix/kqueue.c b/deps/uv/src/unix/kqueue.c index 424236a6ef5937..495f20d285fa30 100644 --- a/deps/uv/src/unix/kqueue.c +++ b/deps/uv/src/unix/kqueue.c @@ -379,6 +379,10 @@ int uv_fs_event_start(uv_fs_event_t* handle, if (!(statbuf.st_mode & S_IFDIR)) goto fallback; + /* The fallback fd is no longer needed */ + uv__close(fd); + handle->event_watcher.fd = -1; + return uv__fsevents_init(handle); fallback: @@ -406,8 +410,12 @@ int uv_fs_event_stop(uv_fs_event_t* handle) { uv__free(handle->path); handle->path = NULL; - uv__close(handle->event_watcher.fd); - handle->event_watcher.fd = -1; + if (handle->event_watcher.fd != -1) { + /* When FSEvents is used, we don't use the event_watcher's fd under certain + * confitions. (see uv_fs_event_start) */ + uv__close(handle->event_watcher.fd); + handle->event_watcher.fd = -1; + } return 0; } 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/loop.c b/deps/uv/src/unix/loop.c index aa9146bf9aa9df..92e96f09ed0100 100644 --- a/deps/uv/src/unix/loop.c +++ b/deps/uv/src/unix/loop.c @@ -63,24 +63,44 @@ int uv_loop_init(uv_loop_t* loop) { if (err) return err; - uv_signal_init(loop, &loop->child_watcher); + err = uv_signal_init(loop, &loop->child_watcher); + if (err) + goto fail_signal_init; + uv__handle_unref(&loop->child_watcher); loop->child_watcher.flags |= UV__HANDLE_INTERNAL; QUEUE_INIT(&loop->process_handles); - if (uv_rwlock_init(&loop->cloexec_lock)) - abort(); + err = uv_rwlock_init(&loop->cloexec_lock); + if (err) + goto fail_rwlock_init; - if (uv_mutex_init(&loop->wq_mutex)) - abort(); + err = uv_mutex_init(&loop->wq_mutex); + if (err) + goto fail_mutex_init; - if (uv_async_init(loop, &loop->wq_async, uv__work_done)) - abort(); + err = uv_async_init(loop, &loop->wq_async, uv__work_done); + if (err) + goto fail_async_init; uv__handle_unref(&loop->wq_async); loop->wq_async.flags |= UV__HANDLE_INTERNAL; return 0; + +fail_async_init: + uv_mutex_destroy(&loop->wq_mutex); + +fail_mutex_init: + uv_rwlock_destroy(&loop->cloexec_lock); + +fail_rwlock_init: + uv__signal_loop_cleanup(loop); + +fail_signal_init: + uv__platform_loop_delete(loop); + + return err; } 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 f2a83753ee3a88..571f8cd778c74f 100644 --- a/deps/uv/src/unix/process.c +++ b/deps/uv/src/unix/process.c @@ -226,13 +226,14 @@ static int uv__process_open_stream(uv_stdio_container_t* container, int pipefds[2], int writable) { int flags; + int err; if (!(container->flags & UV_CREATE_PIPE) || pipefds[0] < 0) return 0; - if (uv__close(pipefds[1])) - if (errno != EINTR && errno != EINPROGRESS) - abort(); + err = uv__close(pipefds[1]); + if (err != 0 && err != -EINPROGRESS) + abort(); pipefds[1] = -1; uv__nonblock(pipefds[0], 1); @@ -269,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], @@ -374,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; @@ -527,6 +538,7 @@ int uv_spawn(uv_loop_t* loop, } return err; +#endif } diff --git a/deps/uv/src/unix/pthread-fixes.c b/deps/uv/src/unix/pthread-fixes.c index dc54f35d60af18..3a71eb5aae743f 100644 --- a/deps/uv/src/unix/pthread-fixes.c +++ b/deps/uv/src/unix/pthread-fixes.c @@ -35,6 +35,7 @@ * */ #include #include +#include int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset) { static int workaround; 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 7ad1658cf8d65e..7d7ab2633b6f2d 100644 --- a/deps/uv/src/unix/stream.c +++ b/deps/uv/src/unix/stream.c @@ -391,6 +391,9 @@ int uv__stream_open(uv_stream_t* stream, int fd, int flags) { int enable; #endif + if (!(stream->io_watcher.fd == -1 || stream->io_watcher.fd == fd)) + return -EBUSY; + assert(fd >= 0); stream->flags |= flags; @@ -736,19 +739,6 @@ static int uv__handle_fd(uv_handle_t* handle) { } } -static int uv__getiovmax() { -#if defined(IOV_MAX) - return IOV_MAX; -#elif defined(_SC_IOV_MAX) - static int iovmax = -1; - if (iovmax == -1) - iovmax = sysconf(_SC_IOV_MAX); - return iovmax; -#else - return 1024; -#endif -} - static void uv__write(uv_stream_t* stream) { struct iovec* iov; QUEUE* q; @@ -789,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); @@ -819,7 +809,17 @@ static void uv__write(uv_stream_t* stream) { do { n = sendmsg(uv__stream_fd(stream), &msg, 0); } +#if defined(__APPLE__) + /* + * Due to a possible kernel bug at least in OS X 10.10 "Yosemite", + * EPROTOTYPE can be returned while trying to write to a socket that is + * shutting down. If we retry the write, we should get the expected EPIPE + * instead. + */ + while (n == -1 && (errno == EINTR || errno == EPROTOTYPE)); +#else while (n == -1 && errno == EINTR); +#endif } else { do { if (iovcnt == 1) { @@ -828,7 +828,17 @@ static void uv__write(uv_stream_t* stream) { n = writev(uv__stream_fd(stream), iov, iovcnt); } } +#if defined(__APPLE__) + /* + * Due to a possible kernel bug at least in OS X 10.10 "Yosemite", + * EPROTOTYPE can be returned while trying to write to a socket that is + * shutting down. If we retry the write, we should get the expected EPIPE + * instead. + */ + while (n == -1 && (errno == EINTR || errno == EPROTOTYPE)); +#else while (n == -1 && errno == EINTR); +#endif } if (n < 0) { @@ -1461,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/tcp.c b/deps/uv/src/unix/tcp.c index 4060e7bd7094e8..6d213a497787d8 100644 --- a/deps/uv/src/unix/tcp.c +++ b/deps/uv/src/unix/tcp.c @@ -28,18 +28,14 @@ #include -int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* tcp) { - uv__stream_init(loop, (uv_stream_t*)tcp, UV_TCP); - return 0; -} - - static int maybe_new_socket(uv_tcp_t* handle, int domain, int flags) { int sockfd; int err; - if (uv__stream_fd(handle) != -1) + if (domain == AF_UNSPEC || uv__stream_fd(handle) != -1) { + handle->flags |= flags; return 0; + } err = uv__socket(domain, SOCK_STREAM, 0); if (err < 0) @@ -56,6 +52,40 @@ static int maybe_new_socket(uv_tcp_t* handle, int domain, int flags) { } +int uv_tcp_init_ex(uv_loop_t* loop, uv_tcp_t* tcp, unsigned int flags) { + int domain; + + /* Use the lower 8 bits for the domain */ + domain = flags & 0xFF; + if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC) + return -EINVAL; + + if (flags & ~0xFF) + return -EINVAL; + + uv__stream_init(loop, (uv_stream_t*)tcp, UV_TCP); + + /* If anything fails beyond this point we need to remove the handle from + * the handle queue, since it was added by uv__handle_init in uv_stream_init. + */ + + if (domain != AF_UNSPEC) { + int err = maybe_new_socket(tcp, domain, 0); + if (err) { + QUEUE_REMOVE(&tcp->handle_queue); + return err; + } + } + + return 0; +} + + +int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* tcp) { + return uv_tcp_init_ex(loop, tcp, AF_UNSPEC); +} + + int uv__tcp_bind(uv_tcp_t* tcp, const struct sockaddr* addr, unsigned int addrlen, @@ -91,8 +121,13 @@ int uv__tcp_bind(uv_tcp_t* tcp, #endif errno = 0; - if (bind(tcp->io_watcher.fd, addr, addrlen) && errno != EADDRINUSE) + if (bind(tcp->io_watcher.fd, addr, addrlen) && errno != EADDRINUSE) { + if (errno == EAFNOSUPPORT) + /* OSX, other BSDs and SunoS fail with EAFNOSUPPORT when binding a + * socket created with AF_INET to an AF_INET6 address or vice versa. */ + return -EINVAL; return -errno; + } tcp->delayed_error = -errno; if (addr->sa_family == AF_INET6) diff --git a/deps/uv/src/unix/thread.c b/deps/uv/src/unix/thread.c index 6080cf5f73cb4b..c56a3170259e90 100644 --- a/deps/uv/src/unix/thread.c +++ b/deps/uv/src/unix/thread.c @@ -124,14 +124,14 @@ void uv_mutex_lock(uv_mutex_t* mutex) { int uv_mutex_trylock(uv_mutex_t* mutex) { int err; - /* FIXME(bnoordhuis) EAGAIN means recursive lock limit reached. Arguably - * a bug, should probably abort rather than return -EAGAIN. - */ err = pthread_mutex_trylock(mutex); - if (err && err != EBUSY && err != EAGAIN) - abort(); + if (err) { + if (err != EBUSY && err != EAGAIN) + abort(); + return -EBUSY; + } - return -err; + return 0; } @@ -162,10 +162,13 @@ int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock) { int err; err = pthread_rwlock_tryrdlock(rwlock); - if (err && err != EBUSY && err != EAGAIN) - abort(); + if (err) { + if (err != EBUSY && err != EAGAIN) + abort(); + return -EBUSY; + } - return -err; + return 0; } @@ -185,10 +188,13 @@ int uv_rwlock_trywrlock(uv_rwlock_t* rwlock) { int err; err = pthread_rwlock_trywrlock(rwlock); - if (err && err != EBUSY && err != EAGAIN) - abort(); + if (err) { + if (err != EBUSY && err != EAGAIN) + abort(); + return -EBUSY; + } - return -err; + return 0; } diff --git a/deps/uv/src/unix/tty.c b/deps/uv/src/unix/tty.c index 7783548a6e987d..7cc5b714ed302c 100644 --- a/deps/uv/src/unix/tty.c +++ b/deps/uv/src/unix/tty.c @@ -51,8 +51,6 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) { flags = 0; newfd = -1; - uv__stream_init(loop, (uv_stream_t*) tty, UV_TTY); - /* Reopen the file descriptor when it refers to a tty. This lets us put the * tty in non-blocking mode without affecting other processes that share it * with us. @@ -89,11 +87,18 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, int fd, int readable) { } skip: + uv__stream_init(loop, (uv_stream_t*) tty, UV_TTY); + + /* If anything fails beyond this point we need to remove the handle from + * the handle queue, since it was added by uv__handle_init in uv_stream_init. + */ + #if defined(__APPLE__) r = uv__stream_try_select((uv_stream_t*) tty, &fd); if (r) { if (newfd != -1) uv__close(newfd); + QUEUE_REMOVE(&tty->handle_queue); return r; } #endif @@ -231,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 f85ab1473a944f..39ade8de338afc 100644 --- a/deps/uv/src/unix/udp.c +++ b/deps/uv/src/unix/udp.c @@ -321,6 +321,10 @@ int uv__udp_bind(uv_udp_t* handle, if (bind(fd, addr, addrlen)) { err = -errno; + if (errno == EAFNOSUPPORT) + /* OSX, other BSDs and SunoS fail with EAFNOSUPPORT when binding a + * socket created with AF_INET to an AF_INET6 address or vice versa. */ + err = -EINVAL; goto out; } @@ -406,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); @@ -551,25 +557,51 @@ static int uv__udp_set_membership6(uv_udp_t* handle, } -int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) { +int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) { + int domain; + int err; + int fd; + + /* Use the lower 8 bits for the domain */ + domain = flags & 0xFF; + if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC) + return -EINVAL; + + if (flags & ~0xFF) + return -EINVAL; + + if (domain != AF_UNSPEC) { + err = uv__socket(domain, SOCK_DGRAM, 0); + if (err < 0) + return err; + fd = err; + } else { + fd = -1; + } + uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP); handle->alloc_cb = NULL; handle->recv_cb = NULL; handle->send_queue_size = 0; handle->send_queue_count = 0; - uv__io_init(&handle->io_watcher, uv__udp_io, -1); + uv__io_init(&handle->io_watcher, uv__udp_io, fd); QUEUE_INIT(&handle->write_queue); QUEUE_INIT(&handle->write_completed_queue); return 0; } +int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) { + return uv_udp_init_ex(loop, handle, AF_UNSPEC); +} + + int uv_udp_open(uv_udp_t* handle, uv_os_sock_t sock) { int err; /* Check for already active socket. */ if (handle->io_watcher.fd != -1) - return -EALREADY; /* FIXME(bnoordhuis) Should be -EBUSY. */ + return -EBUSY; err = uv__nonblock(sock, 1); if (err) @@ -638,6 +670,8 @@ static int uv__setsockopt_maybe_char(uv_udp_t* handle, int val) { #if defined(__sun) || defined(_AIX) char arg = val; +#elif defined(__OpenBSD__) + unsigned char arg = val; #else int arg = val; #endif @@ -672,13 +706,13 @@ int uv_udp_set_ttl(uv_udp_t* handle, int ttl) { * so hardcode the size of these options on this platform, * and use the general uv__setsockopt_maybe_char call on other platforms. */ -#if defined(__sun) || defined(_AIX) +#if defined(__sun) || defined(_AIX) || defined(__OpenBSD__) return uv__setsockopt(handle, IP_TTL, IPV6_UNICAST_HOPS, &ttl, sizeof(ttl)); -#endif /* defined(__sun) || defined(_AIX) */ +#endif /* defined(__sun) || defined(_AIX) || defined (__OpenBSD__) */ return uv__setsockopt_maybe_char(handle, IP_TTL, diff --git a/deps/uv/src/uv-common.c b/deps/uv/src/uv-common.c index 77879b9a6c1686..40ed28fec5a662 100644 --- a/deps/uv/src/uv-common.c +++ b/deps/uv/src/uv-common.c @@ -29,7 +29,9 @@ #include /* malloc */ #include /* memset */ -#if !defined(_WIN32) +#if defined(_WIN32) +# include /* malloc */ +#else # include /* if_nametoindex */ #endif @@ -135,14 +137,23 @@ uv_buf_t uv_buf_init(char* base, unsigned int len) { } +static const char* uv__unknown_err_code(int err) { + char buf[32]; + char* copy; + + snprintf(buf, sizeof(buf), "Unknown system error %d", err); + copy = uv__strdup(buf); + + return copy != NULL ? copy : "Unknown system error"; +} + + #define UV_ERR_NAME_GEN(name, _) case UV_ ## name: return #name; const char* uv_err_name(int err) { switch (err) { UV_ERRNO_MAP(UV_ERR_NAME_GEN) - default: - assert(0); - return NULL; } + return uv__unknown_err_code(err); } #undef UV_ERR_NAME_GEN @@ -151,9 +162,8 @@ const char* uv_err_name(int err) { const char* uv_strerror(int err) { switch (err) { UV_ERRNO_MAP(UV_STRERROR_GEN) - default: - return "Unknown system error"; } + return uv__unknown_err_code(err); } #undef UV_STRERROR_GEN @@ -327,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; @@ -360,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)], @@ -371,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 8258d7a1387d26..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) \ @@ -196,7 +200,7 @@ void uv__fs_scandir_cleanup(uv_fs_t* req); (((h)->flags & UV__HANDLE_REF) != 0) #if defined(_WIN32) -# define uv__handle_platform_init(h) +# define uv__handle_platform_init(h) ((h)->u.fd = -1) #else # define uv__handle_platform_init(h) ((h)->next_closing = NULL) #endif diff --git a/deps/uv/src/version.c b/deps/uv/src/version.c index ff91a460904e6e..686dedd98d6854 100644 --- a/deps/uv/src/version.c +++ b/deps/uv/src/version.c @@ -21,10 +21,6 @@ #include "uv.h" -#define UV_VERSION ((UV_VERSION_MAJOR << 16) | \ - (UV_VERSION_MINOR << 8) | \ - (UV_VERSION_PATCH)) - #define UV_STRINGIFY(v) UV_STRINGIFY_HELPER(v) #define UV_STRINGIFY_HELPER(v) #v @@ -40,7 +36,7 @@ unsigned int uv_version(void) { - return UV_VERSION; + return UV_VERSION_HEX; } diff --git a/deps/uv/src/win/core.c b/deps/uv/src/win/core.c index 115449224f9651..de0483e1023017 100644 --- a/deps/uv/src/win/core.c +++ b/deps/uv/src/win/core.c @@ -124,6 +124,8 @@ static void uv_init(void) { int uv_loop_init(uv_loop_t* loop) { + int err; + /* Initialize libuv itself first */ uv__once_init(); @@ -165,16 +167,27 @@ int uv_loop_init(uv_loop_t* loop) { loop->timer_counter = 0; loop->stop_flag = 0; - if (uv_mutex_init(&loop->wq_mutex)) - abort(); + err = uv_mutex_init(&loop->wq_mutex); + if (err) + goto fail_mutex_init; - if (uv_async_init(loop, &loop->wq_async, uv__work_done)) - abort(); + err = uv_async_init(loop, &loop->wq_async, uv__work_done); + if (err) + goto fail_async_init; uv__handle_unref(&loop->wq_async); loop->wq_async.flags |= UV__HANDLE_INTERNAL; return 0; + +fail_async_init: + uv_mutex_destroy(&loop->wq_mutex); + +fail_mutex_init: + CloseHandle(loop->iocp); + loop->iocp = INVALID_HANDLE_VALUE; + + return err; } 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 eb205d3921d797..76ecfebaa24c39 100644 --- a/deps/uv/src/win/fs-event.c +++ b/deps/uv/src/win/fs-event.c @@ -43,7 +43,7 @@ static void uv_fs_event_queue_readdirchanges(uv_loop_t* loop, if (!ReadDirectoryChangesW(handle->dir_handle, handle->buffer, uv_directory_watcher_buffer_size, - FALSE, + (handle->flags & UV_FS_EVENT_RECURSIVE) ? TRUE : FALSE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | @@ -63,6 +63,20 @@ static void uv_fs_event_queue_readdirchanges(uv_loop_t* loop, handle->req_pending = 1; } +static int uv_relative_path(const WCHAR* filename, + const WCHAR* dir, + WCHAR** relpath) { + int dirlen = wcslen(dir); + int filelen = wcslen(filename); + if (dir[dirlen - 1] == '\\') + dirlen--; + *relpath = uv__malloc((MAX_PATH + 1) * sizeof(WCHAR)); + if (!*relpath) + uv_fatal_error(ERROR_OUTOFMEMORY, "uv__malloc"); + wcsncpy(*relpath, filename + dirlen + 1, filelen - dirlen - 1); + (*relpath)[filelen - dirlen - 1] = L'\0'; + return 0; +} static int uv_split_path(const WCHAR* filename, WCHAR** dir, WCHAR** file) { @@ -237,7 +251,7 @@ int uv_fs_event_start(uv_fs_event_t* handle, if (!ReadDirectoryChangesW(handle->dir_handle, handle->buffer, uv_directory_watcher_buffer_size, - FALSE, + (flags & UV_FS_EVENT_RECURSIVE) ? TRUE : FALSE, FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | @@ -367,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) { @@ -410,7 +425,9 @@ void uv_process_fs_event_req(uv_loop_t* loop, uv_req_t* req, if (long_filenamew) { /* Get the file name out of the long path. */ - result = uv_split_path(long_filenamew, NULL, &filenamew); + result = uv_relative_path(long_filenamew, + handle->dirw, + &filenamew); uv__free(long_filenamew); if (result == 0) { @@ -422,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 00d0197a541483..a32b0127f7e1e9 100644 --- a/deps/uv/src/win/fs.c +++ b/deps/uv/src/win/fs.c @@ -110,14 +110,17 @@ 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; } -INLINE static int fs__capture_path(uv_loop_t* loop, uv_fs_t* req, - const char* path, const char* new_path, const int copy_path) { +INLINE static int fs__capture_path(uv_fs_t* req, const char* path, + const char* new_path, const int copy_path) { char* buf; char* pos; ssize_t buf_sz = 0, path_len, pathw_len = 0, new_pathw_len = 0; @@ -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); } @@ -528,8 +535,20 @@ void fs__close(uv_fs_t* req) { VERIFY_FD(fd, req); - result = _close(fd); - SET_REQ_RESULT(req, result); + if (fd > 2) + result = _close(fd); + else + result = 0; + + /* _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; + } } @@ -821,7 +840,11 @@ void fs__scandir(uv_fs_t* req) { * A file name is at most 256 WCHARs long. * According to MSDN, the buffer must be aligned at an 8-byte boundary. */ +#if _MSC_VER __declspec(align(8)) char buffer[8192]; +#else + __attribute__ ((aligned (8))) char buffer[8192]; +#endif STATIC_ASSERT(sizeof buffer >= sizeof(FILE_DIRECTORY_INFORMATION) + 256 * sizeof(WCHAR)); @@ -1691,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; @@ -1735,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: @@ -1754,8 +1856,7 @@ static void uv__fs_done(struct uv__work* w, int status) { req->result = UV_ECANCELED; } - if (req->cb != NULL) - req->cb(req); + req->cb(req); } @@ -1784,7 +1885,7 @@ int uv_fs_open(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_req_init(loop, req, UV_FS_OPEN, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -1823,6 +1924,9 @@ int uv_fs_read(uv_loop_t* loop, unsigned int nbufs, int64_t offset, uv_fs_cb cb) { + if (bufs == NULL || nbufs == 0) + return UV_EINVAL; + uv_fs_req_init(loop, req, UV_FS_READ, cb); req->file.fd = fd; @@ -1856,6 +1960,9 @@ int uv_fs_write(uv_loop_t* loop, unsigned int nbufs, int64_t offset, uv_fs_cb cb) { + if (bufs == NULL || nbufs == 0) + return UV_EINVAL; + uv_fs_req_init(loop, req, UV_FS_WRITE, cb); req->file.fd = fd; @@ -1888,7 +1995,7 @@ int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_req_init(loop, req, UV_FS_UNLINK, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -1909,7 +2016,7 @@ int uv_fs_mkdir(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_req_init(loop, req, UV_FS_MKDIR, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -1932,7 +2039,7 @@ int uv_fs_mkdtemp(uv_loop_t* loop, uv_fs_t* req, const char* tpl, uv_fs_req_init(loop, req, UV_FS_MKDTEMP, cb); - err = fs__capture_path(loop, req, tpl, NULL, TRUE); + err = fs__capture_path(req, tpl, NULL, TRUE); if (err) return uv_translate_sys_error(err); @@ -1951,7 +2058,7 @@ int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { uv_fs_req_init(loop, req, UV_FS_RMDIR, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -1972,7 +2079,7 @@ int uv_fs_scandir(uv_loop_t* loop, uv_fs_t* req, const char* path, int flags, uv_fs_req_init(loop, req, UV_FS_SCANDIR, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -1995,7 +2102,7 @@ int uv_fs_link(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_req_init(loop, req, UV_FS_LINK, cb); - err = fs__capture_path(loop, req, path, new_path, cb != NULL); + err = fs__capture_path(req, path, new_path, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2016,7 +2123,7 @@ int uv_fs_symlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_req_init(loop, req, UV_FS_SYMLINK, cb); - err = fs__capture_path(loop, req, path, new_path, cb != NULL); + err = fs__capture_path(req, path, new_path, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2039,7 +2146,7 @@ int uv_fs_readlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_req_init(loop, req, UV_FS_READLINK, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2054,13 +2161,38 @@ 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; uv_fs_req_init(loop, req, UV_FS_CHOWN, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2094,7 +2226,7 @@ int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { uv_fs_req_init(loop, req, UV_FS_STAT, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2114,7 +2246,7 @@ int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { uv_fs_req_init(loop, req, UV_FS_LSTAT, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2149,7 +2281,7 @@ int uv_fs_rename(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_req_init(loop, req, UV_FS_RENAME, cb); - err = fs__capture_path(loop, req, path, new_path, cb != NULL); + err = fs__capture_path(req, path, new_path, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2238,7 +2370,7 @@ int uv_fs_access(uv_loop_t* loop, uv_fs_req_init(loop, req, UV_FS_ACCESS, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) return uv_translate_sys_error(err); @@ -2260,7 +2392,7 @@ int uv_fs_chmod(uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_req_init(loop, req, UV_FS_CHMOD, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(err); } @@ -2300,7 +2432,7 @@ int uv_fs_utime(uv_loop_t* loop, uv_fs_t* req, const char* path, double atime, uv_fs_req_init(loop, req, UV_FS_UTIME, cb); - err = fs__capture_path(loop, req, path, NULL, cb != NULL); + err = fs__capture_path(req, path, NULL, cb != NULL); if (err) { return uv_translate_sys_error(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 04b2a548ca88cc..783f21af0fe9f1 100644 --- a/deps/uv/src/win/internal.h +++ b/deps/uv/src/win/internal.h @@ -64,7 +64,7 @@ extern UV_THREAD_LOCAL int uv__crt_assert_enabled; /* Used by all handles. */ #define UV_HANDLE_CLOSED 0x00000002 -#define UV_HANDLE_ENDGAME_QUEUED 0x00000004 +#define UV_HANDLE_ENDGAME_QUEUED 0x00000008 /* uv-common.h: #define UV__HANDLE_CLOSING 0x00000001 */ /* uv-common.h: #define UV__HANDLE_ACTIVE 0x00000040 */ @@ -76,7 +76,6 @@ extern UV_THREAD_LOCAL int uv__crt_assert_enabled; #define UV_HANDLE_BOUND 0x00000200 #define UV_HANDLE_LISTENING 0x00000800 #define UV_HANDLE_CONNECTION 0x00001000 -#define UV_HANDLE_CONNECTED 0x00002000 #define UV_HANDLE_READABLE 0x00008000 #define UV_HANDLE_WRITABLE 0x00010000 #define UV_HANDLE_READ_PENDING 0x00020000 @@ -328,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 d232efae3aab5c..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()); } @@ -180,6 +180,18 @@ static HANDLE open_named_pipe(const WCHAR* name, DWORD* duplex_flags) { } +static void close_pipe(uv_pipe_t* pipe) { + assert(pipe->u.fd == -1 || pipe->u.fd > 2); + if (pipe->u.fd == -1) + CloseHandle(pipe->handle); + else + close(pipe->u.fd); + + pipe->u.fd = -1; + pipe->handle = INVALID_HANDLE_VALUE; +} + + int uv_stdio_pipe_server(uv_loop_t* loop, uv_pipe_t* handle, DWORD access, char* name, size_t nameSize) { HANDLE pipeHandle; @@ -233,6 +245,7 @@ int uv_stdio_pipe_server(uv_loop_t* loop, uv_pipe_t* handle, DWORD access, static int uv_set_pipe_handle(uv_loop_t* loop, uv_pipe_t* handle, HANDLE pipeHandle, + int fd, DWORD duplex_flags) { NTSTATUS nt_status; IO_STATUS_BLOCK io_status; @@ -241,6 +254,10 @@ static int uv_set_pipe_handle(uv_loop_t* loop, DWORD current_mode = 0; DWORD err = 0; + if (!(handle->flags & UV_HANDLE_PIPESERVER) && + handle->handle != INVALID_HANDLE_VALUE) + return UV_EBUSY; + if (!SetNamedPipeHandleState(pipeHandle, &mode, NULL, NULL)) { err = GetLastError(); if (err == ERROR_ACCESS_DENIED) { @@ -292,6 +309,7 @@ static int uv_set_pipe_handle(uv_loop_t* loop, } handle->handle = pipeHandle; + handle->u.fd = fd; handle->flags |= duplex_flags; return 0; @@ -454,6 +472,8 @@ void uv_pipe_endgame(uv_loop_t* loop, uv_pipe_t* handle) { void uv_pipe_pending_instances(uv_pipe_t* handle, int count) { + if (handle->flags & UV_HANDLE_BOUND) + return; handle->pipe.serv.pending_instances = count; handle->flags |= UV_HANDLE_PIPESERVER; } @@ -527,6 +547,7 @@ int uv_pipe_bind(uv_pipe_t* handle, const char* name) { if (uv_set_pipe_handle(loop, handle, handle->pipe.serv.accept_reqs[0].pipeHandle, + -1, 0)) { err = GetLastError(); goto error; @@ -580,7 +601,7 @@ static DWORD WINAPI pipe_connect_thread_proc(void* parameter) { } if (pipeHandle != INVALID_HANDLE_VALUE && - !uv_set_pipe_handle(loop, handle, pipeHandle, duplex_flags)) { + !uv_set_pipe_handle(loop, handle, pipeHandle, -1, duplex_flags)) { SET_REQ_SUCCESS(req); } else { SET_REQ_ERROR(req, GetLastError()); @@ -643,6 +664,7 @@ void uv_pipe_connect(uv_connect_t* req, uv_pipe_t* handle, if (uv_set_pipe_handle(loop, (uv_pipe_t*) req->handle, pipeHandle, + -1, duplex_flags)) { err = GetLastError(); goto error; @@ -729,6 +751,7 @@ void uv_pipe_cleanup(uv_loop_t* loop, uv_pipe_t* handle) { handle->pipe.serv.accept_reqs[i].pipeHandle = INVALID_HANDLE_VALUE; } } + handle->handle = INVALID_HANDLE_VALUE; } if (handle->flags & UV_HANDLE_CONNECTION) { @@ -737,11 +760,8 @@ void uv_pipe_cleanup(uv_loop_t* loop, uv_pipe_t* handle) { } if ((handle->flags & UV_HANDLE_CONNECTION) - && handle->handle != INVALID_HANDLE_VALUE) { - CloseHandle(handle->handle); - handle->handle = INVALID_HANDLE_VALUE; - } - + && handle->handle != INVALID_HANDLE_VALUE) + close_pipe(handle); } @@ -786,7 +806,7 @@ static void uv_pipe_queue_accept(uv_loop_t* loop, uv_pipe_t* handle, return; } - if (uv_set_pipe_handle(loop, handle, req->pipeHandle, 0)) { + if (uv_set_pipe_handle(loop, handle, req->pipeHandle, -1, 0)) { CloseHandle(req->pipeHandle); req->pipeHandle = INVALID_HANDLE_VALUE; SET_REQ_ERROR(req, GetLastError()); @@ -1226,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) { @@ -1609,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 */ @@ -1770,8 +1794,7 @@ void uv_process_pipe_shutdown_req(uv_loop_t* loop, uv_pipe_t* handle, } else { /* This pipe is not readable. We can just close it to let the other end */ /* know that we're done writing. */ - CloseHandle(handle->handle); - handle->handle = INVALID_HANDLE_VALUE; + close_pipe(handle); } if (req->cb) { @@ -1838,8 +1861,7 @@ static void eof_timer_cb(uv_timer_t* timer) { } /* Force both ends off the pipe. */ - CloseHandle(pipe->handle); - pipe->handle = INVALID_HANDLE_VALUE; + close_pipe(pipe); /* Stop reading, so the pending read that is going to fail will */ /* not be reported to the user. */ @@ -1874,6 +1896,27 @@ int uv_pipe_open(uv_pipe_t* pipe, uv_file file) { FILE_ACCESS_INFORMATION access; DWORD duplex_flags = 0; + if (os_handle == INVALID_HANDLE_VALUE) + return UV_EBADF; + + /* In order to avoid closing a stdio file descriptor 0-2, duplicate the + * underlying OS handle and forget about the original fd. + * We could also opt to use the original OS handle and just never close it, + * but then there would be no reliable way to cancel pending read operations + * upon close. + */ + if (file <= 2) { + if (!DuplicateHandle(INVALID_HANDLE_VALUE, + os_handle, + INVALID_HANDLE_VALUE, + &os_handle, + 0, + FALSE, + DUPLICATE_SAME_ACCESS)) + return uv_translate_sys_error(GetLastError()); + file = -1; + } + /* Determine what kind of permissions we have on this handle. * Cygwin opens the pipe in message mode, but we can support it, * just query the access flags and set the stream flags accordingly. @@ -1899,7 +1942,11 @@ int uv_pipe_open(uv_pipe_t* pipe, uv_file file) { duplex_flags |= UV_HANDLE_READABLE; if (os_handle == INVALID_HANDLE_VALUE || - uv_set_pipe_handle(pipe->loop, pipe, os_handle, duplex_flags) == -1) { + uv_set_pipe_handle(pipe->loop, + pipe, + os_handle, + file, + duplex_flags) == -1) { return UV_EINVAL; } diff --git a/deps/uv/src/win/process-stdio.c b/deps/uv/src/win/process-stdio.c index e81f799f0b8355..e3c06f57dea5a4 100644 --- a/deps/uv/src/win/process-stdio.c +++ b/deps/uv/src/win/process-stdio.c @@ -407,7 +407,7 @@ int uv__stdio_create(uv_loop_t* loop, stream_handle = ((uv_tty_t*) stream)->handle; crt_flags = FOPEN | FDEV; } else if (stream->type == UV_NAMED_PIPE && - stream->flags & UV_HANDLE_CONNECTED) { + stream->flags & UV_HANDLE_CONNECTION) { stream_handle = ((uv_pipe_t*) stream)->handle; crt_flags = FOPEN | FPIPE; } else { 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/tcp.c b/deps/uv/src/win/tcp.c index da89f28d161e7a..0f5654863e9790 100644 --- a/deps/uv/src/win/tcp.c +++ b/deps/uv/src/win/tcp.c @@ -78,19 +78,27 @@ static int uv__tcp_keepalive(uv_tcp_t* handle, SOCKET socket, int enable, unsign } -static int uv_tcp_set_socket(uv_loop_t* loop, uv_tcp_t* handle, - SOCKET socket, int family, int imported) { +static int uv_tcp_set_socket(uv_loop_t* loop, + uv_tcp_t* handle, + SOCKET socket, + int family, + int imported) { DWORD yes = 1; int non_ifs_lsp; int err; - assert(handle->socket == INVALID_SOCKET); + if (handle->socket != INVALID_SOCKET) + return UV_EBUSY; /* Set the socket to nonblocking mode */ if (ioctlsocket(socket, FIONBIO, &yes) == SOCKET_ERROR) { return WSAGetLastError(); } + /* Make the socket non-inheritable */ + if (!SetHandleInformation((HANDLE) socket, HANDLE_FLAG_INHERIT, 0)) + return GetLastError(); + /* Associate it with the I/O completion port. */ /* Use uv_handle_t pointer as completion key. */ if (CreateIoCompletionPort((HANDLE)socket, @@ -146,9 +154,18 @@ static int uv_tcp_set_socket(uv_loop_t* loop, uv_tcp_t* handle, } -int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* handle) { - uv_stream_init(loop, (uv_stream_t*) handle, UV_TCP); +int uv_tcp_init_ex(uv_loop_t* loop, uv_tcp_t* handle, unsigned int flags) { + int domain; + /* Use the lower 8 bits for the domain */ + domain = flags & 0xFF; + if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC) + return UV_EINVAL; + + if (flags & ~0xFF) + return UV_EINVAL; + + uv_stream_init(loop, (uv_stream_t*) handle, UV_TCP); handle->tcp.serv.accept_reqs = NULL; handle->tcp.serv.pending_accepts = NULL; handle->socket = INVALID_SOCKET; @@ -158,10 +175,39 @@ int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* handle) { handle->tcp.serv.processed_accepts = 0; handle->delayed_error = 0; + /* If anything fails beyond this point we need to remove the handle from + * the handle queue, since it was added by uv__handle_init in uv_stream_init. + */ + + if (domain != AF_UNSPEC) { + SOCKET sock; + DWORD err; + + sock = socket(domain, SOCK_STREAM, 0); + if (sock == INVALID_SOCKET) { + err = WSAGetLastError(); + QUEUE_REMOVE(&handle->handle_queue); + return uv_translate_sys_error(err); + } + + err = uv_tcp_set_socket(handle->loop, handle, sock, domain, 0); + if (err) { + closesocket(sock); + QUEUE_REMOVE(&handle->handle_queue); + return uv_translate_sys_error(err); + } + + } + return 0; } +int uv_tcp_init(uv_loop_t* loop, uv_tcp_t* handle) { + return uv_tcp_init_ex(loop, handle, AF_UNSPEC); +} + + void uv_tcp_endgame(uv_loop_t* loop, uv_tcp_t* handle) { int err; unsigned int i; @@ -267,13 +313,6 @@ static int uv_tcp_try_bind(uv_tcp_t* handle, return WSAGetLastError(); } - /* Make the socket non-inheritable */ - if (!SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0)) { - err = GetLastError(); - closesocket(sock); - return err; - } - err = uv_tcp_set_socket(handle->loop, handle, sock, addr->sa_family, 0); if (err) { closesocket(sock); @@ -774,7 +813,7 @@ int uv_tcp_getsockname(const uv_tcp_t* handle, int* namelen) { int result; - if (!(handle->flags & UV_HANDLE_BOUND)) { + if (handle->socket == INVALID_SOCKET) { return UV_EINVAL; } @@ -796,7 +835,7 @@ int uv_tcp_getpeername(const uv_tcp_t* handle, int* namelen) { int result; - if (!(handle->flags & UV_HANDLE_BOUND)) { + if (handle->socket == INVALID_SOCKET) { return UV_EINVAL; } @@ -1165,12 +1204,6 @@ int uv_tcp_import(uv_tcp_t* tcp, uv__ipc_socket_info_ex* socket_info_ex, return WSAGetLastError(); } - if (!SetHandleInformation((HANDLE) socket, HANDLE_FLAG_INHERIT, 0)) { - err = GetLastError(); - closesocket(socket); - return err; - } - err = uv_tcp_set_socket(tcp->loop, tcp, socket, @@ -1426,11 +1459,6 @@ int uv_tcp_open(uv_tcp_t* handle, uv_os_sock_t sock) { return uv_translate_sys_error(GetLastError()); } - /* Make the socket non-inheritable */ - if (!SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0)) { - return uv_translate_sys_error(GetLastError()); - } - err = uv_tcp_set_socket(handle->loop, handle, sock, diff --git a/deps/uv/src/win/thread.c b/deps/uv/src/win/thread.c index e91ae9b13852d2..91684e93875541 100644 --- a/deps/uv/src/win/thread.c +++ b/deps/uv/src/win/thread.c @@ -27,28 +27,8 @@ #include "internal.h" -#define HAVE_SRWLOCK_API() (pTryAcquireSRWLockShared != NULL) #define HAVE_CONDVAR_API() (pInitializeConditionVariable != NULL) -static int uv__rwlock_srwlock_init(uv_rwlock_t* rwlock); -static void uv__rwlock_srwlock_destroy(uv_rwlock_t* rwlock); -static void uv__rwlock_srwlock_rdlock(uv_rwlock_t* rwlock); -static int uv__rwlock_srwlock_tryrdlock(uv_rwlock_t* rwlock); -static void uv__rwlock_srwlock_rdunlock(uv_rwlock_t* rwlock); -static void uv__rwlock_srwlock_wrlock(uv_rwlock_t* rwlock); -static int uv__rwlock_srwlock_trywrlock(uv_rwlock_t* rwlock); -static void uv__rwlock_srwlock_wrunlock(uv_rwlock_t* rwlock); - -static int uv__rwlock_fallback_init(uv_rwlock_t* rwlock); -static void uv__rwlock_fallback_destroy(uv_rwlock_t* rwlock); -static void uv__rwlock_fallback_rdlock(uv_rwlock_t* rwlock); -static int uv__rwlock_fallback_tryrdlock(uv_rwlock_t* rwlock); -static void uv__rwlock_fallback_rdunlock(uv_rwlock_t* rwlock); -static void uv__rwlock_fallback_wrlock(uv_rwlock_t* rwlock); -static int uv__rwlock_fallback_trywrlock(uv_rwlock_t* rwlock); -static void uv__rwlock_fallback_wrunlock(uv_rwlock_t* rwlock); - - static int uv_cond_fallback_init(uv_cond_t* cond); static void uv_cond_fallback_destroy(uv_cond_t* cond); static void uv_cond_fallback_signal(uv_cond_t* cond); @@ -191,6 +171,7 @@ int uv_thread_create(uv_thread_t *tid, void (*entry)(void *arg), void *arg) { uv_thread_t uv_thread_self(void) { + uv_once(&uv__current_thread_init_guard, uv__init_current_thread_key); return (uv_thread_t) uv_key_get(&uv__current_thread_key); } @@ -231,7 +212,7 @@ int uv_mutex_trylock(uv_mutex_t* mutex) { if (TryEnterCriticalSection(mutex)) return 0; else - return UV_EAGAIN; + return UV_EBUSY; } @@ -241,68 +222,111 @@ void uv_mutex_unlock(uv_mutex_t* mutex) { int uv_rwlock_init(uv_rwlock_t* rwlock) { - uv__once_init(); + /* Initialize the semaphore that acts as the write lock. */ + HANDLE handle = CreateSemaphoreW(NULL, 1, 1, NULL); + if (handle == NULL) + return uv_translate_sys_error(GetLastError()); + rwlock->state_.write_semaphore_ = handle; - if (HAVE_SRWLOCK_API()) - return uv__rwlock_srwlock_init(rwlock); - else - return uv__rwlock_fallback_init(rwlock); + /* Initialize the critical section protecting the reader count. */ + InitializeCriticalSection(&rwlock->state_.num_readers_lock_); + + /* Initialize the reader count. */ + rwlock->state_.num_readers_ = 0; + + return 0; } void uv_rwlock_destroy(uv_rwlock_t* rwlock) { - if (HAVE_SRWLOCK_API()) - uv__rwlock_srwlock_destroy(rwlock); - else - uv__rwlock_fallback_destroy(rwlock); + DeleteCriticalSection(&rwlock->state_.num_readers_lock_); + CloseHandle(rwlock->state_.write_semaphore_); } void uv_rwlock_rdlock(uv_rwlock_t* rwlock) { - if (HAVE_SRWLOCK_API()) - uv__rwlock_srwlock_rdlock(rwlock); - else - uv__rwlock_fallback_rdlock(rwlock); + /* Acquire the lock that protects the reader count. */ + EnterCriticalSection(&rwlock->state_.num_readers_lock_); + + /* Increase the reader count, and lock for write if this is the first + * reader. + */ + if (++rwlock->state_.num_readers_ == 1) { + DWORD r = WaitForSingleObject(rwlock->state_.write_semaphore_, INFINITE); + if (r != WAIT_OBJECT_0) + uv_fatal_error(GetLastError(), "WaitForSingleObject"); + } + + /* Release the lock that protects the reader count. */ + LeaveCriticalSection(&rwlock->state_.num_readers_lock_); } int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock) { - if (HAVE_SRWLOCK_API()) - return uv__rwlock_srwlock_tryrdlock(rwlock); - else - return uv__rwlock_fallback_tryrdlock(rwlock); + int err; + + if (!TryEnterCriticalSection(&rwlock->state_.num_readers_lock_)) + return UV_EBUSY; + + err = 0; + + if (rwlock->state_.num_readers_ == 0) { + /* Currently there are no other readers, which means that the write lock + * needs to be acquired. + */ + DWORD r = WaitForSingleObject(rwlock->state_.write_semaphore_, 0); + if (r == WAIT_OBJECT_0) + rwlock->state_.num_readers_++; + else if (r == WAIT_TIMEOUT) + err = UV_EBUSY; + else if (r == WAIT_FAILED) + uv_fatal_error(GetLastError(), "WaitForSingleObject"); + + } else { + /* The write lock has already been acquired because there are other + * active readers. + */ + rwlock->state_.num_readers_++; + } + + LeaveCriticalSection(&rwlock->state_.num_readers_lock_); + return err; } void uv_rwlock_rdunlock(uv_rwlock_t* rwlock) { - if (HAVE_SRWLOCK_API()) - uv__rwlock_srwlock_rdunlock(rwlock); - else - uv__rwlock_fallback_rdunlock(rwlock); + EnterCriticalSection(&rwlock->state_.num_readers_lock_); + + if (--rwlock->state_.num_readers_ == 0) { + if (!ReleaseSemaphore(rwlock->state_.write_semaphore_, 1, NULL)) + uv_fatal_error(GetLastError(), "ReleaseSemaphore"); + } + + LeaveCriticalSection(&rwlock->state_.num_readers_lock_); } void uv_rwlock_wrlock(uv_rwlock_t* rwlock) { - if (HAVE_SRWLOCK_API()) - uv__rwlock_srwlock_wrlock(rwlock); - else - uv__rwlock_fallback_wrlock(rwlock); + DWORD r = WaitForSingleObject(rwlock->state_.write_semaphore_, INFINITE); + if (r != WAIT_OBJECT_0) + uv_fatal_error(GetLastError(), "WaitForSingleObject"); } int uv_rwlock_trywrlock(uv_rwlock_t* rwlock) { - if (HAVE_SRWLOCK_API()) - return uv__rwlock_srwlock_trywrlock(rwlock); + DWORD r = WaitForSingleObject(rwlock->state_.write_semaphore_, 0); + if (r == WAIT_OBJECT_0) + return 0; + else if (r == WAIT_TIMEOUT) + return UV_EBUSY; else - return uv__rwlock_fallback_trywrlock(rwlock); + uv_fatal_error(GetLastError(), "WaitForSingleObject"); } void uv_rwlock_wrunlock(uv_rwlock_t* rwlock) { - if (HAVE_SRWLOCK_API()) - uv__rwlock_srwlock_wrunlock(rwlock); - else - uv__rwlock_fallback_wrunlock(rwlock); + if (!ReleaseSemaphore(rwlock->state_.write_semaphore_, 1, NULL)) + uv_fatal_error(GetLastError(), "ReleaseSemaphore"); } @@ -347,135 +371,6 @@ int uv_sem_trywait(uv_sem_t* sem) { } -static int uv__rwlock_srwlock_init(uv_rwlock_t* rwlock) { - pInitializeSRWLock(&rwlock->srwlock_); - return 0; -} - - -static void uv__rwlock_srwlock_destroy(uv_rwlock_t* rwlock) { - (void) rwlock; -} - - -static void uv__rwlock_srwlock_rdlock(uv_rwlock_t* rwlock) { - pAcquireSRWLockShared(&rwlock->srwlock_); -} - - -static int uv__rwlock_srwlock_tryrdlock(uv_rwlock_t* rwlock) { - if (pTryAcquireSRWLockShared(&rwlock->srwlock_)) - return 0; - else - return UV_EBUSY; /* TODO(bnoordhuis) EAGAIN when owned by this thread. */ -} - - -static void uv__rwlock_srwlock_rdunlock(uv_rwlock_t* rwlock) { - pReleaseSRWLockShared(&rwlock->srwlock_); -} - - -static void uv__rwlock_srwlock_wrlock(uv_rwlock_t* rwlock) { - pAcquireSRWLockExclusive(&rwlock->srwlock_); -} - - -static int uv__rwlock_srwlock_trywrlock(uv_rwlock_t* rwlock) { - if (pTryAcquireSRWLockExclusive(&rwlock->srwlock_)) - return 0; - else - return UV_EBUSY; /* TODO(bnoordhuis) EAGAIN when owned by this thread. */ -} - - -static void uv__rwlock_srwlock_wrunlock(uv_rwlock_t* rwlock) { - pReleaseSRWLockExclusive(&rwlock->srwlock_); -} - - -static int uv__rwlock_fallback_init(uv_rwlock_t* rwlock) { - int err; - - err = uv_mutex_init(&rwlock->fallback_.read_mutex_); - if (err) - return err; - - err = uv_mutex_init(&rwlock->fallback_.write_mutex_); - if (err) { - uv_mutex_destroy(&rwlock->fallback_.read_mutex_); - return err; - } - - rwlock->fallback_.num_readers_ = 0; - - return 0; -} - - -static void uv__rwlock_fallback_destroy(uv_rwlock_t* rwlock) { - uv_mutex_destroy(&rwlock->fallback_.read_mutex_); - uv_mutex_destroy(&rwlock->fallback_.write_mutex_); -} - - -static void uv__rwlock_fallback_rdlock(uv_rwlock_t* rwlock) { - uv_mutex_lock(&rwlock->fallback_.read_mutex_); - - if (++rwlock->fallback_.num_readers_ == 1) - uv_mutex_lock(&rwlock->fallback_.write_mutex_); - - uv_mutex_unlock(&rwlock->fallback_.read_mutex_); -} - - -static int uv__rwlock_fallback_tryrdlock(uv_rwlock_t* rwlock) { - int err; - - err = uv_mutex_trylock(&rwlock->fallback_.read_mutex_); - if (err) - goto out; - - err = 0; - if (rwlock->fallback_.num_readers_ == 0) - err = uv_mutex_trylock(&rwlock->fallback_.write_mutex_); - - if (err == 0) - rwlock->fallback_.num_readers_++; - - uv_mutex_unlock(&rwlock->fallback_.read_mutex_); - -out: - return err; -} - - -static void uv__rwlock_fallback_rdunlock(uv_rwlock_t* rwlock) { - uv_mutex_lock(&rwlock->fallback_.read_mutex_); - - if (--rwlock->fallback_.num_readers_ == 0) - uv_mutex_unlock(&rwlock->fallback_.write_mutex_); - - uv_mutex_unlock(&rwlock->fallback_.read_mutex_); -} - - -static void uv__rwlock_fallback_wrlock(uv_rwlock_t* rwlock) { - uv_mutex_lock(&rwlock->fallback_.write_mutex_); -} - - -static int uv__rwlock_fallback_trywrlock(uv_rwlock_t* rwlock) { - return uv_mutex_trylock(&rwlock->fallback_.write_mutex_); -} - - -static void uv__rwlock_fallback_wrunlock(uv_rwlock_t* rwlock) { - uv_mutex_unlock(&rwlock->fallback_.write_mutex_); -} - - - /* This condition variable implementation is based on the SetEvent solution * (section 3.2) at http://www.cs.wustl.edu/~schmidt/win32-cv-1.html * We could not use the SignalObjectAndWait solution (section 3.4) because diff --git a/deps/uv/src/win/tty.c b/deps/uv/src/win/tty.c index 7b1e4ba0557fca..d87cc699097cf7 100644 --- a/deps/uv/src/win/tty.c +++ b/deps/uv/src/win/tty.c @@ -55,6 +55,7 @@ #define MAX_INPUT_BUFFER_LENGTH 8192 +static void uv_tty_capture_initial_style(CONSOLE_SCREEN_BUFFER_INFO* info); static void uv_tty_update_virtual_window(CONSOLE_SCREEN_BUFFER_INFO* info); @@ -96,6 +97,15 @@ static CRITICAL_SECTION uv_tty_output_lock; static HANDLE uv_tty_output_handle = INVALID_HANDLE_VALUE; +static WORD uv_tty_default_text_attributes = + FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; + +static char uv_tty_default_fg_color = 7; +static char uv_tty_default_bg_color = 0; +static char uv_tty_default_fg_bright = 0; +static char uv_tty_default_bg_bright = 0; +static char uv_tty_default_inverse = 0; + void uv_console_init() { InitializeCriticalSection(&uv_tty_output_lock); @@ -106,9 +116,26 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { HANDLE handle; CONSOLE_SCREEN_BUFFER_INFO screen_buffer_info; - handle = (HANDLE) _get_osfhandle(fd); - if (handle == INVALID_HANDLE_VALUE) { + handle = (HANDLE) uv__get_osfhandle(fd); + if (handle == INVALID_HANDLE_VALUE) return UV_EBADF; + + if (fd <= 2) { + /* In order to avoid closing a stdio file descriptor 0-2, duplicate the + * underlying OS handle and forget about the original fd. + * We could also opt to use the original OS handle and just never close it, + * but then there would be no reliable way to cancel pending read operations + * upon close. + */ + if (!DuplicateHandle(INVALID_HANDLE_VALUE, + handle, + INVALID_HANDLE_VALUE, + &handle, + 0, + FALSE, + DUPLICATE_SAME_ACCESS)) + return uv_translate_sys_error(GetLastError()); + fd = -1; } if (!readable) { @@ -126,6 +153,9 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { /* is received. */ uv_tty_output_handle = handle; + /* Remember the original console text attributes. */ + uv_tty_capture_initial_style(&screen_buffer_info); + uv_tty_update_virtual_window(&screen_buffer_info); LeaveCriticalSection(&uv_tty_output_lock); @@ -136,6 +166,7 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { uv_connection_init((uv_stream_t*) tty); tty->handle = handle; + tty->u.fd = fd; tty->reqs_pending = 0; tty->flags |= UV_HANDLE_BOUND; @@ -170,6 +201,62 @@ int uv_tty_init(uv_loop_t* loop, uv_tty_t* tty, uv_file fd, int readable) { } +/* Set the default console text attributes based on how the console was + * configured when libuv started. + */ +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. */ + if (style_captured) + return; + + /* Save raw win32 attributes. */ + uv_tty_default_text_attributes = info->wAttributes; + + /* Convert black text on black background to use white text. */ + if (uv_tty_default_text_attributes == 0) + uv_tty_default_text_attributes = 7; + + /* Convert Win32 attributes to ANSI colors. */ + uv_tty_default_fg_color = 0; + uv_tty_default_bg_color = 0; + uv_tty_default_fg_bright = 0; + uv_tty_default_bg_bright = 0; + uv_tty_default_inverse = 0; + + if (uv_tty_default_text_attributes & FOREGROUND_RED) + uv_tty_default_fg_color |= 1; + + if (uv_tty_default_text_attributes & FOREGROUND_GREEN) + uv_tty_default_fg_color |= 2; + + if (uv_tty_default_text_attributes & FOREGROUND_BLUE) + uv_tty_default_fg_color |= 4; + + if (uv_tty_default_text_attributes & BACKGROUND_RED) + uv_tty_default_bg_color |= 1; + + if (uv_tty_default_text_attributes & BACKGROUND_GREEN) + uv_tty_default_bg_color |= 2; + + if (uv_tty_default_text_attributes & BACKGROUND_BLUE) + uv_tty_default_bg_color |= 4; + + if (uv_tty_default_text_attributes & FOREGROUND_INTENSITY) + uv_tty_default_fg_bright = 1; + + if (uv_tty_default_text_attributes & BACKGROUND_INTENSITY) + uv_tty_default_bg_bright = 1; + + if (uv_tty_default_text_attributes & COMMON_LVB_REVERSE_VIDEO) + uv_tty_default_inverse = 1; + + style_captured = 1; +} + + int uv_tty_set_mode(uv_tty_t* tty, uv_tty_mode_t mode) { DWORD flags; unsigned char was_reading; @@ -1004,7 +1091,7 @@ static int uv_tty_move_caret(uv_tty_t* handle, int x, unsigned char x_relative, static int uv_tty_reset(uv_tty_t* handle, DWORD* error) { const COORD origin = {0, 0}; - const WORD char_attrs = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; + const WORD char_attrs = uv_tty_default_text_attributes; CONSOLE_SCREEN_BUFFER_INFO info; DWORD count, written; @@ -1160,11 +1247,11 @@ static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) { if (argc == 0) { /* Reset mode */ - fg_color = 7; - bg_color = 0; - fg_bright = 0; - bg_bright = 0; - inverse = 0; + fg_color = uv_tty_default_fg_color; + bg_color = uv_tty_default_bg_color; + fg_bright = uv_tty_default_fg_bright; + bg_bright = uv_tty_default_bg_bright; + inverse = uv_tty_default_inverse; } for (i = 0; i < argc; i++) { @@ -1172,11 +1259,11 @@ static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) { if (arg == 0) { /* Reset mode */ - fg_color = 7; - bg_color = 0; - fg_bright = 0; - bg_bright = 0; - inverse = 0; + fg_color = uv_tty_default_fg_color; + bg_color = uv_tty_default_bg_color; + fg_bright = uv_tty_default_fg_bright; + bg_bright = uv_tty_default_bg_bright; + inverse = uv_tty_default_inverse; } else if (arg == 1) { /* Foreground bright on */ @@ -1213,8 +1300,8 @@ static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) { } else if (arg == 39) { /* Default text color */ - fg_color = 7; - fg_bright = 0; + fg_color = uv_tty_default_fg_color; + fg_bright = uv_tty_default_fg_bright; } else if (arg >= 40 && arg <= 47) { /* Set background color */ @@ -1222,8 +1309,8 @@ static int uv_tty_set_style(uv_tty_t* handle, DWORD* error) { } else if (arg == 49) { /* Default background color */ - bg_color = 0; - bg_bright = 0; + bg_color = uv_tty_default_bg_color; + bg_bright = uv_tty_default_bg_bright; } else if (arg >= 90 && arg <= 97) { /* Set bold foreground color */ @@ -1411,6 +1498,11 @@ static int uv_tty_write_bufs(uv_tty_t* handle, } \ } while (0) +#define ENSURE_BUFFER_SPACE(wchars_needed) \ + if (wchars_needed > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { \ + FLUSH_TEXT(); \ + } + /* Cache for fast access */ unsigned char utf8_bytes_left = handle->tty.wr.utf8_bytes_left; unsigned int utf8_codepoint = handle->tty.wr.utf8_codepoint; @@ -1794,32 +1886,29 @@ static int uv_tty_write_bufs(uv_tty_t* handle, } if (utf8_codepoint == 0x0a || utf8_codepoint == 0x0d) { - /* EOL conversion - emit \r\n, when we see either \r or \n. */ - /* If a \n immediately follows a \r or vice versa, ignore it. */ - if (previous_eol == 0 || utf8_codepoint == previous_eol) { - /* If there's no room in the utf16 buf, flush it first. */ - if (2 > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { - uv_tty_emit_text(handle, utf16_buf, utf16_buf_used, error); - utf16_buf_used = 0; - } + /* EOL conversion - emit \r\n when we see \n. */ + if (utf8_codepoint == 0x0a && previous_eol != 0x0d) { + /* \n was not preceded by \r; print \r\n. */ + ENSURE_BUFFER_SPACE(2); utf16_buf[utf16_buf_used++] = L'\r'; utf16_buf[utf16_buf_used++] = L'\n'; - previous_eol = (char) utf8_codepoint; + } else if (utf8_codepoint == 0x0d && previous_eol == 0x0a) { + /* \n was followed by \r; do not print the \r, since */ + /* the source was either \r\n\r (so the second \r is */ + /* redundant) or was \n\r (so the \n was processed */ + /* by the last case and an \r automatically inserted). */ } else { - /* Ignore this newline, but don't ignore later ones. */ - previous_eol = 0; + /* \r without \n; print \r as-is. */ + ENSURE_BUFFER_SPACE(1); + utf16_buf[utf16_buf_used++] = (WCHAR) utf8_codepoint; } + previous_eol = (char) utf8_codepoint; + } else if (utf8_codepoint <= 0xffff) { /* Encode character into utf-16 buffer. */ - - /* If there's no room in the utf16 buf, flush it first. */ - if (1 > ARRAY_SIZE(utf16_buf) - utf16_buf_used) { - uv_tty_emit_text(handle, utf16_buf, utf16_buf_used, error); - utf16_buf_used = 0; - } - + ENSURE_BUFFER_SPACE(1); utf16_buf[utf16_buf_used++] = (WCHAR) utf8_codepoint; previous_eol = 0; } @@ -1916,11 +2005,16 @@ void uv_process_tty_write_req(uv_loop_t* loop, uv_tty_t* handle, void uv_tty_close(uv_tty_t* handle) { - CloseHandle(handle->handle); + assert(handle->u.fd == -1 || handle->u.fd > 2); + if (handle->u.fd == -1) + CloseHandle(handle->handle); + else + close(handle->u.fd); if (handle->flags & UV_HANDLE_READING) uv_tty_read_stop(handle); + handle->u.fd = -1; handle->handle = INVALID_HANDLE_VALUE; handle->flags &= ~(UV_HANDLE_READABLE | UV_HANDLE_WRITABLE); uv__handle_closing(handle); diff --git a/deps/uv/src/win/udp.c b/deps/uv/src/win/udp.c index 197e5d828f2ad4..24792ec067ef2f 100644 --- a/deps/uv/src/win/udp.c +++ b/deps/uv/src/win/udp.c @@ -42,7 +42,7 @@ int uv_udp_getsockname(const uv_udp_t* handle, int* namelen) { int result; - if (!(handle->flags & UV_HANDLE_BOUND)) { + if (handle->socket == INVALID_SOCKET) { return UV_EINVAL; } @@ -61,7 +61,8 @@ static int uv_udp_set_socket(uv_loop_t* loop, uv_udp_t* handle, SOCKET socket, WSAPROTOCOL_INFOW info; int opt_len; - assert(handle->socket == INVALID_SOCKET); + if (handle->socket != INVALID_SOCKET) + return UV_EBUSY; /* Set the socket to nonblocking mode */ if (ioctlsocket(socket, FIONBIO, &yes) == SOCKET_ERROR) { @@ -122,9 +123,18 @@ static int uv_udp_set_socket(uv_loop_t* loop, uv_udp_t* handle, SOCKET socket, } -int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) { - uv__handle_init(loop, (uv_handle_t*) handle, UV_UDP); +int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) { + int domain; + /* Use the lower 8 bits for the domain */ + domain = flags & 0xFF; + if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC) + return UV_EINVAL; + + if (flags & ~0xFF) + return UV_EINVAL; + + uv__handle_init(loop, (uv_handle_t*) handle, UV_UDP); handle->socket = INVALID_SOCKET; handle->reqs_pending = 0; handle->activecnt = 0; @@ -132,15 +142,42 @@ int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) { handle->func_wsarecvfrom = WSARecvFrom; handle->send_queue_size = 0; handle->send_queue_count = 0; - uv_req_init(loop, (uv_req_t*) &(handle->recv_req)); handle->recv_req.type = UV_UDP_RECV; handle->recv_req.data = handle; + /* If anything fails beyond this point we need to remove the handle from + * the handle queue, since it was added by uv__handle_init. + */ + + if (domain != AF_UNSPEC) { + SOCKET sock; + DWORD err; + + sock = socket(domain, SOCK_DGRAM, 0); + if (sock == INVALID_SOCKET) { + err = WSAGetLastError(); + QUEUE_REMOVE(&handle->handle_queue); + return uv_translate_sys_error(err); + } + + err = uv_udp_set_socket(handle->loop, handle, sock, domain); + if (err) { + closesocket(sock); + QUEUE_REMOVE(&handle->handle_queue); + return uv_translate_sys_error(err); + } + } + return 0; } +int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) { + return uv_udp_init_ex(loop, handle, AF_UNSPEC); +} + + void uv_udp_close(uv_loop_t* loop, uv_udp_t* handle) { uv_udp_recv_stop(handle); closesocket(handle->socket); @@ -190,25 +227,24 @@ static int uv_udp_maybe_bind(uv_udp_t* handle, closesocket(sock); return err; } + } - if (flags & UV_UDP_REUSEADDR) { - DWORD yes = 1; - /* Set SO_REUSEADDR on the socket. */ - if (setsockopt(sock, - SOL_SOCKET, - SO_REUSEADDR, - (char*) &yes, - sizeof yes) == SOCKET_ERROR) { - err = WSAGetLastError(); - closesocket(sock); - return err; - } + if (flags & UV_UDP_REUSEADDR) { + DWORD yes = 1; + /* Set SO_REUSEADDR on the socket. */ + if (setsockopt(handle->socket, + SOL_SOCKET, + SO_REUSEADDR, + (char*) &yes, + sizeof yes) == SOCKET_ERROR) { + err = WSAGetLastError(); + return err; } - - if (addr->sa_family == AF_INET6) - handle->flags |= UV_HANDLE_IPV6; } + if (addr->sa_family == AF_INET6) + handle->flags |= UV_HANDLE_IPV6; + if (addr->sa_family == AF_INET6 && !(flags & UV_UDP_IPV6ONLY)) { /* On windows IPV6ONLY is on by default. */ /* If the user doesn't specify it libuv turns it off. */ 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 f3f27f77c15a4e..26bd0648668742 100644 --- a/deps/uv/src/win/winapi.c +++ b/deps/uv/src/win/winapi.c @@ -40,19 +40,13 @@ sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx; sSetFileCompletionNotificationModes pSetFileCompletionNotificationModes; sCreateSymbolicLinkW pCreateSymbolicLinkW; sCancelIoEx pCancelIoEx; -sInitializeSRWLock pInitializeSRWLock; -sAcquireSRWLockShared pAcquireSRWLockShared; -sAcquireSRWLockExclusive pAcquireSRWLockExclusive; -sTryAcquireSRWLockShared pTryAcquireSRWLockShared; -sTryAcquireSRWLockExclusive pTryAcquireSRWLockExclusive; -sReleaseSRWLockShared pReleaseSRWLockShared; -sReleaseSRWLockExclusive pReleaseSRWLockExclusive; sInitializeConditionVariable pInitializeConditionVariable; sSleepConditionVariableCS pSleepConditionVariableCS; sSleepConditionVariableSRW pSleepConditionVariableSRW; sWakeAllConditionVariable pWakeAllConditionVariable; sWakeConditionVariable pWakeConditionVariable; sCancelSynchronousIo pCancelSynchronousIo; +sGetFinalPathNameByHandleW pGetFinalPathNameByHandleW; void uv_winapi_init() { @@ -129,27 +123,6 @@ void uv_winapi_init() { pCancelIoEx = (sCancelIoEx) GetProcAddress(kernel32_module, "CancelIoEx"); - pInitializeSRWLock = (sInitializeSRWLock) - GetProcAddress(kernel32_module, "InitializeSRWLock"); - - pAcquireSRWLockShared = (sAcquireSRWLockShared) - GetProcAddress(kernel32_module, "AcquireSRWLockShared"); - - pAcquireSRWLockExclusive = (sAcquireSRWLockExclusive) - GetProcAddress(kernel32_module, "AcquireSRWLockExclusive"); - - pTryAcquireSRWLockShared = (sTryAcquireSRWLockShared) - GetProcAddress(kernel32_module, "TryAcquireSRWLockShared"); - - pTryAcquireSRWLockExclusive = (sTryAcquireSRWLockExclusive) - GetProcAddress(kernel32_module, "TryAcquireSRWLockExclusive"); - - pReleaseSRWLockShared = (sReleaseSRWLockShared) - GetProcAddress(kernel32_module, "ReleaseSRWLockShared"); - - pReleaseSRWLockExclusive = (sReleaseSRWLockExclusive) - GetProcAddress(kernel32_module, "ReleaseSRWLockExclusive"); - pInitializeConditionVariable = (sInitializeConditionVariable) GetProcAddress(kernel32_module, "InitializeConditionVariable"); @@ -167,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 f4f9145b388f00..122198a6d481ac 100644 --- a/deps/uv/src/win/winapi.h +++ b/deps/uv/src/win/winapi.h @@ -4655,27 +4655,6 @@ typedef BOOL (WINAPI* sCancelIoEx) (HANDLE hFile, LPOVERLAPPED lpOverlapped); -typedef VOID (WINAPI* sInitializeSRWLock) - (PSRWLOCK SRWLock); - -typedef VOID (WINAPI* sAcquireSRWLockShared) - (PSRWLOCK SRWLock); - -typedef VOID (WINAPI* sAcquireSRWLockExclusive) - (PSRWLOCK SRWLock); - -typedef BOOL (WINAPI* sTryAcquireSRWLockShared) - (PSRWLOCK SRWLock); - -typedef BOOL (WINAPI* sTryAcquireSRWLockExclusive) - (PSRWLOCK SRWLock); - -typedef VOID (WINAPI* sReleaseSRWLockShared) - (PSRWLOCK SRWLock); - -typedef VOID (WINAPI* sReleaseSRWLockExclusive) - (PSRWLOCK SRWLock); - typedef VOID (WINAPI* sInitializeConditionVariable) (PCONDITION_VARIABLE ConditionVariable); @@ -4699,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; @@ -4714,18 +4699,12 @@ extern sGetQueuedCompletionStatusEx pGetQueuedCompletionStatusEx; extern sSetFileCompletionNotificationModes pSetFileCompletionNotificationModes; extern sCreateSymbolicLinkW pCreateSymbolicLinkW; extern sCancelIoEx pCancelIoEx; -extern sInitializeSRWLock pInitializeSRWLock; -extern sAcquireSRWLockShared pAcquireSRWLockShared; -extern sAcquireSRWLockExclusive pAcquireSRWLockExclusive; -extern sTryAcquireSRWLockShared pTryAcquireSRWLockShared; -extern sTryAcquireSRWLockExclusive pTryAcquireSRWLockExclusive; -extern sReleaseSRWLockShared pReleaseSRWLockShared; -extern sReleaseSRWLockExclusive pReleaseSRWLockExclusive; extern sInitializeConditionVariable pInitializeConditionVariable; extern sSleepConditionVariableCS pSleepConditionVariableCS; 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/benchmark-fs-stat.c b/deps/uv/test/benchmark-fs-stat.c index 5c87de004368ec..32d2589586c1b0 100644 --- a/deps/uv/test/benchmark-fs-stat.c +++ b/deps/uv/test/benchmark-fs-stat.c @@ -31,7 +31,7 @@ #define sync_stat(req, path) \ do { \ - uv_fs_stat(uv_default_loop(), (req), (path), NULL); \ + uv_fs_stat(NULL, (req), (path), NULL); \ uv_fs_req_cleanup((req)); \ } \ while (0) diff --git a/deps/uv/test/echo-server.c b/deps/uv/test/echo-server.c index f223981c261f2b..bfed67675dd46a 100644 --- a/deps/uv/test/echo-server.c +++ b/deps/uv/test/echo-server.c @@ -304,7 +304,7 @@ static int pipe_echo_start(char* pipeName) { #ifndef _WIN32 { uv_fs_t req; - uv_fs_unlink(uv_default_loop(), &req, pipeName, NULL); + uv_fs_unlink(NULL, &req, pipeName, NULL); uv_fs_req_cleanup(&req); } #endif diff --git a/deps/uv/test/run-tests.c b/deps/uv/test/run-tests.c index 1f458745327398..b4be01f6f95927 100644 --- a/deps/uv/test/run-tests.c +++ b/deps/uv/test/run-tests.c @@ -41,6 +41,7 @@ int ipc_helper_tcp_connection(void); int ipc_send_recv_helper(void); int ipc_helper_bind_twice(void); int stdio_over_pipes_helper(void); +int spawn_stdin_stdout(void); static int maybe_run_test(int argc, char **argv); @@ -172,5 +173,9 @@ static int maybe_run_test(int argc, char **argv) { } #endif /* !_WIN32 */ + if (strcmp(argv[1], "spawn_helper9") == 0) { + return spawn_stdin_stdout(); + } + return run_test(argv[1], 0, 1); } diff --git a/deps/uv/test/runner-unix.c b/deps/uv/test/runner-unix.c index 5da720fad43a9d..2264d1e89d5fae 100644 --- a/deps/uv/test/runner-unix.c +++ b/deps/uv/test/runner-unix.c @@ -37,6 +37,7 @@ #include #include +#include #include @@ -173,6 +174,9 @@ int process_wait(process_info_t* vec, int n, int timeout) { process_info_t* p; dowait_args args; pthread_t tid; + pthread_attr_t attr; + unsigned int elapsed_ms; + struct timeval timebase; struct timeval tv; fd_set fds; @@ -199,20 +203,54 @@ int process_wait(process_info_t* vec, int n, int timeout) { return -1; } - r = pthread_create(&tid, NULL, dowait, &args); + if (pthread_attr_init(&attr)) + abort(); + + if (pthread_attr_setstacksize(&attr, 256 * 1024)) + abort(); + + r = pthread_create(&tid, &attr, dowait, &args); + + if (pthread_attr_destroy(&attr)) + abort(); + if (r) { perror("pthread_create()"); retval = -1; goto terminate; } - tv.tv_sec = timeout / 1000; - tv.tv_usec = 0; + if (gettimeofday(&timebase, NULL)) + abort(); + + tv = timebase; + for (;;) { + /* Check that gettimeofday() doesn't jump back in time. */ + assert(tv.tv_sec == timebase.tv_sec || + (tv.tv_sec == timebase.tv_sec && tv.tv_usec >= timebase.tv_usec)); + + elapsed_ms = + (tv.tv_sec - timebase.tv_sec) * 1000 + + (tv.tv_usec / 1000) - + (timebase.tv_usec / 1000); + + r = 0; /* Timeout. */ + if (elapsed_ms >= (unsigned) timeout) + break; - FD_ZERO(&fds); - FD_SET(args.pipe[0], &fds); + tv.tv_sec = (timeout - elapsed_ms) / 1000; + tv.tv_usec = (timeout - elapsed_ms) % 1000 * 1000; - r = select(args.pipe[0] + 1, &fds, NULL, NULL, &tv); + FD_ZERO(&fds); + FD_SET(args.pipe[0], &fds); + + r = select(args.pipe[0] + 1, &fds, NULL, NULL, &tv); + if (!(r == -1 && errno == EINTR)) + break; + + if (gettimeofday(&tv, NULL)) + abort(); + } if (r == -1) { perror("select()"); @@ -229,15 +267,11 @@ int process_wait(process_info_t* vec, int n, int timeout) { kill(p->pid, SIGTERM); } retval = -2; - - /* Wait for thread to finish. */ - r = pthread_join(tid, NULL); - if (r) { - perror("pthread_join"); - retval = -1; - } } + if (pthread_join(tid, NULL)) + abort(); + terminate: close(args.pipe[0]); close(args.pipe[1]); 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 e06a50e21341b7..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 */ -# ifdef _MSC_VER -# 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 0a2ba331455d5a..e02ff2fda5e5d9 100644 --- a/deps/uv/test/test-fs-event.c +++ b/deps/uv/test/test-fs-event.c @@ -37,11 +37,15 @@ static uv_fs_event_t fs_event; static const char file_prefix[] = "fsevent-"; +static const int fs_event_file_count = 16; +#if defined(__APPLE__) || defined(_WIN32) +static const char file_prefix_in_subdir[] = "subdir"; +#endif static uv_timer_t timer; static int timer_cb_called; static int close_cb_called; -static const int fs_event_file_count = 128; static int fs_event_created; +static int fs_event_removed; static int fs_event_cb_called; #if defined(PATH_MAX) static char fs_event_filename[PATH_MAX]; @@ -50,48 +54,45 @@ static char fs_event_filename[1024]; #endif /* defined(PATH_MAX) */ static int timer_cb_touch_called; -static void fs_event_unlink_files(uv_timer_t* handle); - -static void create_dir(uv_loop_t* loop, const char* name) { +static void create_dir(const char* name) { int r; uv_fs_t req; - r = uv_fs_mkdir(loop, &req, name, 0755, NULL); + r = uv_fs_mkdir(NULL, &req, name, 0755, NULL); ASSERT(r == 0 || r == UV_EEXIST); uv_fs_req_cleanup(&req); } -static void create_file(uv_loop_t* loop, const char* name) { +static void create_file(const char* name) { int r; uv_file file; uv_fs_t req; - r = uv_fs_open(loop, &req, name, O_WRONLY | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(NULL, &req, name, O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); file = r; uv_fs_req_cleanup(&req); - r = uv_fs_close(loop, &req, file, NULL); + r = uv_fs_close(NULL, &req, file, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&req); } -static void touch_file(uv_loop_t* loop, const char* name) { +static void touch_file(const char* name) { int r; uv_file file; uv_fs_t req; uv_buf_t buf; - r = uv_fs_open(loop, &req, name, O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &req, name, O_RDWR, 0, NULL); ASSERT(r >= 0); file = r; uv_fs_req_cleanup(&req); buf = uv_buf_init("foo", 4); - r = uv_fs_write(loop, &req, file, &buf, 1, -1, NULL); + r = uv_fs_write(NULL, &req, file, &buf, 1, -1, NULL); ASSERT(r >= 0); uv_fs_req_cleanup(&req); - r = uv_fs_close(loop, &req, file, NULL); + r = uv_fs_close(NULL, &req, file, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&req); } @@ -114,11 +115,65 @@ 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); } +static const char* fs_event_get_filename(int i) { + snprintf(fs_event_filename, + sizeof(fs_event_filename), + "watch_dir/%s%d", + file_prefix, + i); + return fs_event_filename; +} + +static void fs_event_create_files(uv_timer_t* handle) { + /* Make sure we're not attempting to create files we do not intend */ + ASSERT(fs_event_created < fs_event_file_count); + + /* Create the file */ + create_file(fs_event_get_filename(fs_event_created)); + + if (++fs_event_created < fs_event_file_count) { + /* Create another file on a different event loop tick. We do it this way + * to avoid fs events coalescing into one fs event. */ + ASSERT(0 == uv_timer_start(&timer, fs_event_create_files, 1, 0)); + } +} + +static void fs_event_unlink_files(uv_timer_t* handle) { + int r; + int i; + + /* NOTE: handle might be NULL if invoked not as timer callback */ + if (handle == NULL) { + /* Unlink all files */ + for (i = 0; i < 16; i++) { + r = remove(fs_event_get_filename(i)); + if (handle != NULL) + ASSERT(r == 0); + } + } else { + /* Make sure we're not attempting to remove files we do not intend */ + ASSERT(fs_event_removed < fs_event_file_count); + + /* Remove the file */ + ASSERT(0 == remove(fs_event_get_filename(fs_event_removed))); + + if (++fs_event_removed < fs_event_file_count) { + /* Remove another file on a different event loop tick. We do it this way + * to avoid fs events coalescing into one fs event. */ + ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files, 1, 0)); + } + } +} + static void fs_event_cb_dir_multi_file(uv_fs_event_t* handle, const char* filename, int events, @@ -126,61 +181,104 @@ static void fs_event_cb_dir_multi_file(uv_fs_event_t* handle, fs_event_cb_called++; ASSERT(handle == &fs_event); ASSERT(status == 0); - ASSERT(events == UV_RENAME); + 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 - /* Stop watching dir when received events about all files: - * both create and close events */ - if (fs_event_cb_called == 2 * fs_event_file_count) { - ASSERT(0 == uv_fs_event_stop(handle)); + if (fs_event_created + fs_event_removed == fs_event_file_count) { + /* Once we've processed all create events, delete all files */ + ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files, 1, 0)); + } else if (fs_event_cb_called == 2 * fs_event_file_count) { + /* Once we've processed all create and delete events, stop watching */ + uv_close((uv_handle_t*) &timer, close_cb); uv_close((uv_handle_t*) handle, close_cb); } } -static const char* fs_event_get_filename(int i) { +#if defined(__APPLE__) || defined(_WIN32) +static const char* fs_event_get_filename_in_subdir(int i) { snprintf(fs_event_filename, sizeof(fs_event_filename), - "watch_dir/%s%d", + "watch_dir/subdir/%s%d", file_prefix, i); return fs_event_filename; } -static void fs_event_create_files(uv_timer_t* handle) { - int i; - - /* Already created all files */ - if (fs_event_created == fs_event_file_count) { - uv_close((uv_handle_t*) &timer, close_cb); - return; - } +static void fs_event_create_files_in_subdir(uv_timer_t* handle) { + /* Make sure we're not attempting to create files we do not intend */ + ASSERT(fs_event_created < fs_event_file_count); - /* Create all files */ - for (i = 0; i < 16; i++, fs_event_created++) - create_file(handle->loop, fs_event_get_filename(i)); + /* Create the file */ + create_file(fs_event_get_filename_in_subdir(fs_event_created)); - /* And unlink them */ - ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files, 50, 0)); + if (++fs_event_created < fs_event_file_count) { + /* Create another file on a different event loop tick. We do it this way + * to avoid fs events coalescing into one fs event. */ + ASSERT(0 == uv_timer_start(&timer, fs_event_create_files_in_subdir, 1, 0)); + } } -void fs_event_unlink_files(uv_timer_t* handle) { +static void fs_event_unlink_files_in_subdir(uv_timer_t* handle) { int r; int i; /* NOTE: handle might be NULL if invoked not as timer callback */ + if (handle == NULL) { + /* Unlink all files */ + for (i = 0; i < 16; i++) { + r = remove(fs_event_get_filename_in_subdir(i)); + if (handle != NULL) + ASSERT(r == 0); + } + } else { + /* Make sure we're not attempting to remove files we do not intend */ + ASSERT(fs_event_removed < fs_event_file_count); + + /* Remove the file */ + ASSERT(0 == remove(fs_event_get_filename_in_subdir(fs_event_removed))); - /* Unlink all files */ - for (i = 0; i < 16; i++) { - r = remove(fs_event_get_filename(i)); - if (handle != NULL) - ASSERT(r == 0); + if (++fs_event_removed < fs_event_file_count) { + /* Remove another file on a different event loop tick. We do it this way + * to avoid fs events coalescing into one fs event. */ + ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files_in_subdir, 1, 0)); + } } +} - /* And create them again */ - if (handle != NULL) - ASSERT(0 == uv_timer_start(&timer, fs_event_create_files, 50, 0)); +static void fs_event_cb_dir_multi_file_in_subdir(uv_fs_event_t* handle, + const char* filename, + int events, + int status) { + fs_event_cb_called++; + 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); + #endif + + if (fs_event_created + fs_event_removed == fs_event_file_count) { + /* Once we've processed all create events, delete all files */ + ASSERT(0 == uv_timer_start(&timer, fs_event_unlink_files_in_subdir, 1, 0)); + } else if (fs_event_cb_called == 2 * fs_event_file_count) { + /* Once we've processed all create and delete events, stop watching */ + uv_close((uv_handle_t*) &timer, close_cb); + uv_close((uv_handle_t*) handle, close_cb); + } } +#endif static void fs_event_cb_file(uv_fs_event_t* handle, const char* filename, int events, int status) { @@ -188,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); } @@ -211,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. */ { @@ -226,16 +332,16 @@ static void timer_cb_file(uv_timer_t* handle) { ++timer_cb_called; if (timer_cb_called == 1) { - touch_file(handle->loop, "watch_dir/file1"); + touch_file("watch_dir/file1"); } else { - touch_file(handle->loop, "watch_dir/file2"); + touch_file("watch_dir/file2"); uv_close((uv_handle_t*)handle, close_cb); } } static void timer_cb_touch(uv_timer_t* timer) { uv_close((uv_handle_t*)timer, NULL); - touch_file(timer->loop, "watch_file"); + touch_file("watch_file"); timer_cb_touch_called++; } @@ -255,7 +361,7 @@ TEST_IMPL(fs_event_watch_dir) { remove("watch_dir/file2"); remove("watch_dir/file1"); remove("watch_dir/"); - create_dir(loop, "watch_dir"); + create_dir("watch_dir"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -268,8 +374,7 @@ TEST_IMPL(fs_event_watch_dir) { uv_run(loop, UV_RUN_DEFAULT); - ASSERT(fs_event_cb_called == 2 * fs_event_file_count); - ASSERT(fs_event_created == fs_event_file_count); + ASSERT(fs_event_cb_called == fs_event_created + fs_event_removed); ASSERT(close_cb_called == 2); /* Cleanup */ @@ -282,6 +387,50 @@ TEST_IMPL(fs_event_watch_dir) { return 0; } +TEST_IMPL(fs_event_watch_dir_recursive) { +#if defined(__APPLE__) || defined(_WIN32) + uv_loop_t* loop; + int r; + + /* Setup */ + loop = uv_default_loop(); + fs_event_unlink_files(NULL); + remove("watch_dir/file2"); + remove("watch_dir/file1"); + remove("watch_dir/subdir"); + remove("watch_dir/"); + create_dir("watch_dir"); + create_dir("watch_dir/subdir"); + + r = uv_fs_event_init(loop, &fs_event); + ASSERT(r == 0); + r = uv_fs_event_start(&fs_event, fs_event_cb_dir_multi_file_in_subdir, "watch_dir", UV_FS_EVENT_RECURSIVE); + ASSERT(r == 0); + r = uv_timer_init(loop, &timer); + ASSERT(r == 0); + r = uv_timer_start(&timer, fs_event_create_files_in_subdir, 100, 0); + ASSERT(r == 0); + + uv_run(loop, UV_RUN_DEFAULT); + + ASSERT(fs_event_cb_called == fs_event_created + fs_event_removed); + ASSERT(close_cb_called == 2); + + /* Cleanup */ + fs_event_unlink_files_in_subdir(NULL); + remove("watch_dir/file2"); + remove("watch_dir/file1"); + remove("watch_dir/subdir"); + remove("watch_dir/"); + + MAKE_VALGRIND_HAPPY(); + return 0; +#else + RETURN_SKIP("Recursive directory watching not supported on this platform."); +#endif +} + + TEST_IMPL(fs_event_watch_file) { uv_loop_t* loop = uv_default_loop(); int r; @@ -290,9 +439,9 @@ TEST_IMPL(fs_event_watch_file) { remove("watch_dir/file2"); remove("watch_dir/file1"); remove("watch_dir/"); - create_dir(loop, "watch_dir"); - create_file(loop, "watch_dir/file1"); - create_file(loop, "watch_dir/file2"); + create_dir("watch_dir"); + create_file("watch_dir/file1"); + create_file("watch_dir/file2"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -348,7 +497,7 @@ TEST_IMPL(fs_event_watch_file_current_dir) { /* Setup */ remove("watch_file"); - create_file(loop, "watch_file"); + create_file("watch_file"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -362,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); @@ -389,8 +538,8 @@ TEST_IMPL(fs_event_no_callback_after_close) { /* Setup */ remove("watch_dir/file1"); remove("watch_dir/"); - create_dir(loop, "watch_dir"); - create_file(loop, "watch_dir/file1"); + create_dir("watch_dir"); + create_file("watch_dir/file1"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -402,7 +551,7 @@ TEST_IMPL(fs_event_no_callback_after_close) { uv_close((uv_handle_t*)&fs_event, close_cb); - touch_file(loop, "watch_dir/file1"); + touch_file("watch_dir/file1"); uv_run(loop, UV_RUN_DEFAULT); ASSERT(fs_event_cb_called == 0); @@ -423,8 +572,8 @@ TEST_IMPL(fs_event_no_callback_on_close) { /* Setup */ remove("watch_dir/file1"); remove("watch_dir/"); - create_dir(loop, "watch_dir"); - create_file(loop, "watch_dir/file1"); + create_dir("watch_dir"); + create_file("watch_dir/file1"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -497,8 +646,8 @@ TEST_IMPL(fs_event_close_with_pending_event) { loop = uv_default_loop(); - create_dir(loop, "watch_dir"); - create_file(loop, "watch_dir/file"); + create_dir("watch_dir"); + create_file("watch_dir/file"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -506,7 +655,7 @@ TEST_IMPL(fs_event_close_with_pending_event) { ASSERT(r == 0); /* Generate an fs event. */ - touch_file(loop, "watch_dir/file"); + touch_file("watch_dir/file"); uv_close((uv_handle_t*)&fs_event, close_cb); @@ -554,12 +703,12 @@ TEST_IMPL(fs_event_close_in_callback) { loop = uv_default_loop(); - create_dir(loop, "watch_dir"); - create_file(loop, "watch_dir/file1"); - create_file(loop, "watch_dir/file2"); - create_file(loop, "watch_dir/file3"); - create_file(loop, "watch_dir/file4"); - create_file(loop, "watch_dir/file5"); + create_dir("watch_dir"); + create_file("watch_dir/file1"); + create_file("watch_dir/file2"); + create_file("watch_dir/file3"); + create_file("watch_dir/file4"); + create_file("watch_dir/file5"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -567,11 +716,11 @@ TEST_IMPL(fs_event_close_in_callback) { ASSERT(r == 0); /* Generate a couple of fs events. */ - touch_file(loop, "watch_dir/file1"); - touch_file(loop, "watch_dir/file2"); - touch_file(loop, "watch_dir/file3"); - touch_file(loop, "watch_dir/file4"); - touch_file(loop, "watch_dir/file5"); + touch_file("watch_dir/file1"); + touch_file("watch_dir/file2"); + touch_file("watch_dir/file3"); + touch_file("watch_dir/file4"); + touch_file("watch_dir/file5"); uv_run(loop, UV_RUN_DEFAULT); @@ -600,7 +749,7 @@ TEST_IMPL(fs_event_start_and_close) { loop = uv_default_loop(); - create_dir(loop, "watch_dir"); + create_dir("watch_dir"); r = uv_fs_event_init(loop, &fs_event1); ASSERT(r == 0); @@ -630,7 +779,7 @@ TEST_IMPL(fs_event_getpath) { char buf[1024]; size_t len; - create_dir(loop, "watch_dir"); + create_dir("watch_dir"); r = uv_fs_event_init(loop, &fs_event); ASSERT(r == 0); @@ -692,7 +841,7 @@ TEST_IMPL(fs_event_error_reporting) { TEST_FILE_LIMIT(ARRAY_SIZE(loops) * 3); remove("watch_dir/"); - create_dir(uv_default_loop(), "watch_dir"); + create_dir("watch_dir"); /* Create a lot of loops, and start FSEventStream in each of them. * Eventually, this should create enough streams to make FSEventStreamStart() diff --git a/deps/uv/test/test-fs.c b/deps/uv/test/test-fs.c index a0600b30797dd9..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; @@ -119,7 +120,7 @@ static void check_permission(const char* filename, unsigned int mode) { uv_fs_t req; uv_stat_t* s; - r = uv_fs_stat(uv_default_loop(), &req, filename, NULL); + r = uv_fs_stat(NULL, &req, filename, NULL); ASSERT(r == 0); ASSERT(req.result == 0); @@ -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++; @@ -402,7 +432,7 @@ static void check_mkdtemp_result(uv_fs_t* req) { check_permission(req->path, 0700); /* Check if req->path is actually a directory */ - r = uv_fs_stat(uv_default_loop(), &stat_req, req->path, NULL); + r = uv_fs_stat(NULL, &stat_req, req->path, NULL); ASSERT(r == 0); ASSERT(((uv_stat_t*)stat_req.ptr)->st_mode & S_IFDIR); uv_fs_req_cleanup(&stat_req); @@ -427,6 +457,28 @@ static void rmdir_cb(uv_fs_t* req) { } +static void assert_is_file_type(uv_dirent_t dent) { +#ifdef HAVE_DIRENT_TYPES + /* + * For Apple and Windows, we know getdents is expected to work but for other + * environments, the filesystem dictates whether or not getdents supports + * returning the file type. + * + * See: + * http://man7.org/linux/man-pages/man2/getdents.2.html + * https://github.com/libuv/libuv/issues/501 + */ + #if defined(__APPLE__) || defined(_WIN32) + ASSERT(dent.type == UV_DIRENT_FILE); + #else + ASSERT(dent.type == UV_DIRENT_FILE || dent.type == UV_DIRENT_UNKNOWN); + #endif +#else + ASSERT(dent.type == UV_DIRENT_UNKNOWN); +#endif +} + + static void scandir_cb(uv_fs_t* req) { uv_dirent_t dent; ASSERT(req == &scandir_req); @@ -436,11 +488,7 @@ static void scandir_cb(uv_fs_t* req) { while (UV_EOF != uv_fs_scandir_next(req, &dent)) { ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0); -#ifdef HAVE_DIRENT_TYPES - ASSERT(dent.type == UV_DIRENT_FILE); -#else - ASSERT(dent.type == UV_DIRENT_UNKNOWN); -#endif + assert_is_file_type(dent); } scandir_cb_count++; ASSERT(req->path); @@ -521,7 +569,7 @@ TEST_IMPL(fs_file_noent) { loop = uv_default_loop(); - r = uv_fs_open(loop, &req, "does_not_exist", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &req, "does_not_exist", O_RDONLY, 0, NULL); ASSERT(r == UV_ENOENT); ASSERT(req.result == UV_ENOENT); uv_fs_req_cleanup(&req); @@ -549,7 +597,7 @@ TEST_IMPL(fs_file_nametoolong) { memset(name, 'a', TOO_LONG_NAME_LENGTH); name[TOO_LONG_NAME_LENGTH] = 0; - r = uv_fs_open(loop, &req, name, O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &req, name, O_RDONLY, 0, NULL); ASSERT(r == UV_ENAMETOOLONG); ASSERT(req.result == UV_ENAMETOOLONG); uv_fs_req_cleanup(&req); @@ -572,7 +620,7 @@ TEST_IMPL(fs_file_loop) { loop = uv_default_loop(); unlink("test_symlink"); - r = uv_fs_symlink(loop, &req, "test_symlink", "test_symlink", 0, NULL); + r = uv_fs_symlink(NULL, &req, "test_symlink", "test_symlink", 0, NULL); #ifdef _WIN32 /* * Windows XP and Server 2003 don't support symlinks; we'll get UV_ENOTSUP. @@ -585,7 +633,7 @@ TEST_IMPL(fs_file_loop) { ASSERT(r == 0); uv_fs_req_cleanup(&req); - r = uv_fs_open(loop, &req, "test_symlink", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &req, "test_symlink", O_RDONLY, 0, NULL); ASSERT(r == UV_ELOOP); ASSERT(req.result == UV_ELOOP); uv_fs_req_cleanup(&req); @@ -730,63 +778,62 @@ TEST_IMPL(fs_file_sync) { uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(write_req.result >= 0); uv_fs_req_cleanup(&write_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_file", O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(read_req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); uv_fs_req_cleanup(&read_req); - r = uv_fs_ftruncate(loop, &ftruncate_req, open_req1.result, 7, NULL); + r = uv_fs_ftruncate(NULL, &ftruncate_req, open_req1.result, 7, NULL); ASSERT(r == 0); ASSERT(ftruncate_req.result == 0); uv_fs_req_cleanup(&ftruncate_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_rename(loop, &rename_req, "test_file", "test_file2", NULL); + r = uv_fs_rename(NULL, &rename_req, "test_file", "test_file2", NULL); ASSERT(r == 0); ASSERT(rename_req.result == 0); uv_fs_req_cleanup(&rename_req); - r = uv_fs_open(loop, &open_req1, "test_file2", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file2", O_RDONLY, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, - NULL); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(read_req.result >= 0); ASSERT(strcmp(buf, "test-bu") == 0); uv_fs_req_cleanup(&read_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_unlink(loop, &unlink_req, "test_file2", NULL); + r = uv_fs_unlink(NULL, &unlink_req, "test_file2", NULL); ASSERT(r == 0); ASSERT(unlink_req.result == 0); uv_fs_req_cleanup(&unlink_req); @@ -808,19 +855,19 @@ TEST_IMPL(fs_file_write_null_buffer) { loop = uv_default_loop(); - r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(NULL, 0); - r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r == 0); ASSERT(write_req.result == 0); uv_fs_req_cleanup(&write_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); @@ -850,19 +897,19 @@ TEST_IMPL(fs_async_dir) { ASSERT(mkdir_cb_count == 1); /* Create 2 files synchronously. */ - r = uv_fs_open(loop, &open_req1, "test_dir/file1", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_dir/file1", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); uv_fs_req_cleanup(&open_req1); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_dir/file2", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_dir/file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); uv_fs_req_cleanup(&open_req1); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&close_req); @@ -873,17 +920,13 @@ TEST_IMPL(fs_async_dir) { ASSERT(scandir_cb_count == 1); /* sync uv_fs_scandir */ - r = uv_fs_scandir(loop, &scandir_req, "test_dir", 0, NULL); + r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); ASSERT(r == 2); ASSERT(scandir_req.result == 2); ASSERT(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0); -#ifdef HAVE_DIRENT_TYPES - ASSERT(dent.type == UV_DIRENT_FILE); -#else - ASSERT(dent.type == UV_DIRENT_UNKNOWN); -#endif + assert_is_file_type(dent); } uv_fs_req_cleanup(&scandir_req); ASSERT(!scandir_req.ptr); @@ -957,12 +1000,12 @@ TEST_IMPL(fs_async_sendfile) { ASSERT(r == 0); /* Test starts here. */ - r = uv_fs_open(loop, &open_req1, "test_file", O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); - r = uv_fs_open(loop, &open_req2, "test_file2", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req2, "test_file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req2.result >= 0); @@ -975,10 +1018,10 @@ TEST_IMPL(fs_async_sendfile) { ASSERT(sendfile_cb_count == 1); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_close(loop, &close_req, open_req2.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req2.result, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&close_req); @@ -1008,7 +1051,7 @@ TEST_IMPL(fs_mkdtemp) { ASSERT(mkdtemp_cb_count == 1); /* sync mkdtemp */ - r = uv_fs_mkdtemp(loop, &mkdtemp_req2, path_template, NULL); + r = uv_fs_mkdtemp(NULL, &mkdtemp_req2, path_template, NULL); ASSERT(r == 0); check_mkdtemp_result(&mkdtemp_req2); @@ -1040,7 +1083,7 @@ TEST_IMPL(fs_fstat) { loop = uv_default_loop(); - r = uv_fs_open(loop, &req, "test_file", O_RDWR | O_CREAT, + r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); @@ -1048,12 +1091,12 @@ TEST_IMPL(fs_fstat) { uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &req, file, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); ASSERT(r == sizeof(test_buf)); ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); - r = uv_fs_fstat(loop, &req, file, NULL); + r = uv_fs_fstat(NULL, &req, file, NULL); ASSERT(r == 0); ASSERT(req.result == 0); s = req.ptr; @@ -1130,7 +1173,7 @@ TEST_IMPL(fs_fstat) { ASSERT(fstat_cb_count == 1); - r = uv_fs_close(loop, &req, file, NULL); + r = uv_fs_close(NULL, &req, file, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1161,7 +1204,7 @@ TEST_IMPL(fs_access) { loop = uv_default_loop(); /* File should not exist */ - r = uv_fs_access(loop, &req, "test_file", F_OK, NULL); + r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); ASSERT(r < 0); ASSERT(req.result < 0); uv_fs_req_cleanup(&req); @@ -1174,7 +1217,7 @@ TEST_IMPL(fs_access) { access_cb_count = 0; /* reset for the next test */ /* Create file */ - r = uv_fs_open(loop, &req, "test_file", O_RDWR | O_CREAT, + r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); @@ -1182,7 +1225,7 @@ TEST_IMPL(fs_access) { uv_fs_req_cleanup(&req); /* File should exist */ - r = uv_fs_access(loop, &req, "test_file", F_OK, NULL); + r = uv_fs_access(NULL, &req, "test_file", F_OK, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1195,17 +1238,17 @@ TEST_IMPL(fs_access) { access_cb_count = 0; /* reset for the next test */ /* Close file */ - r = uv_fs_close(loop, &req, file, NULL); + r = uv_fs_close(NULL, &req, file, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); /* Directory access */ - r = uv_fs_mkdir(loop, &req, "test_dir", 0777, NULL); + r = uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&req); - r = uv_fs_access(loop, &req, "test_dir", W_OK, NULL); + r = uv_fs_access(NULL, &req, "test_dir", W_OK, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1235,7 +1278,7 @@ TEST_IMPL(fs_chmod) { loop = uv_default_loop(); - r = uv_fs_open(loop, &req, "test_file", O_RDWR | O_CREAT, + r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); @@ -1243,14 +1286,14 @@ TEST_IMPL(fs_chmod) { uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &req, file, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); ASSERT(r == sizeof(test_buf)); ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); #ifndef _WIN32 /* Make the file write-only */ - r = uv_fs_chmod(loop, &req, "test_file", 0200, NULL); + r = uv_fs_chmod(NULL, &req, "test_file", 0200, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1259,7 +1302,7 @@ TEST_IMPL(fs_chmod) { #endif /* Make the file read-only */ - r = uv_fs_chmod(loop, &req, "test_file", 0400, NULL); + r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1267,7 +1310,7 @@ TEST_IMPL(fs_chmod) { check_permission("test_file", 0400); /* Make the file read+write with sync uv_fs_fchmod */ - r = uv_fs_fchmod(loop, &req, file, 0600, NULL); + r = uv_fs_fchmod(NULL, &req, file, 0600, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1333,7 +1376,7 @@ TEST_IMPL(fs_unlink_readonly) { loop = uv_default_loop(); - r = uv_fs_open(loop, + r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, @@ -1345,7 +1388,7 @@ TEST_IMPL(fs_unlink_readonly) { uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &req, file, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); ASSERT(r == sizeof(test_buf)); ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); @@ -1353,7 +1396,7 @@ TEST_IMPL(fs_unlink_readonly) { close(file); /* Make the file read-only */ - r = uv_fs_chmod(loop, &req, "test_file", 0400, NULL); + r = uv_fs_chmod(NULL, &req, "test_file", 0400, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1361,7 +1404,7 @@ TEST_IMPL(fs_unlink_readonly) { check_permission("test_file", 0400); /* Try to unlink the file */ - r = uv_fs_unlink(loop, &req, "test_file", NULL); + r = uv_fs_unlink(NULL, &req, "test_file", NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1373,7 +1416,7 @@ TEST_IMPL(fs_unlink_readonly) { uv_run(loop, UV_RUN_DEFAULT); /* Cleanup. */ - uv_fs_chmod(loop, &req, "test_file", 0600, NULL); + uv_fs_chmod(NULL, &req, "test_file", 0600, NULL); uv_fs_req_cleanup(&req); unlink("test_file"); @@ -1392,7 +1435,7 @@ TEST_IMPL(fs_chown) { loop = uv_default_loop(); - r = uv_fs_open(loop, &req, "test_file", O_RDWR | O_CREAT, + r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); @@ -1400,13 +1443,13 @@ TEST_IMPL(fs_chown) { uv_fs_req_cleanup(&req); /* sync chown */ - r = uv_fs_chown(loop, &req, "test_file", -1, -1, NULL); + r = uv_fs_chown(NULL, &req, "test_file", -1, -1, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); /* sync fchown */ - r = uv_fs_fchown(loop, &req, file, -1, -1, NULL); + r = uv_fs_fchown(NULL, &req, file, -1, -1, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); @@ -1458,7 +1501,7 @@ TEST_IMPL(fs_link) { loop = uv_default_loop(); - r = uv_fs_open(loop, &req, "test_file", O_RDWR | O_CREAT, + r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); @@ -1466,7 +1509,7 @@ TEST_IMPL(fs_link) { uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &req, file, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); ASSERT(r == sizeof(test_buf)); ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); @@ -1474,12 +1517,12 @@ TEST_IMPL(fs_link) { close(file); /* sync link */ - r = uv_fs_link(loop, &req, "test_file", "test_file_link", NULL); + r = uv_fs_link(NULL, &req, "test_file", "test_file_link", NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); - r = uv_fs_open(loop, &req, "test_file_link", O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &req, "test_file_link", O_RDWR, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); link = req.result; @@ -1487,7 +1530,7 @@ TEST_IMPL(fs_link) { memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &req, link, &iov, 1, 0, NULL); + r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); @@ -1500,7 +1543,7 @@ TEST_IMPL(fs_link) { uv_run(loop, UV_RUN_DEFAULT); ASSERT(link_cb_count == 1); - r = uv_fs_open(loop, &req, "test_file_link2", O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &req, "test_file_link2", O_RDWR, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); link = req.result; @@ -1508,7 +1551,7 @@ TEST_IMPL(fs_link) { memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &req, link, &iov, 1, 0, NULL); + r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); @@ -1542,7 +1585,37 @@ TEST_IMPL(fs_readlink) { ASSERT(req.result == UV_ENOENT); uv_fs_req_cleanup(&req); - ASSERT(UV_ENOENT == uv_fs_readlink(loop, &req, "no_such_file", NULL)); + ASSERT(UV_ENOENT == uv_fs_readlink(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_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); @@ -1557,6 +1630,8 @@ TEST_IMPL(fs_symlink) { 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"); @@ -1564,10 +1639,18 @@ 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(); - r = uv_fs_open(loop, &req, "test_file", O_RDWR | O_CREAT, + r = uv_fs_open(NULL, &req, "test_file", O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); @@ -1575,7 +1658,7 @@ TEST_IMPL(fs_symlink) { uv_fs_req_cleanup(&req); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &req, file, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &req, file, &iov, 1, -1, NULL); ASSERT(r == sizeof(test_buf)); ASSERT(req.result == sizeof(test_buf)); uv_fs_req_cleanup(&req); @@ -1583,7 +1666,7 @@ TEST_IMPL(fs_symlink) { close(file); /* sync symlink */ - r = uv_fs_symlink(loop, &req, "test_file", "test_file_symlink", 0, NULL); + r = uv_fs_symlink(NULL, &req, "test_file", "test_file_symlink", 0, NULL); #ifdef _WIN32 if (r < 0) { if (r == UV_ENOTSUP) { @@ -1605,7 +1688,7 @@ TEST_IMPL(fs_symlink) { ASSERT(req.result == 0); uv_fs_req_cleanup(&req); - r = uv_fs_open(loop, &req, "test_file_symlink", O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &req, "test_file_symlink", O_RDWR, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); link = req.result; @@ -1613,14 +1696,14 @@ TEST_IMPL(fs_symlink) { memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &req, link, &iov, 1, 0, NULL); + r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); close(link); - r = uv_fs_symlink(loop, + r = uv_fs_symlink(NULL, &req, "test_file_symlink", "test_file_symlink_symlink", @@ -1629,11 +1712,29 @@ TEST_IMPL(fs_symlink) { ASSERT(r == 0); uv_fs_req_cleanup(&req); - r = uv_fs_readlink(loop, &req, "test_file_symlink_symlink", NULL); + r = uv_fs_readlink(NULL, &req, "test_file_symlink_symlink", NULL); ASSERT(r == 0); 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, @@ -1645,7 +1746,7 @@ TEST_IMPL(fs_symlink) { uv_run(loop, UV_RUN_DEFAULT); ASSERT(symlink_cb_count == 1); - r = uv_fs_open(loop, &req, "test_file_symlink2", O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &req, "test_file_symlink2", O_RDWR, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); link = req.result; @@ -1653,14 +1754,14 @@ TEST_IMPL(fs_symlink) { memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &req, link, &iov, 1, 0, NULL); + r = uv_fs_read(NULL, &req, link, &iov, 1, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); close(link); - r = uv_fs_symlink(loop, + r = uv_fs_symlink(NULL, &req, "test_file_symlink2", "test_file_symlink2_symlink", @@ -1674,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. @@ -1697,44 +1812,48 @@ 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(); - uv_fs_mkdir(loop, &req, "test_dir", 0777, NULL); + uv_fs_mkdir(NULL, &req, "test_dir", 0777, NULL); 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 - r = uv_fs_symlink(loop, &req, test_dir, "test_dir_symlink", + r = uv_fs_symlink(NULL, &req, test_dir, "test_dir_symlink", UV_FS_SYMLINK_JUNCTION, NULL); + fprintf(stderr, "r == %i\n", r); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); - r = uv_fs_stat(loop, &req, "test_dir_symlink", NULL); + r = uv_fs_stat(NULL, &req, "test_dir_symlink", NULL); ASSERT(r == 0); ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFDIR); uv_fs_req_cleanup(&req); - r = uv_fs_lstat(loop, &req, "test_dir_symlink", NULL); + r = uv_fs_lstat(NULL, &req, "test_dir_symlink", NULL); ASSERT(r == 0); ASSERT(((uv_stat_t*)req.ptr)->st_mode & S_IFLNK); #ifdef _WIN32 @@ -1744,7 +1863,7 @@ TEST_IMPL(fs_symlink_dir) { #endif uv_fs_req_cleanup(&req); - r = uv_fs_readlink(loop, &req, "test_dir_symlink", NULL); + r = uv_fs_readlink(NULL, &req, "test_dir_symlink", NULL); ASSERT(r == 0); #ifdef _WIN32 ASSERT(strcmp(req.ptr, test_dir + 4) == 0); @@ -1753,57 +1872,68 @@ TEST_IMPL(fs_symlink_dir) { #endif uv_fs_req_cleanup(&req); - r = uv_fs_open(loop, &open_req1, "test_dir/file1", O_WRONLY | O_CREAT, + 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); uv_fs_req_cleanup(&open_req1); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_dir/file2", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_dir/file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); uv_fs_req_cleanup(&open_req1); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_scandir(loop, &scandir_req, "test_dir_symlink", 0, NULL); + r = uv_fs_scandir(NULL, &scandir_req, "test_dir_symlink", 0, NULL); ASSERT(r == 2); ASSERT(scandir_req.result == 2); ASSERT(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0); -#ifdef HAVE_DIRENT_TYPES - ASSERT(dent.type == UV_DIRENT_FILE); -#else - ASSERT(dent.type == UV_DIRENT_UNKNOWN); -#endif + assert_is_file_type(dent); } uv_fs_req_cleanup(&scandir_req); ASSERT(!scandir_req.ptr); /* unlink will remove the directory symlink */ - r = uv_fs_unlink(loop, &req, "test_dir_symlink", NULL); + r = uv_fs_unlink(NULL, &req, "test_dir_symlink", NULL); ASSERT(r == 0); uv_fs_req_cleanup(&req); - r = uv_fs_scandir(loop, &scandir_req, "test_dir_symlink", 0, NULL); + r = uv_fs_scandir(NULL, &scandir_req, "test_dir_symlink", 0, NULL); ASSERT(r == UV_ENOENT); uv_fs_req_cleanup(&scandir_req); - r = uv_fs_scandir(loop, &scandir_req, "test_dir", 0, NULL); + r = uv_fs_scandir(NULL, &scandir_req, "test_dir", 0, NULL); ASSERT(r == 2); ASSERT(scandir_req.result == 2); ASSERT(scandir_req.ptr); while (UV_EOF != uv_fs_scandir_next(&scandir_req, &dent)) { ASSERT(strcmp(dent.name, "file1") == 0 || strcmp(dent.name, "file2") == 0); -#ifdef HAVE_DIRENT_TYPES - ASSERT(dent.type == UV_DIRENT_FILE); -#else - ASSERT(dent.type == UV_DIRENT_UNKNOWN); -#endif + assert_is_file_type(dent); } uv_fs_req_cleanup(&scandir_req); ASSERT(!scandir_req.ptr); @@ -1830,8 +1960,7 @@ TEST_IMPL(fs_utime) { /* Setup. */ loop = uv_default_loop(); unlink(path); - r = uv_fs_open(loop, &req, path, O_RDWR | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(NULL, &req, path, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); uv_fs_req_cleanup(&req); @@ -1839,12 +1968,12 @@ TEST_IMPL(fs_utime) { atime = mtime = 400497753; /* 1982-09-10 11:22:33 */ - r = uv_fs_utime(loop, &req, path, atime, mtime, NULL); + r = uv_fs_utime(NULL, &req, path, atime, mtime, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); - r = uv_fs_stat(loop, &req, path, NULL); + r = uv_fs_stat(NULL, &req, path, NULL); ASSERT(r == 0); ASSERT(req.result == 0); check_utime(path, atime, mtime); @@ -1875,26 +2004,26 @@ TEST_IMPL(fs_stat_root) { int r; uv_loop_t* loop = uv_default_loop(); - r = uv_fs_stat(loop, &stat_req, "\\", NULL); + r = uv_fs_stat(NULL, &stat_req, "\\", NULL); ASSERT(r == 0); - r = uv_fs_stat(loop, &stat_req, "..\\..\\..\\..\\..\\..\\..", NULL); + r = uv_fs_stat(NULL, &stat_req, "..\\..\\..\\..\\..\\..\\..", NULL); ASSERT(r == 0); - r = uv_fs_stat(loop, &stat_req, "..", NULL); + r = uv_fs_stat(NULL, &stat_req, "..", NULL); ASSERT(r == 0); - r = uv_fs_stat(loop, &stat_req, "..\\", NULL); + r = uv_fs_stat(NULL, &stat_req, "..\\", NULL); ASSERT(r == 0); /* stats the current directory on c: */ - r = uv_fs_stat(loop, &stat_req, "c:", NULL); + r = uv_fs_stat(NULL, &stat_req, "c:", NULL); ASSERT(r == 0); - r = uv_fs_stat(loop, &stat_req, "c:\\", NULL); + r = uv_fs_stat(NULL, &stat_req, "c:\\", NULL); ASSERT(r == 0); - r = uv_fs_stat(loop, &stat_req, "\\\\?\\C:\\", NULL); + r = uv_fs_stat(NULL, &stat_req, "\\\\?\\C:\\", NULL); ASSERT(r == 0); MAKE_VALGRIND_HAPPY(); @@ -1915,8 +2044,7 @@ TEST_IMPL(fs_futime) { /* Setup. */ loop = uv_default_loop(); unlink(path); - r = uv_fs_open(loop, &req, path, O_RDWR | O_CREAT, - S_IWUSR | S_IRUSR, NULL); + r = uv_fs_open(NULL, &req, path, O_RDWR | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); uv_fs_req_cleanup(&req); @@ -1924,18 +2052,18 @@ TEST_IMPL(fs_futime) { atime = mtime = 400497753; /* 1982-09-10 11:22:33 */ - r = uv_fs_open(loop, &req, path, O_RDWR, 0, NULL); + r = uv_fs_open(NULL, &req, path, O_RDWR, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); file = req.result; /* FIXME probably not how it's supposed to be used */ uv_fs_req_cleanup(&req); - r = uv_fs_futime(loop, &req, file, atime, mtime, NULL); + r = uv_fs_futime(NULL, &req, file, atime, mtime, NULL); ASSERT(r == 0); ASSERT(req.result == 0); uv_fs_req_cleanup(&req); - r = uv_fs_stat(loop, &req, path, NULL); + r = uv_fs_stat(NULL, &req, path, NULL); ASSERT(r == 0); ASSERT(req.result == 0); check_utime(path, atime, mtime); @@ -1968,7 +2096,7 @@ TEST_IMPL(fs_stat_missing_path) { loop = uv_default_loop(); - r = uv_fs_stat(loop, &req, "non_existent_file", NULL); + r = uv_fs_stat(NULL, &req, "non_existent_file", NULL); ASSERT(r == UV_ENOENT); ASSERT(req.result == UV_ENOENT); uv_fs_req_cleanup(&req); @@ -1987,13 +2115,13 @@ TEST_IMPL(fs_scandir_empty_dir) { path = "./empty_dir/"; loop = uv_default_loop(); - uv_fs_mkdir(loop, &req, path, 0777, NULL); + uv_fs_mkdir(NULL, &req, path, 0777, NULL); uv_fs_req_cleanup(&req); /* Fill the req to ensure that required fields are cleaned up */ memset(&req, 0xdb, sizeof(req)); - r = uv_fs_scandir(loop, &req, path, 0, NULL); + r = uv_fs_scandir(NULL, &req, path, 0, NULL); ASSERT(r == 0); ASSERT(req.result == 0); ASSERT(req.ptr == NULL); @@ -2007,7 +2135,7 @@ TEST_IMPL(fs_scandir_empty_dir) { uv_run(loop, UV_RUN_DEFAULT); ASSERT(scandir_cb_count == 1); - uv_fs_rmdir(loop, &req, path, NULL); + uv_fs_rmdir(NULL, &req, path, NULL); uv_fs_req_cleanup(&req); MAKE_VALGRIND_HAPPY(); @@ -2022,7 +2150,7 @@ TEST_IMPL(fs_scandir_file) { path = "test/fixtures/empty_file"; loop = uv_default_loop(); - r = uv_fs_scandir(loop, &scandir_req, path, 0, NULL); + r = uv_fs_scandir(NULL, &scandir_req, path, 0, NULL); ASSERT(r == UV_ENOTDIR); uv_fs_req_cleanup(&scandir_req); @@ -2046,14 +2174,14 @@ TEST_IMPL(fs_open_dir) { path = "."; loop = uv_default_loop(); - r = uv_fs_open(loop, &req, path, O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &req, path, O_RDONLY, 0, NULL); ASSERT(r >= 0); ASSERT(req.result >= 0); ASSERT(req.ptr == NULL); file = r; uv_fs_req_cleanup(&req); - r = uv_fs_close(loop, &req, file, NULL); + r = uv_fs_close(NULL, &req, file, NULL); ASSERT(r == 0); r = uv_fs_open(loop, &req, path, O_RDONLY, 0, open_cb_simple); @@ -2076,47 +2204,46 @@ TEST_IMPL(fs_file_open_append) { loop = uv_default_loop(); - r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(write_req.result >= 0); uv_fs_req_cleanup(&write_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_file", O_RDWR | O_APPEND, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDWR | O_APPEND, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(write_req.result >= 0); uv_fs_req_cleanup(&write_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_file", O_RDONLY, S_IRUSR, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, - NULL); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); printf("read = %d\n", r); ASSERT(r == 26); ASSERT(read_req.result == 26); @@ -2125,7 +2252,7 @@ TEST_IMPL(fs_file_open_append) { sizeof("test-buffer\n\0test-buffer\n\0") - 1) == 0); uv_fs_req_cleanup(&read_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); @@ -2147,54 +2274,53 @@ TEST_IMPL(fs_rename_to_existing_file) { loop = uv_default_loop(); - r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(write_req.result >= 0); uv_fs_req_cleanup(&write_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_file2", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_file2", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_rename(loop, &rename_req, "test_file", "test_file2", NULL); + r = uv_fs_rename(NULL, &rename_req, "test_file", "test_file2", NULL); ASSERT(r == 0); ASSERT(rename_req.result == 0); uv_fs_req_cleanup(&rename_req); - r = uv_fs_open(loop, &open_req1, "test_file2", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file2", O_RDONLY, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, - NULL); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(read_req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); uv_fs_req_cleanup(&read_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); @@ -2216,44 +2342,44 @@ TEST_IMPL(fs_read_file_eof) { loop = uv_default_loop(); - r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); iov = uv_buf_init(test_buf, sizeof(test_buf)); - r = uv_fs_write(loop, &write_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(write_req.result >= 0); uv_fs_req_cleanup(&write_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_file", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); memset(buf, 0, sizeof(buf)); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, -1, NULL); + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, -1, NULL); ASSERT(r >= 0); ASSERT(read_req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, read_req.result, NULL); ASSERT(r == 0); ASSERT(read_req.result == 0); uv_fs_req_cleanup(&read_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); @@ -2275,7 +2401,7 @@ TEST_IMPL(fs_write_multiple_bufs) { loop = uv_default_loop(); - r = uv_fs_open(loop, &open_req1, "test_file", O_WRONLY | O_CREAT, + r = uv_fs_open(NULL, &open_req1, "test_file", O_WRONLY | O_CREAT, S_IWUSR | S_IRUSR, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); @@ -2283,17 +2409,17 @@ TEST_IMPL(fs_write_multiple_bufs) { iovs[0] = uv_buf_init(test_buf, sizeof(test_buf)); iovs[1] = uv_buf_init(test_buf2, sizeof(test_buf2)); - r = uv_fs_write(loop, &write_req, open_req1.result, iovs, 2, 0, NULL); + r = uv_fs_write(NULL, &write_req, open_req1.result, iovs, 2, 0, NULL); ASSERT(r >= 0); ASSERT(write_req.result >= 0); uv_fs_req_cleanup(&write_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); - r = uv_fs_open(loop, &open_req1, "test_file", O_RDONLY, 0, NULL); + r = uv_fs_open(NULL, &open_req1, "test_file", O_RDONLY, 0, NULL); ASSERT(r >= 0); ASSERT(open_req1.result >= 0); uv_fs_req_cleanup(&open_req1); @@ -2303,7 +2429,7 @@ TEST_IMPL(fs_write_multiple_bufs) { /* Read the strings back to separate buffers. */ iovs[0] = uv_buf_init(buf, sizeof(test_buf)); iovs[1] = uv_buf_init(buf2, sizeof(test_buf2)); - r = uv_fs_read(loop, &read_req, open_req1.result, iovs, 2, 0, NULL); + r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, 2, 0, NULL); ASSERT(r >= 0); ASSERT(read_req.result >= 0); ASSERT(strcmp(buf, test_buf) == 0); @@ -2311,13 +2437,13 @@ TEST_IMPL(fs_write_multiple_bufs) { uv_fs_req_cleanup(&read_req); iov = uv_buf_init(buf, sizeof(buf)); - r = uv_fs_read(loop, &read_req, open_req1.result, &iov, 1, + r = uv_fs_read(NULL, &read_req, open_req1.result, &iov, 1, read_req.result, NULL); ASSERT(r == 0); ASSERT(read_req.result == 0); uv_fs_req_cleanup(&read_req); - r = uv_fs_close(loop, &close_req, open_req1.result, NULL); + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); ASSERT(r == 0); ASSERT(close_req.result == 0); uv_fs_req_cleanup(&close_req); @@ -2328,3 +2454,211 @@ TEST_IMPL(fs_write_multiple_bufs) { MAKE_VALGRIND_HAPPY(); return 0; } + + +TEST_IMPL(fs_write_alotof_bufs) { + const size_t iovcount = 54321; + uv_buf_t* iovs; + char* buffer; + size_t index; + int r; + + /* Setup. */ + unlink("test_file"); + + loop = uv_default_loop(); + + iovs = malloc(sizeof(*iovs) * iovcount); + ASSERT(iovs != NULL); + + r = uv_fs_open(NULL, + &open_req1, + "test_file", + O_RDWR | O_CREAT, + S_IWUSR | S_IRUSR, + NULL); + ASSERT(r >= 0); + ASSERT(open_req1.result >= 0); + uv_fs_req_cleanup(&open_req1); + + for (index = 0; index < iovcount; ++index) + iovs[index] = uv_buf_init(test_buf, sizeof(test_buf)); + + r = uv_fs_write(NULL, + &write_req, + open_req1.result, + iovs, + iovcount, + -1, + NULL); + ASSERT(r >= 0); + ASSERT((size_t)write_req.result == sizeof(test_buf) * iovcount); + uv_fs_req_cleanup(&write_req); + + /* Read the strings back to separate buffers. */ + buffer = malloc(sizeof(test_buf) * iovcount); + ASSERT(buffer != NULL); + + for (index = 0; index < iovcount; ++index) + iovs[index] = uv_buf_init(buffer + index * sizeof(test_buf), + sizeof(test_buf)); + + r = uv_fs_read(NULL, &read_req, open_req1.result, iovs, iovcount, 0, NULL); + ASSERT(r >= 0); + ASSERT((size_t)read_req.result == sizeof(test_buf) * iovcount); + + for (index = 0; index < iovcount; ++index) + ASSERT(strncmp(buffer + index * sizeof(test_buf), + test_buf, + sizeof(test_buf)) == 0); + + uv_fs_req_cleanup(&read_req); + free(buffer); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, + &read_req, + open_req1.result, + &iov, + 1, + read_req.result, + NULL); + ASSERT(r == 0); + ASSERT(read_req.result == 0); + uv_fs_req_cleanup(&read_req); + + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + /* Cleanup */ + unlink("test_file"); + free(iovs); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + +TEST_IMPL(fs_write_alotof_bufs_with_offset) { + const size_t iovcount = 54321; + uv_buf_t* iovs; + char* buffer; + size_t index; + int r; + int64_t offset; + char* filler = "0123456789"; + int filler_len = strlen(filler); + + /* Setup. */ + unlink("test_file"); + + loop = uv_default_loop(); + + iovs = malloc(sizeof(*iovs) * iovcount); + ASSERT(iovs != NULL); + + r = uv_fs_open(NULL, + &open_req1, + "test_file", + O_RDWR | O_CREAT, + S_IWUSR | S_IRUSR, + NULL); + ASSERT(r >= 0); + ASSERT(open_req1.result >= 0); + uv_fs_req_cleanup(&open_req1); + + iov = uv_buf_init(filler, filler_len); + r = uv_fs_write(NULL, &write_req, open_req1.result, &iov, 1, -1, NULL); + ASSERT(r == filler_len); + ASSERT(write_req.result == filler_len); + uv_fs_req_cleanup(&write_req); + offset = (int64_t)r; + + for (index = 0; index < iovcount; ++index) + iovs[index] = uv_buf_init(test_buf, sizeof(test_buf)); + + r = uv_fs_write(NULL, + &write_req, + open_req1.result, + iovs, + iovcount, + offset, + NULL); + ASSERT(r >= 0); + ASSERT((size_t)write_req.result == sizeof(test_buf) * iovcount); + uv_fs_req_cleanup(&write_req); + + /* Read the strings back to separate buffers. */ + buffer = malloc(sizeof(test_buf) * iovcount); + ASSERT(buffer != NULL); + + for (index = 0; index < iovcount; ++index) + iovs[index] = uv_buf_init(buffer + index * sizeof(test_buf), + sizeof(test_buf)); + + r = uv_fs_read(NULL, &read_req, open_req1.result, + iovs, iovcount, offset, NULL); + ASSERT(r >= 0); + ASSERT(read_req.result == sizeof(test_buf) * iovcount); + + for (index = 0; index < iovcount; ++index) + ASSERT(strncmp(buffer + index * sizeof(test_buf), + test_buf, + sizeof(test_buf)) == 0); + + uv_fs_req_cleanup(&read_req); + free(buffer); + + r = uv_fs_stat(NULL, &stat_req, "test_file", NULL); + ASSERT(r == 0); + ASSERT((int64_t)((uv_stat_t*)stat_req.ptr)->st_size == + offset + (int64_t)(iovcount * sizeof(test_buf))); + uv_fs_req_cleanup(&stat_req); + + iov = uv_buf_init(buf, sizeof(buf)); + r = uv_fs_read(NULL, + &read_req, + open_req1.result, + &iov, + 1, + read_req.result + offset, + NULL); + ASSERT(r == 0); + ASSERT(read_req.result == 0); + uv_fs_req_cleanup(&read_req); + + r = uv_fs_close(NULL, &close_req, open_req1.result, NULL); + ASSERT(r == 0); + ASSERT(close_req.result == 0); + uv_fs_req_cleanup(&close_req); + + /* Cleanup */ + unlink("test_file"); + free(iovs); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + +TEST_IMPL(fs_read_write_null_arguments) { + int r; + + r = uv_fs_read(NULL, NULL, 0, NULL, 0, -1, NULL); + ASSERT(r == UV_EINVAL); + + r = uv_fs_write(NULL, NULL, 0, NULL, 0, -1, NULL); + ASSERT(r == UV_EINVAL); + + iov = uv_buf_init(NULL, 0); + r = uv_fs_read(NULL, NULL, 0, &iov, 0, -1, NULL); + ASSERT(r == UV_EINVAL); + + iov = uv_buf_init(NULL, 0); + r = uv_fs_write(NULL, NULL, 0, &iov, 0, -1, NULL); + ASSERT(r == UV_EINVAL); + + return 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-ipc.c b/deps/uv/test/test-ipc.c index ed8c4dd7f00c8e..f018c2d4d49b7f 100644 --- a/deps/uv/test/test-ipc.c +++ b/deps/uv/test/test-ipc.c @@ -52,6 +52,7 @@ typedef struct { } tcp_conn; #define CONN_COUNT 100 +#define BACKLOG 128 static void close_server_conn_cb(uv_handle_t* handle) { @@ -179,7 +180,7 @@ static void on_read(uv_stream_t* handle, r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); ASSERT(r == 0); - r = uv_listen((uv_stream_t*)&tcp_server, 12, on_connection); + r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, on_connection); ASSERT(r == 0); tcp_server_listening = 1; @@ -242,22 +243,22 @@ static void on_read_listen_after_bound_twice(uv_stream_t* handle, ASSERT(pending == UV_TCP); r = uv_tcp_init(uv_default_loop(), &tcp_server); ASSERT(r == 0); - + r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server); ASSERT(r == 0); - - r = uv_listen((uv_stream_t*)&tcp_server, 12, on_connection); - ASSERT(r == 0); + + r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, on_connection); + ASSERT(r == 0); } else if (read_cb_called == 2) { /* Accept the second TCP server, and start listening on it. */ ASSERT(pending == UV_TCP); r = uv_tcp_init(uv_default_loop(), &tcp_server2); ASSERT(r == 0); - + r = uv_accept((uv_stream_t*)pipe, (uv_stream_t*)&tcp_server2); ASSERT(r == 0); - - r = uv_listen((uv_stream_t*)&tcp_server2, 12, on_connection); + + r = uv_listen((uv_stream_t*)&tcp_server2, BACKLOG, on_connection); ASSERT(r == UV_EADDRINUSE); uv_close((uv_handle_t*)&tcp_server, NULL); @@ -652,7 +653,7 @@ int ipc_helper(int listen_after_write) { ASSERT(r == 0); if (!listen_after_write) { - r = uv_listen((uv_stream_t*)&tcp_server, 12, ipc_on_connection); + r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection); ASSERT(r == 0); } @@ -662,7 +663,7 @@ int ipc_helper(int listen_after_write) { ASSERT(r == 0); if (listen_after_write) { - r = uv_listen((uv_stream_t*)&tcp_server, 12, ipc_on_connection); + r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection); ASSERT(r == 0); } @@ -703,7 +704,7 @@ int ipc_helper_tcp_connection(void) { r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); ASSERT(r == 0); - r = uv_listen((uv_stream_t*)&tcp_server, 12, ipc_on_connection_tcp_conn); + r = uv_listen((uv_stream_t*)&tcp_server, BACKLOG, ipc_on_connection_tcp_conn); ASSERT(r == 0); /* Make a connection to the server */ @@ -772,7 +773,7 @@ int ipc_helper_bind_twice(void) { r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); ASSERT(r == 0); - + MAKE_VALGRIND_HAPPY(); return 0; } diff --git a/deps/uv/test/test-list.h b/deps/uv/test/test-list.h index 1e4018c98b8685..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) @@ -66,6 +68,7 @@ TEST_DECLARE (tcp_write_fail) TEST_DECLARE (tcp_try_write) TEST_DECLARE (tcp_write_queue_order) TEST_DECLARE (tcp_open) +TEST_DECLARE (tcp_open_twice) TEST_DECLARE (tcp_connect_error_after_write) TEST_DECLARE (tcp_shutdown_after_write) TEST_DECLARE (tcp_bind_error_addrinuse) @@ -80,6 +83,10 @@ TEST_DECLARE (tcp_connect_error_fault) TEST_DECLARE (tcp_connect_timeout) TEST_DECLARE (tcp_close_while_connecting) TEST_DECLARE (tcp_close) +TEST_DECLARE (tcp_create_early) +TEST_DECLARE (tcp_create_early_bad_bind) +TEST_DECLARE (tcp_create_early_bad_domain) +TEST_DECLARE (tcp_create_early_accept) #ifndef _WIN32 TEST_DECLARE (tcp_close_accept) TEST_DECLARE (tcp_oob) @@ -95,6 +102,9 @@ TEST_DECLARE (tcp_bind6_error_inval) TEST_DECLARE (tcp_bind6_localhost_ok) TEST_DECLARE (udp_bind) TEST_DECLARE (udp_bind_reuseaddr) +TEST_DECLARE (udp_create_early) +TEST_DECLARE (udp_create_early_bad_bind) +TEST_DECLARE (udp_create_early_bad_domain) TEST_DECLARE (udp_send_and_recv) TEST_DECLARE (udp_send_immediate) TEST_DECLARE (udp_send_unreachable) @@ -110,10 +120,12 @@ TEST_DECLARE (udp_options) TEST_DECLARE (udp_options6) TEST_DECLARE (udp_no_autobind) TEST_DECLARE (udp_open) +TEST_DECLARE (udp_open_twice) TEST_DECLARE (udp_try_send) TEST_DECLARE (pipe_bind_error_addrinuse) TEST_DECLARE (pipe_bind_error_addrnotavail) TEST_DECLARE (pipe_bind_error_inval) +TEST_DECLARE (pipe_connect_multiple) TEST_DECLARE (pipe_listen_without_bind) TEST_DECLARE (pipe_connect_bad_name) TEST_DECLARE (pipe_connect_to_file) @@ -121,6 +133,7 @@ TEST_DECLARE (pipe_connect_on_prepare) TEST_DECLARE (pipe_getsockname) TEST_DECLARE (pipe_getsockname_abstract) TEST_DECLARE (pipe_getsockname_blocking) +TEST_DECLARE (pipe_pending_instances) TEST_DECLARE (pipe_sendmsg) TEST_DECLARE (pipe_server_close) TEST_DECLARE (connection_fail) @@ -221,6 +234,7 @@ TEST_DECLARE (spawn_stdout_and_stderr_to_file_swap) TEST_DECLARE (spawn_auto_unref) TEST_DECLARE (spawn_closed_process_io) TEST_DECLARE (spawn_reads_child_path) +TEST_DECLARE (spawn_inherit_streams) TEST_DECLARE (fs_poll) TEST_DECLARE (fs_poll_getpath) TEST_DECLARE (kill) @@ -240,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) @@ -248,6 +263,7 @@ TEST_DECLARE (fs_file_open_append) TEST_DECLARE (fs_stat_missing_path) TEST_DECLARE (fs_read_file_eof) TEST_DECLARE (fs_event_watch_dir) +TEST_DECLARE (fs_event_watch_dir_recursive) TEST_DECLARE (fs_event_watch_file) TEST_DECLARE (fs_event_watch_file_twice) TEST_DECLARE (fs_event_watch_file_current_dir) @@ -264,6 +280,9 @@ TEST_DECLARE (fs_scandir_file) TEST_DECLARE (fs_open_dir) TEST_DECLARE (fs_rename_to_existing_file) TEST_DECLARE (fs_write_multiple_bufs) +TEST_DECLARE (fs_read_write_null_arguments) +TEST_DECLARE (fs_write_alotof_bufs) +TEST_DECLARE (fs_write_alotof_bufs_with_offset) TEST_DECLARE (threadpool_queue_work_simple) TEST_DECLARE (threadpool_queue_work_einval) TEST_DECLARE (threadpool_multiple_event_loops) @@ -275,6 +294,7 @@ TEST_DECLARE (threadpool_cancel_single) TEST_DECLARE (thread_local_storage) TEST_DECLARE (thread_mutex) TEST_DECLARE (thread_rwlock) +TEST_DECLARE (thread_rwlock_trylock) TEST_DECLARE (thread_create) TEST_DECLARE (thread_equal) TEST_DECLARE (dlerror) @@ -289,8 +309,10 @@ TEST_DECLARE (ip6_addr_link_local) TEST_DECLARE (poll_close_doesnt_corrupt_stack) TEST_DECLARE (poll_closesocket) TEST_DECLARE (spawn_detect_pipe_name_collisions_on_windows) +#if !defined(USING_UV_SHARED) TEST_DECLARE (argument_escaping) TEST_DECLARE (environment_creation) +#endif TEST_DECLARE (listen_with_simultaneous_accepts) TEST_DECLARE (listen_no_simultaneous_accepts) TEST_DECLARE (fs_stat_root) @@ -315,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) @@ -361,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) @@ -393,6 +418,7 @@ TASK_LIST_START TEST_ENTRY (tcp_open) TEST_HELPER (tcp_open, tcp4_echo_server) + TEST_ENTRY (tcp_open_twice) TEST_ENTRY (tcp_shutdown_after_write) TEST_HELPER (tcp_shutdown_after_write, tcp4_echo_server) @@ -410,6 +436,10 @@ TASK_LIST_START TEST_ENTRY (tcp_connect_timeout) TEST_ENTRY (tcp_close_while_connecting) TEST_ENTRY (tcp_close) + TEST_ENTRY (tcp_create_early) + TEST_ENTRY (tcp_create_early_bad_bind) + TEST_ENTRY (tcp_create_early_bad_domain) + TEST_ENTRY (tcp_create_early_accept) #ifndef _WIN32 TEST_ENTRY (tcp_close_accept) TEST_ENTRY (tcp_oob) @@ -429,6 +459,9 @@ TASK_LIST_START TEST_ENTRY (udp_bind) TEST_ENTRY (udp_bind_reuseaddr) + TEST_ENTRY (udp_create_early) + TEST_ENTRY (udp_create_early_bad_bind) + TEST_ENTRY (udp_create_early_bad_domain) TEST_ENTRY (udp_send_and_recv) TEST_ENTRY (udp_send_immediate) TEST_ENTRY (udp_send_unreachable) @@ -447,14 +480,17 @@ TASK_LIST_START TEST_ENTRY (udp_open) TEST_HELPER (udp_open, udp4_echo_server) + TEST_ENTRY (udp_open_twice) TEST_ENTRY (pipe_bind_error_addrinuse) TEST_ENTRY (pipe_bind_error_addrnotavail) TEST_ENTRY (pipe_bind_error_inval) + TEST_ENTRY (pipe_connect_multiple) TEST_ENTRY (pipe_listen_without_bind) TEST_ENTRY (pipe_getsockname) TEST_ENTRY (pipe_getsockname_abstract) TEST_ENTRY (pipe_getsockname_blocking) + TEST_ENTRY (pipe_pending_instances) TEST_ENTRY (pipe_sendmsg) TEST_ENTRY (connection_fail) @@ -590,6 +626,7 @@ TASK_LIST_START TEST_ENTRY (spawn_auto_unref) TEST_ENTRY (spawn_closed_process_io) TEST_ENTRY (spawn_reads_child_path) + TEST_ENTRY (spawn_inherit_streams) TEST_ENTRY (fs_poll) TEST_ENTRY (fs_poll_getpath) TEST_ENTRY (kill) @@ -598,8 +635,10 @@ TASK_LIST_START TEST_ENTRY (poll_close_doesnt_corrupt_stack) TEST_ENTRY (poll_closesocket) TEST_ENTRY (spawn_detect_pipe_name_collisions_on_windows) +#if !defined(USING_UV_SHARED) TEST_ENTRY (argument_escaping) TEST_ENTRY (environment_creation) +# endif TEST_ENTRY (listen_with_simultaneous_accepts) TEST_ENTRY (listen_no_simultaneous_accepts) TEST_ENTRY (fs_stat_root) @@ -638,12 +677,14 @@ 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) TEST_ENTRY (fs_read_file_eof) TEST_ENTRY (fs_file_open_append) TEST_ENTRY (fs_event_watch_dir) + TEST_ENTRY (fs_event_watch_dir_recursive) TEST_ENTRY (fs_event_watch_file) TEST_ENTRY (fs_event_watch_file_twice) TEST_ENTRY (fs_event_watch_file_current_dir) @@ -660,6 +701,9 @@ TASK_LIST_START TEST_ENTRY (fs_open_dir) TEST_ENTRY (fs_rename_to_existing_file) TEST_ENTRY (fs_write_multiple_bufs) + TEST_ENTRY (fs_write_alotof_bufs) + TEST_ENTRY (fs_write_alotof_bufs_with_offset) + TEST_ENTRY (fs_read_write_null_arguments) TEST_ENTRY (threadpool_queue_work_simple) TEST_ENTRY (threadpool_queue_work_einval) TEST_ENTRY (threadpool_multiple_event_loops) @@ -671,11 +715,15 @@ TASK_LIST_START TEST_ENTRY (thread_local_storage) TEST_ENTRY (thread_mutex) TEST_ENTRY (thread_rwlock) + TEST_ENTRY (thread_rwlock_trylock) TEST_ENTRY (thread_create) TEST_ENTRY (thread_equal) 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 896f46bbed0942..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. @@ -61,3 +65,98 @@ TEST_IMPL(thread_rwlock) { return 0; } + + +/* Call when holding |mutex|. */ +static void synchronize_nowait(void) { + step += 1; + uv_cond_signal(&condvar); +} + + +/* Call when holding |mutex|. */ +static void synchronize(void) { + int current; + + 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); +} + + +static void thread_rwlock_trylock_peer(void* unused) { + (void) &unused; + + uv_mutex_lock(&mutex); + + /* 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(); + + /* Acquire write lock. */ + ASSERT(0 == uv_rwlock_trywrlock(&rwlock)); + synchronize(); + + /* 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); +} + + +TEST_IMPL(thread_rwlock_trylock) { + uv_thread_t thread; + + ASSERT(0 == uv_cond_init(&condvar)); + ASSERT(0 == uv_mutex_init(&mutex)); + ASSERT(0 == uv_rwlock_init(&rwlock)); + + uv_mutex_lock(&mutex); + ASSERT(0 == uv_thread_create(&thread, thread_rwlock_trylock_peer, NULL)); + + /* 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(); + + /* 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-pipe-connect-multiple.c b/deps/uv/test/test-pipe-connect-multiple.c new file mode 100644 index 00000000000000..3de5a9a0bf4e83 --- /dev/null +++ b/deps/uv/test/test-pipe-connect-multiple.c @@ -0,0 +1,104 @@ +/* Copyright (c) 2015 Saúl Ibarra Corretgé . + * 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 +#include + + +static int connection_cb_called = 0; +static int connect_cb_called = 0; + +#define NUM_CLIENTS 4 + +typedef struct { + uv_pipe_t pipe_handle; + uv_connect_t conn_req; +} client_t; + +static uv_pipe_t server_handle; +static client_t clients[NUM_CLIENTS]; +static uv_pipe_t connections[NUM_CLIENTS]; + + +static void connection_cb(uv_stream_t* server, int status) { + int r; + uv_pipe_t* conn; + ASSERT(status == 0); + + conn = &connections[connection_cb_called]; + r = uv_pipe_init(server->loop, conn, 0); + ASSERT(r == 0); + + r = uv_accept(server, (uv_stream_t*)conn); + ASSERT(r == 0); + + if (++connection_cb_called == NUM_CLIENTS && + connect_cb_called == NUM_CLIENTS) { + uv_stop(server->loop); + } +} + + +static void connect_cb(uv_connect_t* connect_req, int status) { + ASSERT(status == 0); + if (++connect_cb_called == NUM_CLIENTS && + connection_cb_called == NUM_CLIENTS) { + uv_stop(connect_req->handle->loop); + } +} + + +TEST_IMPL(pipe_connect_multiple) { + int i; + int r; + uv_loop_t* loop; + + loop = uv_default_loop(); + + r = uv_pipe_init(loop, &server_handle, 0); + ASSERT(r == 0); + + r = uv_pipe_bind(&server_handle, TEST_PIPENAME); + ASSERT(r == 0); + + r = uv_listen((uv_stream_t*)&server_handle, 128, connection_cb); + ASSERT(r == 0); + + for (i = 0; i < NUM_CLIENTS; i++) { + r = uv_pipe_init(loop, &clients[i].pipe_handle, 0); + ASSERT(r == 0); + uv_pipe_connect(&clients[i].conn_req, + &clients[i].pipe_handle, + TEST_PIPENAME, + connect_cb); + } + + uv_run(loop, UV_RUN_DEFAULT); + + ASSERT(connection_cb_called == NUM_CLIENTS); + ASSERT(connect_cb_called == NUM_CLIENTS); + + MAKE_VALGRIND_HAPPY(); + return 0; +} diff --git a/deps/uv/test/test-pipe-pending-instances.c b/deps/uv/test/test-pipe-pending-instances.c new file mode 100644 index 00000000000000..b6ff911a0f2ab0 --- /dev/null +++ b/deps/uv/test/test-pipe-pending-instances.c @@ -0,0 +1,59 @@ +/* Copyright (c) 2015 Saúl Ibarra Corretgé . + * 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" + + +static void connection_cb(uv_stream_t* server, int status) { + ASSERT(0 && "this will never be called"); +} + + +TEST_IMPL(pipe_pending_instances) { + int r; + uv_pipe_t pipe_handle; + uv_loop_t* loop; + + loop = uv_default_loop(); + + r = uv_pipe_init(loop, &pipe_handle, 0); + ASSERT(r == 0); + + uv_pipe_pending_instances(&pipe_handle, 8); + + r = uv_pipe_bind(&pipe_handle, TEST_PIPENAME); + ASSERT(r == 0); + + uv_pipe_pending_instances(&pipe_handle, 16); + + r = uv_listen((uv_stream_t*)&pipe_handle, 128, connection_cb); + ASSERT(r == 0); + + uv_close((uv_handle_t*)&pipe_handle, NULL); + + r = uv_run(loop, UV_RUN_DEFAULT); + ASSERT(r == 0); + + MAKE_VALGRIND_HAPPY(); + 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-signal-multiple-loops.c b/deps/uv/test/test-signal-multiple-loops.c index f8fef36ee043ce..158129919bd772 100644 --- a/deps/uv/test/test-signal-multiple-loops.c +++ b/deps/uv/test/test-signal-multiple-loops.c @@ -185,6 +185,7 @@ static void loop_creating_worker(void* context) { ASSERT(r == 0); uv_loop_close(loop); + free(loop); increment_counter(&loop_creation_counter); } while (!stop); diff --git a/deps/uv/test/test-spawn.c b/deps/uv/test/test-spawn.c index d01862abe1d97a..eba54ae7054976 100644 --- a/deps/uv/test/test-spawn.c +++ b/deps/uv/test/test-spawn.c @@ -277,7 +277,7 @@ TEST_IMPL(spawn_stdout_to_file) { init_process_options("spawn_helper2", exit_cb); - r = uv_fs_open(uv_default_loop(), &fs_req, "stdout_file", O_CREAT | O_RDWR, + r = uv_fs_open(NULL, &fs_req, "stdout_file", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ASSERT(r != -1); uv_fs_req_cleanup(&fs_req); @@ -300,11 +300,11 @@ TEST_IMPL(spawn_stdout_to_file) { ASSERT(close_cb_called == 1); buf = uv_buf_init(output, sizeof(output)); - r = uv_fs_read(uv_default_loop(), &fs_req, file, &buf, 1, 0, NULL); + r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); ASSERT(r == 12); uv_fs_req_cleanup(&fs_req); - r = uv_fs_close(uv_default_loop(), &fs_req, file, NULL); + r = uv_fs_close(NULL, &fs_req, file, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&fs_req); @@ -331,7 +331,7 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file) { init_process_options("spawn_helper6", exit_cb); - r = uv_fs_open(uv_default_loop(), &fs_req, "stdout_file", O_CREAT | O_RDWR, + r = uv_fs_open(NULL, &fs_req, "stdout_file", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ASSERT(r != -1); uv_fs_req_cleanup(&fs_req); @@ -356,11 +356,11 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file) { ASSERT(close_cb_called == 1); buf = uv_buf_init(output, sizeof(output)); - r = uv_fs_read(uv_default_loop(), &fs_req, file, &buf, 1, 0, NULL); + r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); ASSERT(r == 27); uv_fs_req_cleanup(&fs_req); - r = uv_fs_close(uv_default_loop(), &fs_req, file, NULL); + r = uv_fs_close(NULL, &fs_req, file, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&fs_req); @@ -389,7 +389,7 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file2) { init_process_options("spawn_helper6", exit_cb); /* Replace stderr with our file */ - r = uv_fs_open(uv_default_loop(), + r = uv_fs_open(NULL, &fs_req, "stdout_file", O_CREAT | O_RDWR, @@ -418,11 +418,11 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file2) { ASSERT(close_cb_called == 1); buf = uv_buf_init(output, sizeof(output)); - r = uv_fs_read(uv_default_loop(), &fs_req, file, &buf, 1, 0, NULL); + r = uv_fs_read(NULL, &fs_req, file, &buf, 1, 0, NULL); ASSERT(r == 27); uv_fs_req_cleanup(&fs_req); - r = uv_fs_close(uv_default_loop(), &fs_req, file, NULL); + r = uv_fs_close(NULL, &fs_req, file, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&fs_req); @@ -456,7 +456,7 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file_swap) { init_process_options("spawn_helper6", exit_cb); /* open 'stdout_file' and replace STDOUT_FILENO with it */ - r = uv_fs_open(uv_default_loop(), + r = uv_fs_open(NULL, &fs_req, "stdout_file", O_CREAT | O_RDWR, @@ -468,7 +468,7 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file_swap) { ASSERT(stdout_file != -1); /* open 'stderr_file' and replace STDERR_FILENO with it */ - r = uv_fs_open(uv_default_loop(), &fs_req, "stderr_file", O_CREAT | O_RDWR, + r = uv_fs_open(NULL, &fs_req, "stderr_file", O_CREAT | O_RDWR, S_IRUSR | S_IWUSR, NULL); ASSERT(r != -1); uv_fs_req_cleanup(&fs_req); @@ -497,11 +497,11 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file_swap) { buf = uv_buf_init(output, sizeof(output)); /* check the content of stdout_file */ - r = uv_fs_read(uv_default_loop(), &fs_req, stdout_file, &buf, 1, 0, NULL); + r = uv_fs_read(NULL, &fs_req, stdout_file, &buf, 1, 0, NULL); ASSERT(r >= 15); uv_fs_req_cleanup(&fs_req); - r = uv_fs_close(uv_default_loop(), &fs_req, stdout_file, NULL); + r = uv_fs_close(NULL, &fs_req, stdout_file, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&fs_req); @@ -509,11 +509,11 @@ TEST_IMPL(spawn_stdout_and_stderr_to_file_swap) { ASSERT(strncmp("hello errworld\n", output, 15) == 0); /* check the content of stderr_file */ - r = uv_fs_read(uv_default_loop(), &fs_req, stderr_file, &buf, 1, 0, NULL); + r = uv_fs_read(NULL, &fs_req, stderr_file, &buf, 1, 0, NULL); ASSERT(r >= 12); uv_fs_req_cleanup(&fs_req); - r = uv_fs_close(uv_default_loop(), &fs_req, stderr_file, NULL); + r = uv_fs_close(NULL, &fs_req, stderr_file, NULL); ASSERT(r == 0); uv_fs_req_cleanup(&fs_req); @@ -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, @@ -994,6 +994,7 @@ TEST_IMPL(spawn_detect_pipe_name_collisions_on_windows) { } +#if !defined(USING_UV_SHARED) int make_program_args(char** args, int verbatim_arguments, WCHAR** dst_ptr); WCHAR* quote_cmd_arg(const WCHAR *source, WCHAR *target); @@ -1196,6 +1197,7 @@ TEST_IMPL(environment_creation) { return 0; } +#endif /* Regression test for issue #909 */ TEST_IMPL(spawn_with_an_odd_path) { @@ -1397,8 +1399,9 @@ TEST_IMPL(spawn_fs_open) { uv_buf_t buf; uv_stdio_container_t stdio[1]; - fd = uv_fs_open(uv_default_loop(), &fs_req, "/dev/null", O_RDWR, 0, NULL); + fd = uv_fs_open(NULL, &fs_req, "/dev/null", O_RDWR, 0, NULL); ASSERT(fd >= 0); + uv_fs_req_cleanup(&fs_req); init_process_options("spawn_helper8", exit_cb); @@ -1415,7 +1418,7 @@ TEST_IMPL(spawn_fs_open) { ASSERT(0 == uv_write(&write_req, (uv_stream_t*) &in, &buf, 1, write_cb)); ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT)); - ASSERT(0 == uv_fs_close(uv_default_loop(), &fs_req, fd, NULL)); + ASSERT(0 == uv_fs_close(NULL, &fs_req, fd, NULL)); ASSERT(exit_cb_called == 1); ASSERT(close_cb_called == 2); /* One for `in`, one for process */ @@ -1540,3 +1543,164 @@ TEST_IMPL(spawn_reads_child_path) { MAKE_VALGRIND_HAPPY(); return 0; } + +#ifndef _WIN32 +static int mpipe(int *fds) { + if (pipe(fds) == -1) + return -1; + if (fcntl(fds[0], F_SETFD, FD_CLOEXEC) == -1 || + fcntl(fds[1], F_SETFD, FD_CLOEXEC) == -1) { + close(fds[0]); + close(fds[1]); + return -1; + } + return 0; +} +#else +static int mpipe(int *fds) { + SECURITY_ATTRIBUTES attr; + HANDLE readh, writeh; + attr.nLength = sizeof(attr); + attr.lpSecurityDescriptor = NULL; + attr.bInheritHandle = FALSE; + if (!CreatePipe(&readh, &writeh, &attr, 0)) + return -1; + fds[0] = _open_osfhandle((intptr_t)readh, 0); + fds[1] = _open_osfhandle((intptr_t)writeh, 0); + if (fds[0] == -1 || fds[1] == -1) { + CloseHandle(readh); + CloseHandle(writeh); + return -1; + } + return 0; +} +#endif /* !_WIN32 */ + +TEST_IMPL(spawn_inherit_streams) { + uv_process_t child_req; + uv_stdio_container_t child_stdio[2]; + int fds_stdin[2]; + int fds_stdout[2]; + uv_pipe_t pipe_stdin_child; + uv_pipe_t pipe_stdout_child; + uv_pipe_t pipe_stdin_parent; + uv_pipe_t pipe_stdout_parent; + unsigned char ubuf[OUTPUT_SIZE - 1]; + uv_buf_t buf; + unsigned int i; + int r; + uv_write_t write_req; + uv_loop_t* loop; + + init_process_options("spawn_helper9", exit_cb); + + loop = uv_default_loop(); + ASSERT(uv_pipe_init(loop, &pipe_stdin_child, 0) == 0); + ASSERT(uv_pipe_init(loop, &pipe_stdout_child, 0) == 0); + ASSERT(uv_pipe_init(loop, &pipe_stdin_parent, 0) == 0); + ASSERT(uv_pipe_init(loop, &pipe_stdout_parent, 0) == 0); + + ASSERT(mpipe(fds_stdin) != -1); + ASSERT(mpipe(fds_stdout) != -1); + + ASSERT(uv_pipe_open(&pipe_stdin_child, fds_stdin[0]) == 0); + ASSERT(uv_pipe_open(&pipe_stdout_child, fds_stdout[1]) == 0); + ASSERT(uv_pipe_open(&pipe_stdin_parent, fds_stdin[1]) == 0); + ASSERT(uv_pipe_open(&pipe_stdout_parent, fds_stdout[0]) == 0); + + child_stdio[0].flags = UV_INHERIT_STREAM; + child_stdio[0].data.stream = (uv_stream_t *)&pipe_stdin_child; + + child_stdio[1].flags = UV_INHERIT_STREAM; + child_stdio[1].data.stream = (uv_stream_t *)&pipe_stdout_child; + + options.stdio = child_stdio; + options.stdio_count = 2; + + ASSERT(uv_spawn(loop, &child_req, &options) == 0); + + uv_close((uv_handle_t*)&pipe_stdin_child, NULL); + uv_close((uv_handle_t*)&pipe_stdout_child, NULL); + + buf = uv_buf_init((char*)ubuf, sizeof ubuf); + for (i = 0; i < sizeof ubuf; ++i) + ubuf[i] = i & 255u; + memset(output, 0, sizeof ubuf); + + r = uv_write(&write_req, + (uv_stream_t*)&pipe_stdin_parent, + &buf, + 1, + write_cb); + ASSERT(r == 0); + + r = uv_read_start((uv_stream_t*)&pipe_stdout_parent, on_alloc, on_read); + ASSERT(r == 0); + + r = uv_run(loop, UV_RUN_DEFAULT); + ASSERT(r == 0); + + ASSERT(exit_cb_called == 1); + ASSERT(close_cb_called == 3); + + r = memcmp(ubuf, output, sizeof ubuf); + ASSERT(r == 0); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + +/* Helper for child process of spawn_inherit_streams */ +#ifndef _WIN32 +int spawn_stdin_stdout(void) { + char buf[1024]; + char* pbuf; + for (;;) { + ssize_t r, w, c; + do { + r = read(0, buf, sizeof buf); + } while (r == -1 && errno == EINTR); + if (r == 0) { + return 1; + } + ASSERT(r > 0); + c = r; + pbuf = buf; + while (c) { + do { + w = write(1, pbuf, (size_t)c); + } while (w == -1 && errno == EINTR); + ASSERT(w >= 0); + pbuf = pbuf + w; + c = c - w; + } + } + return 2; +} +#else +int spawn_stdin_stdout(void) { + char buf[1024]; + char* pbuf; + HANDLE h_stdin = GetStdHandle(STD_INPUT_HANDLE); + HANDLE h_stdout = GetStdHandle(STD_OUTPUT_HANDLE); + ASSERT(h_stdin != INVALID_HANDLE_VALUE); + ASSERT(h_stdout != INVALID_HANDLE_VALUE); + for (;;) { + DWORD n_read; + DWORD n_written; + DWORD to_write; + if (!ReadFile(h_stdin, buf, sizeof buf, &n_read, NULL)) { + ASSERT(GetLastError() == ERROR_BROKEN_PIPE); + return 1; + } + to_write = n_read; + pbuf = buf; + while (to_write) { + ASSERT(WriteFile(h_stdout, pbuf, to_write, &n_written, NULL)); + to_write -= n_written; + pbuf += n_written; + } + } + return 2; +} +#endif /* !_WIN32 */ diff --git a/deps/uv/test/test-tcp-close-while-connecting.c b/deps/uv/test/test-tcp-close-while-connecting.c index 0a69a0ddee7f8f..2c39b652b61078 100644 --- a/deps/uv/test/test-tcp-close-while-connecting.c +++ b/deps/uv/test/test-tcp-close-while-connecting.c @@ -59,14 +59,18 @@ TEST_IMPL(tcp_close_while_connecting) { uv_connect_t connect_req; struct sockaddr_in addr; uv_loop_t* loop; + int r; loop = uv_default_loop(); ASSERT(0 == uv_ip4_addr("1.2.3.4", TEST_PORT, &addr)); ASSERT(0 == uv_tcp_init(loop, &tcp_handle)); - ASSERT(0 == uv_tcp_connect(&connect_req, - &tcp_handle, - (const struct sockaddr*) &addr, - connect_cb)); + r = uv_tcp_connect(&connect_req, + &tcp_handle, + (const struct sockaddr*) &addr, + connect_cb); + if (r == UV_ENETUNREACH) + RETURN_SKIP("Network unreachable."); + ASSERT(r == 0); ASSERT(0 == uv_timer_init(loop, &timer1_handle)); ASSERT(0 == uv_timer_start(&timer1_handle, timer1_cb, 50, 0)); ASSERT(0 == uv_timer_init(loop, &timer2_handle)); diff --git a/deps/uv/test/test-tcp-connect-timeout.c b/deps/uv/test/test-tcp-connect-timeout.c index a22c773c6d818b..081424b80023cf 100644 --- a/deps/uv/test/test-tcp-connect-timeout.c +++ b/deps/uv/test/test-tcp-connect-timeout.c @@ -79,6 +79,8 @@ TEST_IMPL(tcp_connect_timeout) { &conn, (const struct sockaddr*) &addr, connect_cb); + if (r == UV_ENETUNREACH) + RETURN_SKIP("Network unreachable."); ASSERT(r == 0); r = uv_run(uv_default_loop(), UV_RUN_DEFAULT); diff --git a/deps/uv/test/test-tcp-create-socket-early.c b/deps/uv/test/test-tcp-create-socket-early.c new file mode 100644 index 00000000000000..65650adcc27919 --- /dev/null +++ b/deps/uv/test/test-tcp-create-socket-early.c @@ -0,0 +1,206 @@ +/* Copyright (c) 2015 Saúl Ibarra Corretgé . + * 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 + +#ifdef _WIN32 +# define INVALID_FD (INVALID_HANDLE_VALUE) +#else +# define INVALID_FD (-1) +#endif + + +static void on_connect(uv_connect_t* req, int status) { + ASSERT(status == 0); + uv_close((uv_handle_t*) req->handle, NULL); +} + + +static void on_connection(uv_stream_t* server, int status) { + uv_tcp_t* handle; + int r; + + ASSERT(status == 0); + + handle = malloc(sizeof(*handle)); + ASSERT(handle != NULL); + + r = uv_tcp_init_ex(server->loop, handle, AF_INET); + ASSERT(r == 0); + + r = uv_accept(server, (uv_stream_t*)handle); + ASSERT(r == UV_EBUSY); + + uv_close((uv_handle_t*) server, NULL); + uv_close((uv_handle_t*) handle, (uv_close_cb)free); +} + + +static void tcp_listener(uv_loop_t* loop, uv_tcp_t* server) { + struct sockaddr_in addr; + int r; + + ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + + r = uv_tcp_init(loop, server); + ASSERT(r == 0); + + r = uv_tcp_bind(server, (const struct sockaddr*) &addr, 0); + ASSERT(r == 0); + + r = uv_listen((uv_stream_t*) server, 128, on_connection); + ASSERT(r == 0); +} + + +static void tcp_connector(uv_loop_t* loop, uv_tcp_t* client, uv_connect_t* req) { + struct sockaddr_in server_addr; + int r; + + ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &server_addr)); + + r = uv_tcp_init(loop, client); + ASSERT(r == 0); + + r = uv_tcp_connect(req, + client, + (const struct sockaddr*) &server_addr, + on_connect); + ASSERT(r == 0); +} + + +TEST_IMPL(tcp_create_early) { + struct sockaddr_in addr; + struct sockaddr_in sockname; + uv_tcp_t client; + uv_os_fd_t fd; + int r, namelen; + + ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + + r = uv_tcp_init_ex(uv_default_loop(), &client, AF_INET); + ASSERT(r == 0); + + r = uv_fileno((const uv_handle_t*) &client, &fd); + ASSERT(r == 0); + ASSERT(fd != INVALID_FD); + + /* Windows returns WSAEINVAL if the socket is not bound */ +#ifndef _WIN32 + namelen = sizeof sockname; + r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); + ASSERT(r == 0); + ASSERT(sockname.sin_family == AF_INET); +#endif + + r = uv_tcp_bind(&client, (const struct sockaddr*) &addr, 0); + ASSERT(r == 0); + + namelen = sizeof sockname; + r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); + ASSERT(r == 0); + ASSERT(memcmp(&addr.sin_addr, + &sockname.sin_addr, + sizeof(addr.sin_addr)) == 0); + + uv_close((uv_handle_t*) &client, NULL); + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + +TEST_IMPL(tcp_create_early_bad_bind) { + struct sockaddr_in addr; + uv_tcp_t client; + uv_os_fd_t fd; + int r; + + ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + + r = uv_tcp_init_ex(uv_default_loop(), &client, AF_INET6); + ASSERT(r == 0); + + r = uv_fileno((const uv_handle_t*) &client, &fd); + ASSERT(r == 0); + ASSERT(fd != INVALID_FD); + + /* Windows returns WSAEINVAL if the socket is not bound */ +#ifndef _WIN32 + { + int namelen; + struct sockaddr_in6 sockname; + namelen = sizeof sockname; + r = uv_tcp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); + ASSERT(r == 0); + ASSERT(sockname.sin6_family == AF_INET6); + } +#endif + + r = uv_tcp_bind(&client, (const struct sockaddr*) &addr, 0); +#ifndef _WIN32 + ASSERT(r == UV_EINVAL); +#else + ASSERT(r == UV_EFAULT); +#endif + + uv_close((uv_handle_t*) &client, NULL); + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + +TEST_IMPL(tcp_create_early_bad_domain) { + uv_tcp_t client; + int r; + + r = uv_tcp_init_ex(uv_default_loop(), &client, 47); + ASSERT(r == UV_EINVAL); + + r = uv_tcp_init_ex(uv_default_loop(), &client, 1024); + ASSERT(r == UV_EINVAL); + + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + +TEST_IMPL(tcp_create_early_accept) { + uv_tcp_t client, server; + uv_connect_t connect_req; + + tcp_listener(uv_default_loop(), &server); + tcp_connector(uv_default_loop(), &client, &connect_req); + + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} diff --git a/deps/uv/test/test-tcp-open.c b/deps/uv/test/test-tcp-open.c index edeacc70e4faf9..6c8d43d0009e79 100644 --- a/deps/uv/test/test-tcp-open.c +++ b/deps/uv/test/test-tcp-open.c @@ -71,6 +71,17 @@ static uv_os_sock_t create_tcp_socket(void) { } +static void close_socket(uv_os_sock_t sock) { + int r; +#ifdef _WIN32 + r = closesocket(sock); +#else + r = close(sock); +#endif + ASSERT(r == 0); +} + + static void alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { @@ -180,3 +191,30 @@ TEST_IMPL(tcp_open) { MAKE_VALGRIND_HAPPY(); return 0; } + + +TEST_IMPL(tcp_open_twice) { + uv_tcp_t client; + uv_os_sock_t sock1, sock2; + int r; + + startup(); + sock1 = create_tcp_socket(); + sock2 = create_tcp_socket(); + + r = uv_tcp_init(uv_default_loop(), &client); + ASSERT(r == 0); + + r = uv_tcp_open(&client, sock1); + ASSERT(r == 0); + + r = uv_tcp_open(&client, sock2); + ASSERT(r == UV_EBUSY); + close_socket(sock2); + + uv_close((uv_handle_t*) &client, NULL); + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} diff --git a/deps/uv/test/test-tcp-squelch-connreset.c b/deps/uv/test/test-tcp-squelch-connreset.c new file mode 100644 index 00000000000000..f1c57437977918 --- /dev/null +++ b/deps/uv/test/test-tcp-squelch-connreset.c @@ -0,0 +1,119 @@ +/* Copyright (c) 2015, Santiago Gimeno + * + * 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 +#include + + +static uv_tcp_t tcp_server; +static uv_tcp_t tcp_client; +static uv_tcp_t tcp_server_client; +static uv_connect_t connect_req; +static uv_write_t write_req; + +static void alloc_cb(uv_handle_t* handle, + size_t size, + uv_buf_t* buf) { + buf->base = malloc(size); + buf->len = size; +} + +static void read_cb(uv_stream_t* tcp, ssize_t nread, const uv_buf_t* buf) { + free(buf->base); + ASSERT(nread == UV_EOF); +} + +static void on_connect(uv_connect_t* req, int status) { + int r; + uv_buf_t outbuf; + + ASSERT(req != NULL); + ASSERT(status == 0); + + outbuf = uv_buf_init("ping", 4); + r = uv_write(&write_req, (uv_stream_t*) req->handle, &outbuf, 1, NULL); + ASSERT(r == 0); + + r = uv_read_start((uv_stream_t*) req->handle, alloc_cb, read_cb); + ASSERT(r == 0); +} + +static void on_connection(uv_stream_t* server, int status) { + int r; + + ASSERT(status == 0); + + r = uv_tcp_init(uv_default_loop(), &tcp_server_client); + ASSERT(r == 0); + + r = uv_accept(server, (uv_stream_t*) &tcp_server_client); + ASSERT(r == 0); + + uv_close((uv_handle_t*) &tcp_server_client, NULL); + uv_close((uv_handle_t*) &tcp_server, NULL); +} + +static void start_server(void) { + struct sockaddr_in addr; + int r; + + ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr)); + + r = uv_tcp_init(uv_default_loop(), &tcp_server); + ASSERT(r == 0); + + r = uv_tcp_bind(&tcp_server, (const struct sockaddr*) &addr, 0); + ASSERT(r == 0); + + r = uv_listen((uv_stream_t*) &tcp_server, SOMAXCONN, on_connection); + ASSERT(r == 0); +} + +static void start_client(void) { + struct sockaddr_in addr; + int r; + + ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + + r = uv_tcp_init(uv_default_loop(), &tcp_client); + ASSERT(r == 0); + + r = uv_tcp_connect(&connect_req, + &tcp_client, + (const struct sockaddr*) &addr, + on_connect); + ASSERT(r == 0); +} + + +TEST_IMPL(tcp_squelch_connreset) { + + start_server(); + + start_client(); + + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} 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 f999cba818f924..784c1739f6d47e 100644 --- a/deps/uv/test/test-threadpool-cancel.c +++ b/deps/uv/test/test-threadpool-cancel.c @@ -276,13 +276,15 @@ 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; INIT_CANCEL_INFO(&ci, reqs); loop = uv_default_loop(); saturate_threadpool(); + iov = uv_buf_init(NULL, 0); /* Needs to match ARRAY_SIZE(fs_reqs). */ n = 0; @@ -300,9 +302,10 @@ TEST_IMPL(threadpool_cancel_fs) { ASSERT(0 == uv_fs_lstat(loop, reqs + n++, "/", fs_cb)); ASSERT(0 == uv_fs_mkdir(loop, reqs + n++, "/", 0, fs_cb)); ASSERT(0 == uv_fs_open(loop, reqs + n++, "/", 0, 0, fs_cb)); - ASSERT(0 == uv_fs_read(loop, reqs + n++, 0, NULL, 0, 0, fs_cb)); + 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)); @@ -310,7 +313,7 @@ TEST_IMPL(threadpool_cancel_fs) { ASSERT(0 == uv_fs_symlink(loop, reqs + n++, "/", "/", 0, fs_cb)); ASSERT(0 == uv_fs_unlink(loop, reqs + n++, "/", fs_cb)); ASSERT(0 == uv_fs_utime(loop, reqs + n++, "/", 0, 0, fs_cb)); - ASSERT(0 == uv_fs_write(loop, reqs + n++, 0, NULL, 0, 0, fs_cb)); + ASSERT(0 == uv_fs_write(loop, reqs + n++, 0, &iov, 1, 0, fs_cb)); ASSERT(n == ARRAY_SIZE(reqs)); ASSERT(0 == uv_timer_init(loop, &ci.timer_handle)); 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-create-socket-early.c b/deps/uv/test/test-udp-create-socket-early.c new file mode 100644 index 00000000000000..3d0152428b8bc9 --- /dev/null +++ b/deps/uv/test/test-udp-create-socket-early.c @@ -0,0 +1,132 @@ +/* Copyright (c) 2015 Saúl Ibarra Corretgé . + * 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 + +#ifdef _WIN32 +# define INVALID_FD (INVALID_HANDLE_VALUE) +#else +# define INVALID_FD (-1) +#endif + + +TEST_IMPL(udp_create_early) { + struct sockaddr_in addr; + struct sockaddr_in sockname; + uv_udp_t client; + uv_os_fd_t fd; + int r, namelen; + + ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + + r = uv_udp_init_ex(uv_default_loop(), &client, AF_INET); + ASSERT(r == 0); + + r = uv_fileno((const uv_handle_t*) &client, &fd); + ASSERT(r == 0); + ASSERT(fd != INVALID_FD); + + /* Windows returns WSAEINVAL if the socket is not bound */ +#ifndef _WIN32 + namelen = sizeof sockname; + r = uv_udp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); + ASSERT(r == 0); + ASSERT(sockname.sin_family == AF_INET); +#endif + + r = uv_udp_bind(&client, (const struct sockaddr*) &addr, 0); + ASSERT(r == 0); + + namelen = sizeof sockname; + r = uv_udp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); + ASSERT(r == 0); + ASSERT(memcmp(&addr.sin_addr, + &sockname.sin_addr, + sizeof(addr.sin_addr)) == 0); + + uv_close((uv_handle_t*) &client, NULL); + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + +TEST_IMPL(udp_create_early_bad_bind) { + struct sockaddr_in addr; + uv_udp_t client; + uv_os_fd_t fd; + int r; + + ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr)); + + r = uv_udp_init_ex(uv_default_loop(), &client, AF_INET6); + ASSERT(r == 0); + + r = uv_fileno((const uv_handle_t*) &client, &fd); + ASSERT(r == 0); + ASSERT(fd != INVALID_FD); + + /* Windows returns WSAEINVAL if the socket is not bound */ +#ifndef _WIN32 + { + int namelen; + struct sockaddr_in6 sockname; + namelen = sizeof sockname; + r = uv_udp_getsockname(&client, (struct sockaddr*) &sockname, &namelen); + ASSERT(r == 0); + ASSERT(sockname.sin6_family == AF_INET6); + } +#endif + + r = uv_udp_bind(&client, (const struct sockaddr*) &addr, 0); +#ifndef _WIN32 + ASSERT(r == UV_EINVAL); +#else + ASSERT(r == UV_EFAULT); +#endif + + uv_close((uv_handle_t*) &client, NULL); + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} + + +TEST_IMPL(udp_create_early_bad_domain) { + uv_udp_t client; + int r; + + r = uv_udp_init_ex(uv_default_loop(), &client, 47); + ASSERT(r == UV_EINVAL); + + r = uv_udp_init_ex(uv_default_loop(), &client, 1024); + ASSERT(r == UV_EINVAL); + + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} 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-interface.c b/deps/uv/test/test-udp-multicast-interface.c index f0679c578e2fc0..71001a77e03e18 100644 --- a/deps/uv/test/test-udp-multicast-interface.c +++ b/deps/uv/test/test-udp-multicast-interface.c @@ -44,7 +44,7 @@ static void close_cb(uv_handle_t* handle) { static void sv_send_cb(uv_udp_send_t* req, int status) { ASSERT(req != NULL); - ASSERT(status == 0); + ASSERT(status == 0 || status == UV_ENETUNREACH); CHECK_HANDLE(req->handle); sv_send_cb_called++; diff --git a/deps/uv/test/test-udp-multicast-join.c b/deps/uv/test/test-udp-multicast-join.c index 686edf3d22d59a..6110a8d922a0b9 100644 --- a/deps/uv/test/test-udp-multicast-join.c +++ b/deps/uv/test/test-udp-multicast-join.c @@ -116,6 +116,8 @@ TEST_IMPL(udp_multicast_join) { /* join the multicast channel */ r = uv_udp_set_membership(&client, "239.255.0.1", NULL, UV_JOIN_GROUP); + if (r == UV_ENODEV) + RETURN_SKIP("No multicast support."); ASSERT(r == 0); r = uv_udp_recv_start(&client, alloc_cb, cl_recv_cb); diff --git a/deps/uv/test/test-udp-multicast-join6.c b/deps/uv/test/test-udp-multicast-join6.c index 9ba201ab9eba98..f635bdb9e14ee2 100644 --- a/deps/uv/test/test-udp-multicast-join6.c +++ b/deps/uv/test/test-udp-multicast-join6.c @@ -119,11 +119,16 @@ 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); #endif + if (r == UV_ENODEV) { + MAKE_VALGRIND_HAPPY(); + RETURN_SKIP("No ipv6 multicast route"); + } + ASSERT(r == 0); r = uv_udp_recv_start(&client, alloc_cb, cl_recv_cb); diff --git a/deps/uv/test/test-udp-multicast-ttl.c b/deps/uv/test/test-udp-multicast-ttl.c index bed0ea134259d5..7f1af9b9dd9bd2 100644 --- a/deps/uv/test/test-udp-multicast-ttl.c +++ b/deps/uv/test/test-udp-multicast-ttl.c @@ -44,7 +44,7 @@ static void close_cb(uv_handle_t* handle) { static void sv_send_cb(uv_udp_send_t* req, int status) { ASSERT(req != NULL); - ASSERT(status == 0); + ASSERT(status == 0 || status == UV_ENETUNREACH); CHECK_HANDLE(req->handle); sv_send_cb_called++; diff --git a/deps/uv/test/test-udp-open.c b/deps/uv/test/test-udp-open.c index b2b6117784b810..4d77f45d367eae 100644 --- a/deps/uv/test/test-udp-open.c +++ b/deps/uv/test/test-udp-open.c @@ -67,6 +67,17 @@ static uv_os_sock_t create_udp_socket(void) { } +static void close_socket(uv_os_sock_t sock) { + int r; +#ifdef _WIN32 + r = closesocket(sock); +#else + r = close(sock); +#endif + ASSERT(r == 0); +} + + static void alloc_cb(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { @@ -164,3 +175,30 @@ TEST_IMPL(udp_open) { MAKE_VALGRIND_HAPPY(); return 0; } + + +TEST_IMPL(udp_open_twice) { + uv_udp_t client; + uv_os_sock_t sock1, sock2; + int r; + + startup(); + sock1 = create_udp_socket(); + sock2 = create_udp_socket(); + + r = uv_udp_init(uv_default_loop(), &client); + ASSERT(r == 0); + + r = uv_udp_open(&client, sock1); + ASSERT(r == 0); + + r = uv_udp_open(&client, sock2); + ASSERT(r == UV_EBUSY); + close_socket(sock2); + + uv_close((uv_handle_t*) &client, NULL); + uv_run(uv_default_loop(), UV_RUN_DEFAULT); + + MAKE_VALGRIND_HAPPY(); + return 0; +} diff --git a/deps/uv/uv.gyp b/deps/uv/uv.gyp index 7173a827a371ed..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', @@ -326,8 +333,10 @@ 'test/test-ping-pong.c', 'test/test-pipe-bind-error.c', 'test/test-pipe-connect-error.c', + 'test/test-pipe-connect-multiple.c', 'test/test-pipe-connect-prepare.c', 'test/test-pipe-getsockname.c', + 'test/test-pipe-pending-instances.c', 'test/test-pipe-sendmsg.c', 'test/test-pipe-server-close.c', 'test/test-pipe-close-stdout-read-stdin.c', @@ -338,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', @@ -356,6 +366,7 @@ 'test/test-tcp-close.c', 'test/test-tcp-close-accept.c', 'test/test-tcp-close-while-connecting.c', + 'test/test-tcp-create-socket-early.c', 'test/test-tcp-connect-error-after-write.c', 'test/test-tcp-shutdown-after-write.c', 'test/test-tcp-flags.c', @@ -384,6 +395,7 @@ 'test/test-timer.c', 'test/test-tty.c', 'test/test-udp-bind.c', + 'test/test-udp-create-socket-early.c', 'test/test-udp-dgram-too-big.c', 'test/test-udp-ipv6.c', 'test/test-udp-open.c', @@ -427,6 +439,9 @@ '_XOPEN_SOURCE=500', ], }], + ['uv_library=="shared_library"', { + 'defines': [ 'USING_UV_SHARED=1' ] + }], ], 'msvs-settings': { 'VCLinkerTool': { @@ -478,7 +493,10 @@ 'test/runner-unix.c', 'test/runner-unix.h', ] - }] + }], + ['uv_library=="shared_library"', { + 'defines': [ 'USING_UV_SHARED=1' ] + }], ], 'msvs-settings': { 'VCLinkerTool': { diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index cc424333d31334..d0a859c12dacf9 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -60,6 +60,8 @@ shell_g /test/promises-aplus/promises-tests /test/promises-aplus/promises-tests.tar.gz /test/promises-aplus/sinon +/test/simdjs/ecmascript_simd* +/test/simdjs/data* /test/test262/data /test/test262/data.old /test/test262/tc39-test262-* diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index b0a9765b4436a5..4f853c275bc249 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -69,6 +69,7 @@ Kang-Hao (Kenny) Lu Luis Reis Luke Zarko Maciej Małecki +Marcin Cieślak Mathias Bynens Matt Hanselman Matthew Sporleder diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index feaec2505e8359..3eb7fc73eb9aae 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -52,7 +52,7 @@ config("internal_config") { include_dirs = [ "." ] - if (component_mode == "shared_library") { + if (is_component_build) { defines = [ "V8_SHARED", "BUILDING_V8_SHARED", @@ -202,8 +202,9 @@ action("js2c") { sources = [ "src/macros.py", - "src/messages.h", + "src/messages.h", "src/runtime.js", + "src/prologue.js", "src/v8natives.js", "src/symbol.js", "src/array.js", @@ -215,6 +216,7 @@ action("js2c") { "src/regexp.js", "src/arraybuffer.js", "src/typedarray.js", + "src/iterator-prototype.js", "src/generator.js", "src/object-observe.js", "src/collection.js", @@ -229,6 +231,8 @@ action("js2c") { "src/mirror-debugger.js", "src/liveedit-debugger.js", "src/templates.js", + "src/harmony-array.js", + "src/harmony-typedarray.js", ] outputs = [ @@ -264,17 +268,18 @@ action("js2c_experimental") { sources = [ "src/macros.py", - "src/messages.h", + "src/messages.h", "src/proxy.js", "src/generator.js", - "src/harmony-array.js", + "src/harmony-atomics.js", "src/harmony-array-includes.js", - "src/harmony-typedarray.js", + "src/harmony-concat-spreadable.js", "src/harmony-tostring.js", "src/harmony-regexp.js", "src/harmony-reflect.js", "src/harmony-spread.js", - "src/harmony-object.js" + "src/harmony-object.js", + "src/harmony-sharedarraybuffer.js" ] outputs = [ @@ -474,9 +479,13 @@ source_set("v8_snapshot") { ":js2c", ":js2c_experimental", ":js2c_extras", - ":run_mksnapshot", ":v8_base", ] + public_deps = [ + # This should be public so downstream targets can declare the snapshot + # output file as their inputs. + ":run_mksnapshot", + ] sources = [ "$target_gen_dir/libraries.cc", @@ -502,9 +511,11 @@ if (v8_use_external_startup_data) { ":js2c", ":js2c_experimental", ":js2c_extras", - ":run_mksnapshot", ":v8_base", + ] + public_deps = [ ":natives_blob", + ":run_mksnapshot", ] sources = [ @@ -526,6 +537,14 @@ source_set("v8_base") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ + "include/v8-debug.h", + "include/v8-platform.h", + "include/v8-profiler.h", + "include/v8-testing.h", + "include/v8-util.h", + "include/v8-version.h", + "include/v8.h", + "include/v8config.h", "src/accessors.cc", "src/accessors.h", "src/allocation.cc", @@ -544,6 +563,8 @@ source_set("v8_base") { "src/assembler.h", "src/assert-scope.h", "src/assert-scope.cc", + "src/ast-literal-reindexer.cc", + "src/ast-literal-reindexer.h", "src/ast-numbering.cc", "src/ast-numbering.h", "src/ast-value-factory.cc", @@ -602,6 +623,8 @@ source_set("v8_base") { "src/compiler/basic-block-instrumentor.h", "src/compiler/change-lowering.cc", "src/compiler/change-lowering.h", + "src/compiler/coalesced-live-ranges.cc", + "src/compiler/coalesced-live-ranges.h", "src/compiler/code-generator-impl.h", "src/compiler/code-generator.cc", "src/compiler/code-generator.h", @@ -617,8 +640,8 @@ source_set("v8_base") { "src/compiler/control-equivalence.h", "src/compiler/control-flow-optimizer.cc", "src/compiler/control-flow-optimizer.h", - "src/compiler/control-reducer.cc", - "src/compiler/control-reducer.h", + "src/compiler/dead-code-elimination.cc", + "src/compiler/dead-code-elimination.h", "src/compiler/diamond.h", "src/compiler/frame.h", "src/compiler/frame-elider.cc", @@ -632,10 +655,14 @@ source_set("v8_base") { "src/compiler/graph-reducer.h", "src/compiler/graph-replay.cc", "src/compiler/graph-replay.h", + "src/compiler/graph-trimmer.cc", + "src/compiler/graph-trimmer.h", "src/compiler/graph-visualizer.cc", "src/compiler/graph-visualizer.h", "src/compiler/graph.cc", "src/compiler/graph.h", + "src/compiler/greedy-allocator.cc", + "src/compiler/greedy-allocator.h", "src/compiler/instruction-codes.h", "src/compiler/instruction-selector-impl.h", "src/compiler/instruction-selector.cc", @@ -646,6 +673,8 @@ source_set("v8_base") { "src/compiler/js-builtin-reducer.h", "src/compiler/js-context-specialization.cc", "src/compiler/js-context-specialization.h", + "src/compiler/js-frame-specialization.cc", + "src/compiler/js-frame-specialization.h", "src/compiler/js-generic-lowering.cc", "src/compiler/js-generic-lowering.h", "src/compiler/js-graph.cc", @@ -774,6 +803,7 @@ source_set("v8_base") { "src/elements.h", "src/execution.cc", "src/execution.h", + "src/expression-classifier.h", "src/extensions/externalize-string-extension.cc", "src/extensions/externalize-string-extension.h", "src/extensions/free-buffer-extension.cc", @@ -830,6 +860,8 @@ source_set("v8_base") { "src/heap/mark-compact-inl.h", "src/heap/mark-compact.cc", "src/heap/mark-compact.h", + "src/heap/memory-reducer.cc", + "src/heap/memory-reducer.h", "src/heap/objects-visiting-inl.h", "src/heap/objects-visiting.cc", "src/heap/objects-visiting.h", @@ -958,12 +990,11 @@ source_set("v8_base") { "src/optimizing-compile-dispatcher.h", "src/ostreams.cc", "src/ostreams.h", + "src/pattern-rewriter.cc", "src/parser.cc", "src/parser.h", "src/pending-compilation-error-handler.cc", "src/pending-compilation-error-handler.h", - "src/perf-jit.cc", - "src/perf-jit.h", "src/preparse-data-format.h", "src/preparse-data.cc", "src/preparse-data.h", @@ -992,11 +1023,13 @@ source_set("v8_base") { "src/runtime-profiler.cc", "src/runtime-profiler.h", "src/runtime/runtime-array.cc", + "src/runtime/runtime-atomics.cc", "src/runtime/runtime-classes.cc", "src/runtime/runtime-collections.cc", "src/runtime/runtime-compiler.cc", "src/runtime/runtime-date.cc", "src/runtime/runtime-debug.cc", + "src/runtime/runtime-forin.cc", "src/runtime/runtime-function.cc", "src/runtime/runtime-generator.cc", "src/runtime/runtime-i18n.cc", @@ -1032,6 +1065,7 @@ source_set("v8_base") { "src/scopes.cc", "src/scopes.h", "src/signature.h", + "src/simulator.h", "src/small-pointer-list.h", "src/smart-pointers.h", "src/snapshot/natives.h", @@ -1040,7 +1074,11 @@ source_set("v8_base") { "src/snapshot/snapshot-common.cc", "src/snapshot/snapshot-source-sink.cc", "src/snapshot/snapshot-source-sink.h", + "src/splay-tree.h", + "src/splay-tree-inl.h", "src/snapshot/snapshot.h", + "src/startup-data-util.h", + "src/startup-data-util.cc", "src/string-builder.cc", "src/string-builder.h", "src/string-search.cc", @@ -1089,6 +1127,8 @@ source_set("v8_base") { "src/vm-state.h", "src/zone.cc", "src/zone.h", + "src/zone-allocator.h", + "src/zone-containers.h", "src/third_party/fdlibm/fdlibm.cc", "src/third_party/fdlibm/fdlibm.h", ] @@ -1201,6 +1241,7 @@ source_set("v8_base") { "src/arm/regexp-macro-assembler-arm.cc", "src/arm/regexp-macro-assembler-arm.h", "src/arm/simulator-arm.cc", + "src/arm/simulator-arm.h", "src/compiler/arm/code-generator-arm.cc", "src/compiler/arm/instruction-codes-arm.h", "src/compiler/arm/instruction-selector-arm.cc", @@ -1295,6 +1336,7 @@ source_set("v8_base") { "src/mips/regexp-macro-assembler-mips.cc", "src/mips/regexp-macro-assembler-mips.h", "src/mips/simulator-mips.cc", + "src/mips/simulator-mips.h", "src/compiler/mips/code-generator-mips.cc", "src/compiler/mips/instruction-codes-mips.h", "src/compiler/mips/instruction-selector-mips.cc", @@ -1336,6 +1378,7 @@ source_set("v8_base") { "src/mips64/regexp-macro-assembler-mips64.cc", "src/mips64/regexp-macro-assembler-mips64.h", "src/mips64/simulator-mips64.cc", + "src/mips64/simulator-mips64.h", "src/ic/mips64/access-compiler-mips64.cc", "src/ic/mips64/handler-compiler-mips64.cc", "src/ic/mips64/ic-mips64.cc", @@ -1399,6 +1442,8 @@ source_set("v8_libbase") { "src/base/atomicops_internals_atomicword_compat.h", "src/base/atomicops_internals_mac.h", "src/base/atomicops_internals_mips_gcc.h", + "src/base/atomicops_internals_mips64_gcc.h", + "src/base/atomicops_internals_portable.h", "src/base/atomicops_internals_tsan.h", "src/base/atomicops_internals_x86_gcc.cc", "src/base/atomicops_internals_x86_gcc.h", @@ -1558,7 +1603,7 @@ if (current_toolchain == snapshot_toolchain) { # Public targets # -if (component_mode == "shared_library") { +if (is_component_build) { component("v8") { sources = [ "src/v8dll-main.cc", @@ -1567,11 +1612,17 @@ if (component_mode == "shared_library") { if (v8_use_snapshot && v8_use_external_startup_data) { deps = [ ":v8_base", + ] + public_deps = [ ":v8_external_snapshot", ] } else if (v8_use_snapshot) { deps = [ ":v8_base", + ] + # v8_snapshot should be public so downstream targets can declare the + # snapshot file as their input. + public_deps = [ ":v8_snapshot", ] } else { @@ -1607,6 +1658,8 @@ if (component_mode == "shared_library") { } else if (v8_use_snapshot) { deps = [ ":v8_base", + ] + public_deps = [ ":v8_snapshot", ] } else { @@ -1627,8 +1680,6 @@ if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || sources = [ "src/d8.cc", "src/d8.h", - "src/startup-data-util.h", - "src/startup-data-util.cc", ] configs -= [ "//build/config/compiler:chromium_code" ] @@ -1657,9 +1708,10 @@ if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || sources += [ "src/d8-windows.cc" ] } - if (component_mode != "shared_library") { + if (!is_component_build) { sources += [ "src/d8-debug.cc", + "src/d8-debug.h", "$target_gen_dir/d8-js.cc", ] } diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index c665f1763eb431..e8ce91563387b5 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,678 @@ +2015-07-08: Version 4.5.103 + + Performance and stability improvements on all platforms. + + +2015-07-08: Version 4.5.102 + + Performance and stability improvements on all platforms. + + +2015-07-07: Version 4.5.101 + + Move compatible receiver check from CompileHandler to UpdateCaches + (Chromium issue 505374). + + Performance and stability improvements on all platforms. + + +2015-07-07: Version 4.5.100 + + Performance and stability improvements on all platforms. + + +2015-07-07: Version 4.5.99 + + unicode-decoder: fix out-of-band write in utf16 (issue 4274). + + Performance and stability improvements on all platforms. + + +2015-07-06: Version 4.5.98 + + Performance and stability improvements on all platforms. + + +2015-07-04: Version 4.5.97 + + Performance and stability improvements on all platforms. + + +2015-07-03: Version 4.5.96 + + Performance and stability improvements on all platforms. + + +2015-07-03: Version 4.5.95 + + Performance and stability improvements on all platforms. + + +2015-07-02: Version 4.5.94 + + Performance and stability improvements on all platforms. + + +2015-07-02: Version 4.5.93 + + Include Harmony Array/TypedArray methods unconditionally (Chromium issue + 504629). + + Performance and stability improvements on all platforms. + + +2015-07-02: Version 4.5.92 + + Performance and stability improvements on all platforms. + + +2015-07-01: Version 4.5.91 + + Performance and stability improvements on all platforms. + + +2015-07-01: Version 4.5.90 + + Performance and stability improvements on all platforms. + + +2015-07-01: Version 4.5.89 + + Performance and stability improvements on all platforms. + + +2015-06-30: Version 4.5.88 + + Performance and stability improvements on all platforms. + + +2015-06-30: Version 4.5.87 + + Performance and stability improvements on all platforms. + + +2015-06-30: Version 4.5.86 + + Ensure mjsunit tests use dashes not underscores in flags directives + (Chromium issue 505228). + + Performance and stability improvements on all platforms. + + +2015-06-29: Version 4.5.85 + + Fix flag convention in handle count tests and comment (Chromium issue + 505228). + + Performance and stability improvements on all platforms. + + +2015-06-29: Version 4.5.84 + + Performance and stability improvements on all platforms. + + +2015-06-27: Version 4.5.83 + + Performance and stability improvements on all platforms. + + +2015-06-26: Version 4.5.82 + + Performance and stability improvements on all platforms. + + +2015-06-26: Version 4.5.81 + + Remove obsolete options in ScriptCompiler::CompileOptions (Chromium + issue 399580). + + Performance and stability improvements on all platforms. + + +2015-06-25: Version 4.5.80 + + Performance and stability improvements on all platforms. + + +2015-06-25: Version 4.5.79 + + Performance and stability improvements on all platforms. + + +2015-06-25: Version 4.5.78 + + Serializer: clear next link in weak cells (Chromium issue 503552). + + Performance and stability improvements on all platforms. + + +2015-06-24: Version 4.5.77 + + Performance and stability improvements on all platforms. + + +2015-06-24: Version 4.5.76 + + Performance and stability improvements on all platforms. + + +2015-06-24: Version 4.5.75 + + Date() should not depend on Date.prototype.toString (issue 4225). + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.74 + + Expose Map/Set methods through the API (issue 3340). + + [turbofan] NaN is never truish (issue 4207). + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.73 + + Re-ship Harmony Array/TypedArray methods (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.72 + + Performance and stability improvements on all platforms. + + +2015-06-23: Version 4.5.71 + + Performance and stability improvements on all platforms. + + +2015-06-20: Version 4.5.70 + + Ship Harmony Array/TypedArray methods (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-20: Version 4.5.69 + + Ship arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-19: Version 4.5.68 + + Performance and stability improvements on all platforms. + + +2015-06-19: Version 4.5.67 + + Performance and stability improvements on all platforms. + + +2015-06-19: Version 4.5.66 + + Ship arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-18: Version 4.5.65 + + Performance and stability improvements on all platforms. + + +2015-06-18: Version 4.5.64 + + Performance and stability improvements on all platforms. + + +2015-06-18: Version 4.5.63 + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.62 + + Hydrogen object literals: always initialize in-object properties + (Chromium issue 500497). + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.61 + + Add %TypedArray% to proto chain (issue 4085). + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.60 + + Performance and stability improvements on all platforms. + + +2015-06-17: Version 4.5.59 + + [crankshaft] Fix wrong bailout points in for-in loop body (Chromium + issue 500435). + + Performance and stability improvements on all platforms. + + +2015-06-16: Version 4.5.58 + + Performance and stability improvements on all platforms. + + +2015-06-16: Version 4.5.57 + + Inline code generation for %_IsTypedArray (issue 4085). + + Allow TypedArrays to be initialized with iterables (issue 4090). + + Performance and stability improvements on all platforms. + + +2015-06-15: Version 4.5.56 + + Performance and stability improvements on all platforms. + + +2015-06-15: Version 4.5.55 + + Performance and stability improvements on all platforms. + + +2015-06-14: Version 4.5.54 + + Performance and stability improvements on all platforms. + + +2015-06-13: Version 4.5.53 + + Performance and stability improvements on all platforms. + + +2015-06-12: Version 4.5.52 + + Map::TryUpdate() must be in sync with Map::Update() (issue 4173). + + Add ToObject call in Array.prototype.sort (issue 4125). + + In Array.of and Array.from, fall back to DefineOwnProperty (issue 4168). + + Performance and stability improvements on all platforms. + + +2015-06-12: Version 4.5.51 + + Performance and stability improvements on all platforms. + + +2015-06-11: Version 4.5.50 + + Performance and stability improvements on all platforms. + + +2015-06-11: Version 4.5.49 + + Performance and stability improvements on all platforms. + + +2015-06-11: Version 4.5.48 + + Support rest parameters in arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-10: Version 4.5.47 + + Implement %TypedArray%.prototype.slice (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-09: Version 4.5.46 + + Stage ES6 arrow functions (issue 2700). + + Performance and stability improvements on all platforms. + + +2015-06-09: Version 4.5.45 + + Performance and stability improvements on all platforms. + + +2015-06-09: Version 4.5.44 + + Performance and stability improvements on all platforms. + + +2015-06-08: Version 4.5.43 + + [for-in] Make ForInNext and ForInFilter deal properly with exceptions + (Chromium issue 496331). + + Performance and stability improvements on all platforms. + + +2015-06-08: Version 4.5.42 + + Performance and stability improvements on all platforms. + + +2015-06-06: Version 4.5.41 + + Performance and stability improvements on all platforms. + + +2015-06-05: Version 4.5.40 + + Performance and stability improvements on all platforms. + + +2015-06-05: Version 4.5.39 + + Stage ES6 Array and TypedArray methods (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-05: Version 4.5.38 + + Implement %TypedArray%.prototype.{reduce,reduceRight} (issue 3578). + + Add support for Embedded Constant Pools for PPC and Arm (Chromium issue + 478811). + + Performance and stability improvements on all platforms. + + +2015-06-04: Version 4.5.37 + + Performance and stability improvements on all platforms. + + +2015-06-04: Version 4.5.36 + + Performance and stability improvements on all platforms. + + +2015-06-04: Version 4.5.35 + + Flatten the Arrays returned and consumed by the v8::Map API (Chromium + issue 478263). + + Performance and stability improvements on all platforms. + + +2015-06-03: Version 4.5.34 + + Also allocate small typed arrays on heap when initialized from an array- + like (issue 3996). + + Implement %TypedArray%.prototype.{reduce,reduceRight} (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-06-03: Version 4.5.33 + + Add support for Embedded Constant Pools for PPC and Arm (Chromium issue + 478811). + + Implement %TypedArray%.prototype.{toString,toLocaleString,join} (issue + 3578). + + Performance and stability improvements on all platforms. + + +2015-06-03: Version 4.5.32 + + Performance and stability improvements on all platforms. + + +2015-06-02: Version 4.5.31 + + Performance and stability improvements on all platforms. + + +2015-06-02: Version 4.5.30 + + Performance and stability improvements on all platforms. + + +2015-06-01: Version 4.5.29 + + Reland "Re-enable on-heap typed array allocation" (issue 3996). + + Performance and stability improvements on all platforms. + + +2015-06-01: Version 4.5.28 + + Re-enable on-heap typed array allocation (issue 3996). + + Also expose DefineOwnProperty (Chromium issue 475206). + + Performance and stability improvements on all platforms. + + +2015-06-01: Version 4.5.27 + + Performance and stability improvements on all platforms. + + +2015-05-31: Version 4.5.26 + + Performance and stability improvements on all platforms. + + +2015-05-30: Version 4.5.25 + + Performance and stability improvements on all platforms. + + +2015-05-29: Version 4.5.24 + + Debugger: consider try-finally scopes not catching wrt debug events + (Chromium issue 492522). + + Performance and stability improvements on all platforms. + + +2015-05-29: Version 4.5.23 + + Performance and stability improvements on all platforms. + + +2015-05-29: Version 4.5.22 + + Do not eagerly convert exception to string when creating a message + object (Chromium issue 490680). + + Performance and stability improvements on all platforms. + + +2015-05-28: Version 4.5.21 + + Performance and stability improvements on all platforms. + + +2015-05-28: Version 4.5.20 + + Introduce v8::Object::CreateDataProperty (Chromium issue 475206). + + Performance and stability improvements on all platforms. + + +2015-05-27: Version 4.5.19 + + Performance and stability improvements on all platforms. + + +2015-05-27: Version 4.5.18 + + Add {Map,Set}::FromArray to the API (issue 3340). + + Add {Map,Set}::AsArray to the API (issue 3340). + + Add basic API support for Map & Set (issue 3340). + + Performance and stability improvements on all platforms. + + +2015-05-26: Version 4.5.17 + + Correctly hook up materialized receiver into the evaluation context + chain (Chromium issue 491943). + + Implement bookmarks for ExternalStreamingStream (Chromium issue 470930). + + Performance and stability improvements on all platforms. + + +2015-05-26: Version 4.5.16 + + Performance and stability improvements on all platforms. + + +2015-05-26: Version 4.5.15 + + Performance and stability improvements on all platforms. + + +2015-05-23: Version 4.5.14 + + Performance and stability improvements on all platforms. + + +2015-05-22: Version 4.5.13 + + Remove v8::Private. + + Performance and stability improvements on all platforms. + + +2015-05-22: Version 4.5.12 + + Performance and stability improvements on all platforms. + + +2015-05-22: Version 4.5.11 + + Performance and stability improvements on all platforms. + + +2015-05-21: Version 4.5.10 + + Re-land %TypedArray%.prototype.{map,filter,some} (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-05-21: Version 4.5.9 + + Performance and stability improvements on all platforms. + + +2015-05-20: Version 4.5.8 + + Performance and stability improvements on all platforms. + + +2015-05-20: Version 4.5.7 + + Implement %TypedArray%.{lastI,i}ndexOf (issue 3578). + + Implement %TypedArray%.prototype.sort (issue 3578). + + Implement %TypedArray%.reverse (issue 3578). + + Implement %TypedArray%.prototype.{map,filter,some,reduce,reduceRight} + (issue 3578). + + Fix has_pending_exception logic in API's Array::CloneElementAt (issue + 4103). + + Adding api to get last gc object statistics for chrome://tracing + (Chromium issue 476013). + + Fix harmless HGraph verification failure after hoisting inlined bounds + checks (Chromium issue 487608). + + Performance and stability improvements on all platforms. + + +2015-05-20: Version 4.5.6 + + Add TypedArray.from method (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-05-19: Version 4.5.5 + + ARM64: Propagate notification about aborted compilation from + RegExpEngine to MacroAssembler (Chromium issue 489290). + + Performance and stability improvements on all platforms. + + +2015-05-18: Version 4.5.4 + + Performance and stability improvements on all platforms. + + +2015-05-18: Version 4.5.3 + + Performance and stability improvements on all platforms. + + +2015-05-17: Version 4.5.2 + + Performance and stability improvements on all platforms. + + +2015-05-16: Version 4.5.1 + + Test that TypedArray methods don't read length (issue 3578). + + Implement %TypedArray%.{fill,find,findIndex} (issue 3578). + + TypedArray.prototype.copyWithin method (issue 3578). + + Provide accessor for object internal properties that doesn't require + debugger to be active (Chromium issue 481845). + + Don't create debug context if debug listener is not set (Chromium issue + 482290). + + Performance and stability improvements on all platforms. + + +2015-05-13: Version 4.4.65 + + Deprecate Isolate::New. + + Factor out core of Array.forEach and .every, for use in TypedArrays + (issue 3578). + + Performance and stability improvements on all platforms. + + +2015-05-12: Version 4.4.64 + + Performance and stability improvements on all platforms. + + 2015-05-11: Version 4.4.63 Let Runtime_GrowArrayElements accept non-Smi numbers as |key| (Chromium diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 711cc53b7e3574..689ae778bb59a4 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,23 +8,23 @@ vars = { deps = { "v8/build/gyp": - Var("git_url") + "/external/gyp.git" + "@" + "0bb67471bca068996e15b56738fa4824dfa19de0", + Var("git_url") + "/external/gyp.git" + "@" + "5122240c5e5c4d8da12c543d82b03d6089eb77c5", "v8/third_party/icu": - Var("git_url") + "/chromium/deps/icu.git" + "@" + "f8c0e585b0a046d83d72b5d37356cb50d5b2031a", + Var("git_url") + "/chromium/deps/icu.git" + "@" + "c81a1a3989c3b66fa323e9a6ee7418d7c08297af", "v8/buildtools": - Var("git_url") + "/chromium/buildtools.git" + "@" + "b0ede9c89f9d5fbe5387d961ad4c0ec665b6c821", + Var("git_url") + "/chromium/buildtools.git" + "@" + "ecc8e253abac3b6186a97573871a084f4c0ca3ae", "v8/testing/gtest": - Var("git_url") + "/external/googletest.git" + "@" + "be1868139ffe0ccd0e8e3b37292b84c821d9c8ad", + Var("git_url") + "/external/googletest.git" + "@" + "23574bf2333f834ff665f894c97bef8a5b33a0a9", "v8/testing/gmock": Var("git_url") + "/external/googlemock.git" + "@" + "29763965ab52f24565299976b936d1265cb6a271", # from svn revision 501 "v8/tools/clang": - Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "5bab78c6ced45a71a8e095a09697ca80492e57e1", + Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "73ec8804ed395b0886d6edf82a9f33583f4a7902", } deps_os = { "android": { "v8/third_party/android_tools": - Var("git_url") + "/android_tools.git" + "@" + "4f723e2a5fa5b7b8a198072ac19b92344be2b271", + Var("git_url") + "/android_tools.git" + "@" + "21f4bcbd6cd927e4b4227cfde7d5f13486be1236", }, "win": { "v8/third_party/cygwin": diff --git a/deps/v8/LICENSE b/deps/v8/LICENSE index 2f5bce83697d0f..1ffa949c6c1dfb 100644 --- a/deps/v8/LICENSE +++ b/deps/v8/LICENSE @@ -3,12 +3,12 @@ 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/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. These are + - 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. @@ -26,6 +26,9 @@ are: 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 diff --git a/deps/v8/Makefile b/deps/v8/Makefile index db6cf3b7da534a..97612655a7b1ae 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -31,9 +31,7 @@ OUTDIR ?= out TESTJOBS ?= GYPFLAGS ?= TESTFLAGS ?= -ANDROID_NDK_ROOT ?= ANDROID_NDK_HOST_ARCH ?= -ANDROID_TOOLCHAIN ?= ANDROID_V8 ?= /data/local/tmp/v8 NACL_SDK_ROOT ?= @@ -145,10 +143,14 @@ ifeq ($(i18nsupport), off) GYPFLAGS += -Dv8_enable_i18n_support=0 TESTFLAGS += --noi18n endif -# deprecation_warnings=on +# deprecationwarnings=on ifeq ($(deprecationwarnings), on) GYPFLAGS += -Dv8_deprecation_warnings=1 endif +# imminentdeprecationwarnings=on +ifeq ($(imminentdeprecationwarnings), on) + GYPFLAGS += -Dv8_imminent_deprecation_warnings=1 +endif # asan=on ifeq ($(asan), on) GYPFLAGS += -Dasan=1 -Dclang=1 @@ -246,7 +248,7 @@ NACL_ARCHES = nacl_ia32 nacl_x64 GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \ build/shim_headers.gypi build/features.gypi build/standalone.gypi \ build/toolchain.gypi build/all.gyp build/mac/asan.gyp \ - build/android.gypi test/cctest/cctest.gyp \ + test/cctest/cctest.gyp \ test/unittests/unittests.gyp tools/gyp/v8.gyp \ tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \ buildtools/third_party/libc++abi/libc++abi.gyp \ @@ -277,7 +279,6 @@ ENVFILE = $(OUTDIR)/environment $(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 @@ -311,8 +312,7 @@ native: $(OUTDIR)/Makefile.native $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) -$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ - must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android +$(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android @$(MAKE) -f Makefile.android $@ \ ARCH="$(basename $@)" \ MODE="$(subst .,,$(suffix $@))" \ @@ -448,13 +448,6 @@ $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.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: diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index f89fd21fda004e..c49cb85b9b6514 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -35,75 +35,28 @@ MODES = release debug ANDROID_BUILDS = $(foreach mode,$(MODES), \ $(addsuffix .$(mode),$(ANDROID_ARCHES))) -HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') -ANDROID_NDK_HOST_ARCH ?= $(shell uname -m | sed -e 's/i[3456]86/x86/') -ifeq ($(HOST_OS), linux) - TOOLCHAIN_DIR = linux-$(ANDROID_NDK_HOST_ARCH) -else ifeq ($(HOST_OS), mac) - TOOLCHAIN_DIR = darwin-$(ANDROID_NDK_HOST_ARCH) -else - $(error Host platform "${HOST_OS}" is not supported) -endif - ifeq ($(ARCH), android_arm) - DEFINES = target_arch=arm v8_target_arch=arm android_target_arch=arm android_target_platform=14 - DEFINES += arm_neon=0 arm_version=7 - TOOLCHAIN_ARCH = arm-linux-androideabi - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=arm v8_target_arch=arm else ifeq ($(ARCH), android_arm64) - DEFINES = target_arch=arm64 v8_target_arch=arm64 android_target_arch=arm64 android_target_platform=21 - TOOLCHAIN_ARCH = aarch64-linux-android - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.9 + DEFINES = target_arch=arm64 v8_target_arch=arm64 else ifeq ($(ARCH), android_mipsel) - DEFINES = target_arch=mipsel v8_target_arch=mipsel android_target_platform=14 - DEFINES += android_target_arch=mips mips_arch_variant=mips32r2 - TOOLCHAIN_ARCH = mipsel-linux-android - TOOLCHAIN_PREFIX = $(TOOLCHAIN_ARCH) - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=mipsel v8_target_arch=mipsel else ifeq ($(ARCH), android_ia32) - DEFINES = target_arch=ia32 v8_target_arch=ia32 android_target_arch=x86 android_target_platform=14 - TOOLCHAIN_ARCH = x86 - TOOLCHAIN_PREFIX = i686-linux-android - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=ia32 v8_target_arch=ia32 else ifeq ($(ARCH), android_x64) - DEFINES = target_arch=x64 v8_target_arch=x64 android_target_arch=x86_64 android_target_platform=21 - TOOLCHAIN_ARCH = x86_64 - TOOLCHAIN_PREFIX = x86_64-linux-android - TOOLCHAIN_VER = 4.9 + DEFINES = target_arch=x64 v8_target_arch=x64 else ifeq ($(ARCH), android_x87) - DEFINES = target_arch=x87 v8_target_arch=x87 android_target_arch=x86 android_target_platform=14 - TOOLCHAIN_ARCH = x86 - TOOLCHAIN_PREFIX = i686-linux-android - TOOLCHAIN_VER = 4.8 + DEFINES = target_arch=ia32 v8_target_arch=x87 else $(error Target architecture "${ARCH}" is not supported) endif -TOOLCHAIN_PATH = \ - ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}-${TOOLCHAIN_VER}/prebuilt -ANDROID_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR} - -ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),) - $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}". Please \ - check that ANDROID_NDK_ROOT and ANDROID_NDK_HOST_ARCH are set \ - correctly) -endif - -# For mksnapshot host generation. -DEFINES += host_os=${HOST_OS} +# Common flags. DEFINES += OS=android .SECONDEXPANSION: $(ANDROID_BUILDS): $(OUTDIR)/Makefile.$$@ @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ - CXX="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-g++" \ - AR="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ar" \ - RANLIB="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ranlib" \ - CC="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-gcc" \ - LD="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-ld" \ - LINK="$(ANDROID_TOOLCHAIN)/bin/${TOOLCHAIN_PREFIX}-g++" \ BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ python -c "print raw_input().capitalize()") \ builddir="$(shell pwd)/$(OUTDIR)/$@" @@ -113,9 +66,7 @@ ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) $(ANDROID_MAKEFILES): GYP_GENERATORS=make-android \ GYP_DEFINES="${DEFINES}" \ - CC="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-gcc" \ - CXX="${ANDROID_TOOLCHAIN}/bin/${TOOLCHAIN_PREFIX}-g++" \ PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH)" \ build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ - -Ibuild/standalone.gypi --depth=. -Ibuild/android.gypi \ + -Ibuild/standalone.gypi --depth=. \ -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} diff --git a/deps/v8/build/android.gypi b/deps/v8/build/android.gypi deleted file mode 100644 index 7bbf12eed6d99b..00000000000000 --- a/deps/v8/build/android.gypi +++ /dev/null @@ -1,266 +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. - -# Definitions for building standalone V8 binaries to run on Android. -# This is mostly excerpted from: -# http://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi - -{ - 'variables': { - # Location of Android NDK. - 'variables': { - 'android_ndk_root%': ' GetExecutionState() const = 0; - virtual Handle GetEventData() const = 0; + virtual Local GetExecutionState() const = 0; + virtual Local GetEventData() const = 0; /** * Get the debugger protocol JSON. */ - virtual Handle GetJSON() const = 0; + virtual Local GetJSON() const = 0; /** * Get the context active when the debug event happened. Note this is not * the current active context as the JavaScript part of the debugger is * running in its own context which is entered at this point. */ - virtual Handle GetEventContext() const = 0; + virtual Local GetEventContext() const = 0; /** * Client data passed with the corresponding request if any. This is the @@ -104,21 +104,21 @@ class V8_EXPORT Debug { * Access to execution state and event data of the debug event. Don't store * these cross callbacks as their content becomes invalid. */ - virtual Handle GetExecutionState() const = 0; - virtual Handle GetEventData() const = 0; + virtual Local GetExecutionState() const = 0; + virtual Local GetEventData() const = 0; /** * Get the context active when the debug event happened. Note this is not * the current active context as the JavaScript part of the debugger is * running in its own context which is entered at this point. */ - virtual Handle GetEventContext() const = 0; + virtual Local GetEventContext() const = 0; /** * Client data passed with the corresponding callback when it was * registered. */ - virtual Handle GetCallbackData() const = 0; + virtual Local GetCallbackData() const = 0; /** * Client data passed to DebugBreakForCommand function. The @@ -156,7 +156,7 @@ class V8_EXPORT Debug { typedef void (*DebugMessageDispatchHandler)(); static bool SetDebugEventListener(EventCallback that, - Handle data = Handle()); + Local data = Local()); // Schedule a debugger break to happen when JavaScript code is run // in the given isolate. @@ -196,20 +196,20 @@ class V8_EXPORT Debug { */ static V8_DEPRECATE_SOON( "Use maybe version", - Local Call(v8::Handle fun, - Handle data = Handle())); + Local Call(v8::Local fun, + Local data = Local())); // TODO(dcarney): data arg should be a MaybeLocal static MaybeLocal Call(Local context, - v8::Handle fun, - Handle data = Handle()); + v8::Local fun, + Local data = Local()); /** * Returns a mirror object for the given object. */ static V8_DEPRECATE_SOON("Use maybe version", - Local GetMirror(v8::Handle obj)); + Local GetMirror(v8::Local obj)); static MaybeLocal GetMirror(Local context, - v8::Handle obj); + v8::Local obj); /** * Makes V8 process all pending debug messages. @@ -248,7 +248,8 @@ class V8_EXPORT Debug { * Debugger is running in its own context which is entered while debugger * messages are being dispatched. This is an explicit getter for this * debugger context. Note that the content of the debugger context is subject - * to change. + * to change. The Context exists only when the debugger is active, i.e. at + * least one DebugEventListener or MessageHandler is set. */ static Local GetDebugContext(); @@ -259,6 +260,14 @@ class V8_EXPORT Debug { * unexpectedly used. LiveEdit is enabled by default. */ static void SetLiveEditEnabled(Isolate* isolate, bool enable); + + /** + * Returns array of internal properties specific to the value type. Result has + * the following format: [, ,...,, ]. Result array + * will be allocated in the current context. + */ + static MaybeLocal GetInternalProperties(Isolate* isolate, + Local value); }; diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 67fb384c99ba52..be9e5c0c6b46ed 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -56,6 +56,17 @@ class Platform { */ virtual void CallOnForegroundThread(Isolate* isolate, Task* task) = 0; + /** + * Schedules a task to be invoked on a foreground thread wrt a specific + * |isolate| after the given number of seconds |delay_in_seconds|. + * Tasks posted for the same isolate should be execute in order of + * scheduling. The definition of "foreground" is opaque to V8. + */ + virtual void CallDelayedOnForegroundThread(Isolate* isolate, Task* task, + double delay_in_seconds) { + // TODO(ulan): Make this function abstract after V8 roll in Chromium. + } + /** * Monotonically increasing time in seconds from an arbitrary fixed point in * the past. This function is expected to return at least diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 82a14d66003001..121e8030a140d7 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -60,13 +60,13 @@ class V8_EXPORT CpuProfileNode { }; /** Returns function name (empty string for anonymous functions.) */ - Handle GetFunctionName() const; + Local GetFunctionName() const; /** Returns id of the script where function is located. */ int GetScriptId() const; /** Returns resource name for script from where the function originates. */ - Handle GetScriptResourceName() const; + Local GetScriptResourceName() const; /** * Returns the number, 1-based, of the line where the function originates. @@ -129,7 +129,7 @@ class V8_EXPORT CpuProfileNode { class V8_EXPORT CpuProfile { public: /** Returns CPU profile title. */ - Handle GetTitle() const; + Local GetTitle() const; /** Returns the root node of the top down call tree. */ const CpuProfileNode* GetTopDownRoot() const; @@ -198,13 +198,13 @@ class V8_EXPORT CpuProfiler { * |record_samples| parameter controls whether individual samples should * be recorded in addition to the aggregated tree. */ - void StartProfiling(Handle title, bool record_samples = false); + void StartProfiling(Local title, bool record_samples = false); /** * Stops collecting CPU profile with a given title and returns it. * If the title given is empty, finishes the last profile started. */ - CpuProfile* StopProfiling(Handle title); + CpuProfile* StopProfiling(Local title); /** * Tells the profiler whether the embedder is idle. @@ -246,7 +246,7 @@ class V8_EXPORT HeapGraphEdge { * Returns edge name. This can be a variable name, an element index, or * a property name. */ - Handle GetName() const; + Local GetName() const; /** Returns origin node. */ const HeapGraphNode* GetFromNode() const; @@ -275,7 +275,8 @@ class V8_EXPORT HeapGraphNode { // snapshot items together. kConsString = 10, // Concatenated string. A pair of pointers to strings. kSlicedString = 11, // Sliced string. A fragment of another string. - kSymbol = 12 // A Symbol (ES6). + kSymbol = 12, // A Symbol (ES6). + kSimdValue = 13 // A SIMD value stored in the heap (Proposed ES7). }; /** Returns node type (see HeapGraphNode::Type). */ @@ -286,7 +287,7 @@ class V8_EXPORT HeapGraphNode { * of the constructor (for objects), the name of the function (for * closures), string value, or an empty string (for compiled code). */ - Handle GetName() const; + Local GetName() const; /** * Returns node id. For the same heap object, the id remains the same @@ -429,8 +430,8 @@ class V8_EXPORT HeapProfiler { * while the callback is running: only getters on the handle and * GetPointerFromInternalField on the objects are allowed. */ - typedef RetainedObjectInfo* (*WrapperInfoCallback) - (uint16_t class_id, Handle wrapper); + typedef RetainedObjectInfo* (*WrapperInfoCallback)(uint16_t class_id, + Local wrapper); /** Returns the number of snapshots taken. */ int GetSnapshotCount(); @@ -442,13 +443,13 @@ class V8_EXPORT HeapProfiler { * Returns SnapshotObjectId for a heap object referenced by |value| if * it has been seen by the heap profiler, kUnknownObjectId otherwise. */ - SnapshotObjectId GetObjectId(Handle value); + SnapshotObjectId GetObjectId(Local value); /** * Returns heap object with given SnapshotObjectId if the object is alive, * otherwise empty handle is returned. */ - Handle FindObjectById(SnapshotObjectId id); + Local FindObjectById(SnapshotObjectId id); /** * Clears internal map from SnapshotObjectId to heap object. The new objects @@ -473,7 +474,8 @@ class V8_EXPORT HeapProfiler { * Returns name to be used in the heap snapshot for given node. Returned * string must stay alive until snapshot collection is completed. */ - virtual const char* GetName(Handle object) = 0; + virtual const char* GetName(Local object) = 0; + protected: virtual ~ObjectNameResolver() {} }; diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 180969f1161e78..98dca238c85605 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. #define V8_MAJOR_VERSION 4 -#define V8_MINOR_VERSION 4 -#define V8_BUILD_NUMBER 63 -#define V8_PATCH_LEVEL 30 +#define V8_MINOR_VERSION 5 +#define V8_BUILD_NUMBER 103 +#define V8_PATCH_LEVEL 35 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 910279b52e6b29..062dd5f21fb275 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -94,6 +94,7 @@ class Primitive; class Promise; class RawOperationDescriptor; class Script; +class SharedArrayBuffer; class Signature; class StartupData; class StackFrame; @@ -102,7 +103,6 @@ class String; class StringObject; class Symbol; class SymbolObject; -class Private; class Uint32; class Utils; class Value; @@ -215,8 +215,8 @@ class Local { : val_(reinterpret_cast(*that)) { /** * This check fails when trying to convert between incompatible - * handles. For example, converting from a Handle to a - * Handle. + * handles. For example, converting from a Local to a + * Local. */ TYPE_CHECK(T, S); } @@ -311,7 +311,6 @@ class Local { friend class String; friend class Object; friend class Context; - friend class Private; template friend class internal::CustomArguments; friend Local Undefined(Isolate* isolate); friend Local Null(Isolate* isolate); @@ -331,9 +330,11 @@ class Local { }; -// Handle is an alias for Local for historical reasons. +#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS) +// Local is an alias for Local for historical reasons. template using Handle = Local; +#endif /** @@ -418,11 +419,11 @@ class WeakCallbackInfo { V8_INLINE void* GetInternalField(int index) const; V8_INLINE V8_DEPRECATE_SOON("use indexed version", - void* GetInternalField1()) const { + void* GetInternalField1() const) { return internal_fields_[0]; } V8_INLINE V8_DEPRECATE_SOON("use indexed version", - void* GetInternalField2()) const { + void* GetInternalField2() const) { return internal_fields_[1]; } @@ -496,7 +497,7 @@ template class PersistentBase { * and create a new one with the contents of other if other is non empty */ template - V8_INLINE void Reset(Isolate* isolate, const Handle& other); + V8_INLINE void Reset(Isolate* isolate, const Local& other); /** * If non-empty, destroy the underlying storage cell @@ -517,7 +518,8 @@ template class PersistentBase { return *a == *b; } - template V8_INLINE bool operator==(const Handle& that) const { + template + V8_INLINE bool operator==(const Local& that) const { internal::Object** a = reinterpret_cast(this->val_); internal::Object** b = reinterpret_cast(that.val_); if (a == NULL) return b == NULL; @@ -530,7 +532,8 @@ template class PersistentBase { return !operator==(that); } - template V8_INLINE bool operator!=(const Handle& that) const { + template + V8_INLINE bool operator!=(const Local& that) const { return !operator==(that); } @@ -693,11 +696,12 @@ template class Persistent : public PersistentBase { */ V8_INLINE Persistent() : PersistentBase(0) { } /** - * Construct a Persistent from a Handle. - * When the Handle is non-empty, a new storage cell is created + * Construct a Persistent from a Local. + * When the Local is non-empty, a new storage cell is created * pointing to the same object, and no flags are set. */ - template V8_INLINE Persistent(Isolate* isolate, Handle that) + template + V8_INLINE Persistent(Isolate* isolate, Local that) : PersistentBase(PersistentBase::New(isolate, *that)) { TYPE_CHECK(T, S); } @@ -785,12 +789,12 @@ class Global : public PersistentBase { */ V8_INLINE Global() : PersistentBase(nullptr) {} /** - * Construct a Global from a Handle. - * When the Handle is non-empty, a new storage cell is created + * Construct a Global from a Local. + * When the Local is non-empty, a new storage cell is created * pointing to the same object, and no flags are set. */ template - V8_INLINE Global(Isolate* isolate, Handle that) + V8_INLINE Global(Isolate* isolate, Local that) : PersistentBase(PersistentBase::New(isolate, *that)) { TYPE_CHECK(T, S); } @@ -835,8 +839,11 @@ class Global : public PersistentBase { typedef void MoveOnlyTypeForCPP03; private: + template + friend class ReturnValue; Global(Global&) = delete; void operator=(Global&) = delete; + V8_INLINE T* operator*() const { return this->val_; } }; @@ -972,45 +979,69 @@ class V8_EXPORT Data { }; +/** + * The optional attributes of ScriptOrigin. + */ +class ScriptOriginOptions { + public: + V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false, + bool is_shared_cross_origin = false, + bool is_opaque = false) + : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) | + (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | + (is_opaque ? kIsOpaque : 0)) {} + V8_INLINE ScriptOriginOptions(int flags) + : flags_(flags & + (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {} + bool IsEmbedderDebugScript() const { + return (flags_ & kIsEmbedderDebugScript) != 0; + } + bool IsSharedCrossOrigin() const { + return (flags_ & kIsSharedCrossOrigin) != 0; + } + bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; } + int Flags() const { return flags_; } + + private: + enum { + kIsEmbedderDebugScript = 1, + kIsSharedCrossOrigin = 1 << 1, + kIsOpaque = 1 << 2 + }; + const int flags_; +}; + /** * The origin, within a file, of a script. */ class ScriptOrigin { public: V8_INLINE ScriptOrigin( - Handle resource_name, - Handle resource_line_offset = Handle(), - Handle resource_column_offset = Handle(), - Handle resource_is_shared_cross_origin = Handle(), - Handle script_id = Handle(), - Handle resource_is_embedder_debug_script = Handle(), - Handle source_map_url = Handle()) - : resource_name_(resource_name), - resource_line_offset_(resource_line_offset), - resource_column_offset_(resource_column_offset), - resource_is_embedder_debug_script_(resource_is_embedder_debug_script), - resource_is_shared_cross_origin_(resource_is_shared_cross_origin), - script_id_(script_id), - source_map_url_(source_map_url) {} - V8_INLINE Handle ResourceName() const; - V8_INLINE Handle ResourceLineOffset() const; - V8_INLINE Handle ResourceColumnOffset() const; + Local resource_name, + Local resource_line_offset = Local(), + Local resource_column_offset = Local(), + Local resource_is_shared_cross_origin = Local(), + Local script_id = Local(), + Local resource_is_embedder_debug_script = Local(), + Local source_map_url = Local(), + Local resource_is_opaque = Local()); + V8_INLINE Local ResourceName() const; + V8_INLINE Local ResourceLineOffset() const; + V8_INLINE Local ResourceColumnOffset() const; /** * Returns true for embedder's debugger scripts */ - V8_INLINE Handle ResourceIsEmbedderDebugScript() const; - V8_INLINE Handle ResourceIsSharedCrossOrigin() const; - V8_INLINE Handle ScriptID() const; - V8_INLINE Handle SourceMapUrl() const; + V8_INLINE Local ScriptID() const; + V8_INLINE Local SourceMapUrl() const; + V8_INLINE ScriptOriginOptions Options() const { return options_; } private: - Handle resource_name_; - Handle resource_line_offset_; - Handle resource_column_offset_; - Handle resource_is_embedder_debug_script_; - Handle resource_is_shared_cross_origin_; - Handle script_id_; - Handle source_map_url_; + Local resource_name_; + Local resource_line_offset_; + Local resource_column_offset_; + ScriptOriginOptions options_; + Local script_id_; + Local source_map_url_; }; @@ -1025,16 +1056,16 @@ class V8_EXPORT UnboundScript { Local diff --git a/doc/tsc-meetings/2015-08-12.md b/doc/tsc-meetings/2015-08-12.md new file mode 100644 index 00000000000000..88b08b91cf4e51 --- /dev/null +++ b/doc/tsc-meetings/2015-08-12.md @@ -0,0 +1,87 @@ +# Node.js Foundation TSC Meeting 2015-08-12 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-08-12 +* **GitHub Issue**: https://github.com/nodejs/node-convergence-archive/issues/71 +* **Minutes Google Doc**: https://docs.google.com/document/d/1q2bFjnf0Y23Ljxoze56Pmrbailaj5-UAqIUqIYVhiIk +* _Previous Minutes Google Doc: _ + +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests prior to meeting. + +* Travel assistance amendment (no issue for this) +* FYI: Collaboration WG: https://github.com/nodejs/collaboration +* Summit recap +* level-set on repo rename +* Future: “project lifecycle” (Mikeal) - process by which top level projects are added (libuv, node-gyp, etc), (conferences…) + + +## Minutes + + +### Present + +* Mikeal Rogers +* Rod Vagg (TSC) +* James Snell (TSC) +* Michael Dawson (TSC) +* Steven R Loomis (TSC) +* Chris Dickinson (TSC) +* Alexis Campailla (TSC) +* Brian White (TSC) + +### Review of the previous meeting + +* Next branch release versioning [#2215](https://github.com/nodejs/io.js/issues/2215) +* TSC Chair - Election? + +### Standup: + +* Mikeal: summit, code & learn project for new collab +* Rod: Summit, migrating nodejs/io.js to nodejs/node +* James: convergence, joyent/node PRs +* Michael: patch for AIX, 0.12 work, Benchmarking meeting +* Steven: Summit, 1st Intl meeting, Intl convergence work, VS2015 fixes +* Chris: Summit, Docs repo has taken off, [HTTP lifecycle doc by Bryan English](https://github.com/nodejs/docs/blob/master/src/guides/anatomy-of-an-http-transaction.md) +* Alexis: Summit, progress on CI convergence, reviewed some PRs. +* Brian: Triaging and reviewing PRs and Issues. + +### Travel assistance amendment (no issue for this) + +* Chris Dickinson adding $500 to the travel expenditure +* Passed unanimously. + +### FYI: Collaboration WG: https://github.com/nodejs/collaboration + +* Steven: new WG coming out of the Summit, Sean (@snostorm) is taking lead on this. One idea under discussion now is to have a multi-timezone meetings for the language working groups. +* Mikeal: is this going to serve as a collaboration point for the language groups? +* Steven: https://github.com/nodejs/Intl/issues/9 +* Rod: beyond the language groups, what are the aims of this new group? +* Steven: trying to address, or having a place to discuss, common items across working groups. +* James: filling a need to liaise with the other working groups, acting as an intermediary + +### Summit recap + +* Mikeal: 6 sessions in 2 days, not solid answers to problems but a shared understanding of the common problems, feels like we are on the same page from that +* Mikeal: bigger sessions: what is the Node API and what is the Node platform? V8 release cycle. Errors and the inconsistencies. Kept coming back to the collaboration WG, which is why it exists. Talked about expanding the collaborator base, idea was to do some collaboration sprints to bring new folks up to speed, https://github.com/nodejs/code-and-learn comes from that idea (there is foundation budget for that). +* Mikeal: there were extensive notes taken, those are being edited now and will be published into the repo(s) and turned into blog posts. + +### level-set on repo rename + +* James: what are the remaining things to do - there’s confusion around the naming + - Renaming everything in the documentation (README, docs & other misc docs) + - Renaming binary + - Alexis: finishing convergence work +* Mikeal: preparing a blog post about what’s happening, will be reviewed and posted soon + +### Future: “project lifecycle” (Mikeal) - process by which top level projects are added (libuv, node-gyp, etc), (conferences…) + +* Mikeal: the TSC charter states that we will adopt a project lifecycle that will allow us to bring in other _top level projects_. Additionally, the TSC has had to take on board some non-technical work because of its position in the Foundation (voting on expenditure, etc.), a number of TSC members don’t want to be involved in that kind of activity. Have started drafting a new project lifecycle plan which splits off a “Core TSC” that contains the existing TSC members but with a focus on Node.js Core work while the existing TSC will take on board the higher-level foundation work and members can optionally resign if they aren’t interested in that work and we can expand it to non-Core collaborators. https://github.com/nodejs/TSC/tree/lifecycle + + +### Next Meeting + +August 19th + diff --git a/doc/tsc-meetings/2015-08-26.md b/doc/tsc-meetings/2015-08-26.md new file mode 100644 index 00000000000000..54cf3377865e08 --- /dev/null +++ b/doc/tsc-meetings/2015-08-26.md @@ -0,0 +1,112 @@ +# Node Foundation TSC Meeting 2015-08-26 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-08-26 +* **GitHub Issue**: https://github.com/nodejs/node/issues/2560 +* **Minutes Google Doc**: https://docs.google.com/document/d/1aB76ClCgdjZUw3p-gHq9j6YwU11zWgJ4pmYPEWk6gjE +* _Previous Minutes Google Doc: _ + +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting. + +### joyent/node + +* Update README to reflect move to nodejs/node [#25897](https://github.com/joyent/node/pull/25897) + +### nodejs/node + +* doc: merge CHANGELOG.md with joyent/node ChangeLog [#2536](https://github.com/nodejs/node/pull/2536) +* (guidance on) rename of "language groups" from iojs-* to nodejs-*? [#2525](https://github.com/nodejs/node/issues/2525) +* Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522) + +### nodejs/collaboration + +* How to onboard into WG? [#4](https://github.com/nodejs/collaboration/issues/4) + +## Minutes + + +### Present + +* Rod Vagg (TSC) +* Brian White (TSC) +* Steven R Loomis (TSC) +* Fedor Indutny (TSC) +* Bert Belder (TSC) +* Colin Ihrig (TSC) +* Ben Noordhuis (TSC) +* Mikeal Rogers +* Alexis Campailla (TSC) +* Trevor Norris (TSC) +* Shigeki Ohtsu (TSC) + + +### Review of the previous meeting + +* Travel assistance amendment (no issue for this) +* FYI: Collaboration WG: https://github.com/nodejs/collaboration +* Summit recap +* level-set on repo rename +* Future: “project lifecycle” (Mikeal) - process by which top level projects are added (libuv, node-gyp, etc), (conferences…) + +### Standup: + +* Rod Vagg: v4 release stuff, got certificates from/for the foundation, new website including CDN offering from CloudFlare +* Brian White: continuing work on benchmark app for node.js/io.js, triaging, reviewing/answering issues and pull requests. +* Steven R Loomis: Intl for convergence VS2015 +* Fedor Indutny: http perf improvement PR, reviewing PRS, looking at issue for shared ports for http cluster +* Bert Belder: busy with work, reviewing libuv PRs and responding to issues +* Colin Ihrig: Rename from io.js to Node.js, reviewing issues and PRs +* Ben Noordhuis: Running native addons as part of CI, libuv bugs, reviewing PRs +* Mikeal Rogers: Website ready for release, working on CloudFlare CDN stuff +* Alexis Campailla: CI for release, parallelising test runs for ARM, looking at managing dependencies with git +* Trevor Norris: reviewing PRs and issues +* Shigeki Ohtsu: reviewing convergence tests for SSLv2/3, working on TLS ALPN features before freeze + +### Update README to reflect move to nodejs/node [#25897](https://github.com/joyent/node/pull/25897) + +* Alexis: made changes in CI to prepare for this, we’ll keep PRs in original repo, node-accept-pull-request will land changes in new repo as well, mirroring changes in 0.10 and 0.12 across both old and new repos. Still using the old Jenkins for releases for 0.10 and 0.12 right now and that doesn’t depend on repo name & location. +Target ETA for transition: Monday. + + +### doc: merge CHANGELOG.md with joyent/node ChangeLog [#2536](https://github.com/nodejs/node/pull/2536) + +* Rod seeking confirmation from this group that this was _not a bad idea_. +* Discussion about documentation for people upgrading from older versions of Node and having a linear history. Jeremiah has been working on 0.10 -> v4 documentation. + +### (guidance on) rename of "language groups" from iojs-* to nodejs-*? [#2525](https://github.com/nodejs/node/issues/2525) + +* Steven discussed renaming the language groups +* Mikeal: some groups are not in a position to make decisions because they are not active but the ones that are should be given the opportunity to agree or disagree to the move rather than us imposing a move on them. We should post an issue in their repos. +* Steven: we should give them a timeline in issues in their repos +* Discussed naming, could be “lang” or “community” to make it more clear what they are about. +* ACTION: Steven to add a proposal to #2525, let TSC/collaborators add comments, later in the week will reach out to each of the groups. + +### Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522) + +* Rod gave a summary of the proposed release timeline https://github.com/nodejs/node/issues/2522 (and appologised for documenting it as “the” release proposal just for the sake of getting it done). + - “feature freeze” Friday, 28th of August, cut v4.x branch + - nodejs.org DNS changeover to new website Monday, 31st of August + - release Thursday, 3rd of September + - RC builds between website and release + - backup release date of Monday, 7th of September if absolutely necessary to punt +* Discussed the outstanding items in the 4.0.0 milestone: https://github.com/nodejs/node/milestones/4.0.0, some concerning items: + - mdb support is late and may not get done, might have to be a semver-minor prior to LTS + - vcbuilt.bat needs to use the new build_release target and we have to verify that all builds have Intl enabled - Steven to work with Rod on this + - `process.send()` async/sync, Ben said that this is async on all platforms now (was just Windows previously but now it’s cross-platform) but it’s missing a callback so there’s no way of doing back-pressure. No time to add this prior to v4 but could be done as semiver-minor later. Ben agreed to document current behaviour properly in the docs. + - `_unrefActive` is in Jeremiah’s hands, he will land the 0.12 changes as the io.js version is terrible. Discussed further perf improvements but agreed to leave those changes till later, ideally till v5 because of the potential for subtle edge-case bugs being introduced. + +### How to onboard into WG? [nodejs/collaboration#4](https://github.com/nodejs/collaboration/issues/4) + +* Discussed GitHub onboarding mechanics + +### V8 embedders unified debugger proposal + +* Trevor raised https://github.com/nodejs/node/issues/2546 which is a proposal for a unified debugger for V8 embedders using Chromium DevTools. +* Discussion ensued, agreed to leave it for GitHub discussion unless/until there is something the TSC actually needs to make a decision about. + +### Next Meeting + +September 2nd diff --git a/doc/tsc-meetings/2015-09-02.md b/doc/tsc-meetings/2015-09-02.md new file mode 100644 index 00000000000000..36f3a9efb7ae9e --- /dev/null +++ b/doc/tsc-meetings/2015-09-02.md @@ -0,0 +1,418 @@ +# Node Foundation TSC Meeting 2015-09-02 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-09-02 +* **GitHub Issue**: https://github.com/nodejs/node/issues/2654 +* **Minutes Google Doc**: https://docs.google.com/document/d/1rXBdtsD9PJTExNXgzNZ9bez9oOjW45kLPjun4zdt0dY +* _Previous Minutes Google Doc: _ + +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting. + +### nodejs/node + +* deps: update v8 to 4.5.103.30 [#2632](https://github.com/nodejs/node/pull/2632) +* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) +* Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522) +* doc: update COLLABORATOR_GUIDE.md [#2638](https://github.com/nodejs/node/pull/2638) + +### nodejs/build + +* Merge job overwrites metadata [#179](https://github.com/nodejs/build/issues/179) + +## Minutes + + +### Present + +* Rod Vagg (TSC) +* Brian White (TSC) +* Steven R Loomis (TSC) +* Fedor Indutny (TSC) +* Bert Belder (TSC) +* Colin Ihrig (TSC) +* Trevor Norris (TSC) +* James M Snell (TSC) +* Chris Dickinson (TSC) +* Jeremiah Senkpiel (TSC) + +### Standup + +* Rod Vagg (TSC): node v4 prep, new website +* Brian White (TSC): issue/PR reviewing, working on JS DNS implementation some more +* Steven R Loomis (TSC): syncing with james, creating text for renaming of language groups (#2525), intl triaging, commenting on joyent/node issues +* Bert Belder (TSC): indisposed until end of october +* Colin Ihrig (TSC): reviewing issues/prs +* Trevor Norris (TSC): prs/issues, finagling the new build pr landing tool +* James M Snell (TSC): old prs in joyent/node cleaned up (64 remaining, wow), citgm tool updates, child process arguments pr, nodeconf.eu +* Michael Dawson (TSC): AIX support PR, some triage with Devin, preparing for NodeConfEU +* Chris Dickinson (TSC): Static analysis work (ongoing), docs (slowly), npm +* Jeremiah Senkpiel (TSC): v4 release prep +* Fedor Indutny (TSC): v8 arraybuffer perf, patch landed on v8; reviewing PRs + + +### Jenkins merge jobs always overwrites PR-URL and Reviewed-By [#179](https://github.com/nodejs/build/issues/179) + +Trevor: currently if you submit a job to land a pr, it will always remove all existing metadata and re-apply it based on the info passed to the jenkins build. from convo, good fix is to let old metadata persist & only append new metadata if it’s entered, if no metadata entered, nothing appended +Issue with current state: current system does not work for cherry-picks onto release branch — will wipe metadata and replace it +Goal: solidify with TSC that this is a good path forward + +James: absolutely, +1 + +Jeremiah: clarification on which branches this applies to + +Rod: cherry-picks are becoming increasingly difficult on iojs anyway, so the pr landing job may be master-specific + +James: no mixing of “with pr tool” and “manually”, things go bad quickly that way + +Trevor: cherry-pick PRs are accumulating too many cherry-picks; runnin it through the system manually doesn’t add useful info + +Domenic: description of chromium + - tests are run after landing + - no one is allowed to land commits if the build is broken on a branch + - sheriff of the day is responsible for fixing the issue + - in practice it’s painful, but it’s important for keeping things sane + +Trevor: this would make us better about flaky tests, also, admiration for how sporadically our flaky tests break + +Jeremiah: trying to do this now before v4 seems like a bad idea + +Rod: we’re smoothing out a little bit; circle back to original topic, we’re kind of talking about the larger issue, let the trial of the tool continue and come back to the discussion later. specifically: ask that metadata not be overridden in a github issue + +Domenic: addressing jeremiah’s concern: should we not run the trial while releasing v4? + +Trevor: agreement — have felt pain from this as we march to v4 + +Jeremiah: stuff that gets released to people is in the release branches, if we’re not using the pr tool on that branch, what is the point of using this tool? + +Rod: this will become more of a problem as we have more extended and LTS + +Domenic: clarification: intent of ci is to make sure tests pass everywhere + +Trevor: this tool only runs a subset + +Rod: since we branched 3.x there’s 4 commits in the tree that have faulty/missing metadata — like that the pr tool is enforcing this metadata, maybe move to using github status api for telling us whether the metadata is OK + +Trevor: clarify: contributors have landed commits that lack metadata? + +Rod: yep + +Trevor: argh + +Jeremiah: github suggested we use the status api + +Trevor: status api autoruns? + +Rod: you hook it up to webhooks, has in-progress and pass/fail + +Trevor: TJ can verify that devs destroy jenkins (multiple force pushes explode the jenkins box with so many jobs) + +Rod: we can cancel on force push (or add a “trevor is pushing, wait half an hour to run the tests” exception, har har) + +Jeremiah: you can tell if it’s been run on the last commits + +Rod: multiple statuses — up to 100? — “this pr is passing on these platforms! this pr has the right metadata. this pr lints well.” + +Rod: let’s move on! + +James: what’s the action item? + +Rod: don’t feel that we should cancel the trial + +Trevor: two prs that prevent segfaults because of other flaky tests that have to be reapplied + +James: in the 4.x branch do we need to use test-pr job to land commits? + +Rod: nope, cherry-pick onto those branches, only use the tool on master + +Jeremiah: it’s weird to use it on the unstable branch. I guess we could make it better for release branches in the meantime +* ci-run middle of hte night us time this has a + +Rod: vote for who whether we’d like to put this on hold + +Jeremiah: +0 put on hold + +Rod: who would like to continue it? + +...crickets... + +Trevor: give me another day + +James: one PR took 8 hours to land last friday + +Jeremiah: they take about an hour to land right now + +Rod: they are getting quicker, adding raspberrypis to the cluster. good incentive to make node startup time quicker! arm startup times have gone down over the last month or so + +Rod: let’s move on + +### doc: update COLLABORATOR_GUIDE [#2638](https://github.com/nodejs/node/pull/2638) + +Jeremiah: Alexis wanted to put the pr tool into the collaborator guide should punt on this right now notifying collaborators on issues is more effective messaging than the docs + +Rod: let’s hold off + +### deps: update v8 to 4.5.103.30 [#2632](https://github.com/nodejs/node/pull/2632) + +Rod: looking at the possibility of jumping to 4.5 for the v4 release it’s ready to merge. ofrobots has been doing the work, it’s good to go, there are pros and cons whether we stick with 4.4 or 4.5 for this release & associated LTS has anyone done any work on testing NAN? + +Bert: what breaks? what are the cons? + +Domenic: looking at v8 by code inspection, there are no breakages, just new deprecations — should *in theory* work — I don’t think anyone’s been testing it though + +Bert: can this v8 release be supported for LTS? we don’t know if this is better or worse than 4.4? maybe ask goog eng + +Trevor: they will say “Stay current” + +Bert: I think I agree with them — with no other info, picking the latest version seems best + +Michael: Z targets 4.4 — just recently got it fully clean — a move to 4.5 would cause a delay on getting release to community + +James: that’s just Z, not PPC, yes? + +Rod: how much work? + +Michael: going 4.3->4.4 took about a month + +Jeremiah: 4.3->4.4 breakage delta was much bigger + +Rod: that’s the external API though + +Michael: 7-8 patches/week? if we have to upgrade it will be extra work + delay for us + +James: if we’re sitll looking at LTS in early-mid oct, it’s going to give us a month to prove out v8 4.5 + +Domenic: we’ve been proving out 4.5 for 12 weeks + +Rod: we’re talking node here, though we’d have google support for an extra month. my concern is: we need v4 out now, latest by monday, this is a quick change and there’s potential for breakage + +James: we decided before that we weren’t going to make such a big change so quickly before a release. i agree with rod, but such a big change makes me nervous — making sure that nan et al works with 4.5 is a concern + +Jeremiah: we’re not going to be the ones to find the flaws in 4.5; want clarification on nan major/minor/patch? + +Rod: minor + +Domenic: should require no changes + +Rod: benjamin (kkoopa) is on the positive side of this, he wants to see us move to 4.5, and is willing to put in the work to do this + +Trevor: not that it matters much, but node has taken a hit from v8 in terms of perf recently, 4.5 has some improvements, fedor wrote an easily backportable patch as well, there are perf advantages + +James: it makes me nervous that we’ll have enough time to test things on the node side before LTS — if we’re comfortable saying we have a plan that we think exercises this before going LTS, I’m more ok + +Jeremiah: technically we have over a month + +Rod: vote + +who is leaning sticking to 4.4 + +James + michael + steven + +4.5: + +fedor, colin, jeremiah, brian, chris + +Rod: clarifying concerns + +Michael: share concerns with james, but also Z + +Rod: longer we have to support our own V8, the harder it is, and another 6 weeks of support would be great great + +James: I’m -0 + +Rod: spending some time today testing some existing addons taht have upgraded to nan@2. if there’s breakage, that tells me nan’s not ready, and that should be taken into account + +Domenic: if nan’s not ready, we don’t upgrade + +Rod: heading for 4.5, but with final go/no-go coming from nan testing; where are you at on this bert? + +Bert: I am happy to upgrade if you land it and nothing changes — which sounds like it might be the case (sans deprecation warnings) + +Rod: want ben’s opinion, but there may be no chance of that? + +Bert: it seems silly to go with a version that is almost already out of support, but OTOH, on the scale of LTS lifetime, 6 weeks is not really significant + +I wouldn’t worry too much about actual bugs in v8, about as likely in 4.5 as in 4.4; LTS is not about “no bugs”, it’s about “We support it” + +Rod: we want a **solid** release, though + +Bert: the LTS will also have a beta for a while, yes? + +Rod: the beta period for LTS is the stable line + +James: first LTS will have a beta of a little over a month, in the future 6 months + +Bert: realistically a month is a longer beta than we’ve ever had before + +Rod: 0.12 had a beta of 2 years + +{zing} :trollface: + +Bert: a beta with a lot of api changes, which is explicitly what we’re not going to do + +Bert: we need to move on + +Jeremiah: 4.5 brings arrow functions and that will make many people very happy + +Rod: it’s a good sales pitch! + +Rod: I’ll make the call. + +### Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522) + +Rod: status update: v4 was to get out by Thurs, slipping on that, monday is the release date, cannot afford to slip any further + +Jeremiah: what’s actually slipping other than mdb? + +Rod: we’re not going to get mdb into v4, encourage before LTS, but that’s the best we can do, child process argument type checking where are we at on that? + +Trevor: it’s not ready + +James: working on that PR right now + +Rod: great, that feels like a fairly light one, process.send is the other one; ben’s on holiday, where are we at with that pr of his + +Jeremiah: multiple people have soft signed off on it + +Colin: weren’t there some strange ci failures with it? + +Rod: do not know, does someone want to put their hand up for that? + +Trevor: what’s the PR number? + +Jeremiah: #2620 + +Jeremiah: Trevor +1’d it + +Jeremiah: OH! that’s the one with the weird test failures we could not reproduce the breakage + +Rod: this seems like it can be run again and it won’t show flaky tests: maybe we should just re-run it + +Trevor: that really sucks when you’re trying to land 3 tests + +Rod: test runner should auto-rerun to make sure + +Trevor: oh, gotcha + +Rod: that’d be really quick for flaky tests + +Trevor: I’ve already reviewed and LGTM’d it, I’ll look at running it through the land-ci job + +James: looked at it earlier today, nothing concerning stood out + +Rod: no RC’s are out! that’s a problem! we’ve renamed the executable. I wanted to have a period of time where folks could download (with a working node-gyp) — we need this period of time. I’ve been working on that, some bits and pieces to get things to the right place on the server. first build had a broken OS X installer. there are a few yaks yet to shave, so that’s why we can’t get this out by thursday + +Rod: steven: could you confirm that 3.x has INTL enabled? + +Steven: will look into, take as action item (confirmed!) + +Rod: not going to tick that off till we confirm, but I _think_ that one’s done + +Rod: how’s everyone with the timeline? rcs ASAP + release on monday + +James: sounds reasonable, yes. will take as much time as possible on monday. several of us will be at nodeconf, so that complicates + +Rod: I’m using monday in airquotes, it’ll be tuesday for me. other thing: smoke testing, citgm, I’ve been using it, and there are a lot of weird failures, after v4 we’re going to have to switch modes to make the ecosystem happy with it + +Rod: let’s move ahead with that plan; nodeconf.eu is going to take up a lot of time for a lot of folk. congrats to everyone that contributed to new website, it seems really smooth + +### Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) + +Rod: opened by member of v8 team, extracting debugger code from blink and making it so all embedded v8 projects can use it + +Trevor: gist is: devtools team is considering pulling inspector out of blink into its own project so we could consume it; domenic can correct me wherever I’m wrong here, + +Domenic: “making node work the same as android” able to point chrome dev tools at node processes to debug ‘em + +???: only works with chrome + +Trevor: OTW API we consume have remained fairly stable, even if the API does change, chrome dev tools is capable of pulling in a previous version, making sure it’s possible to use with LTS releases + +OTW wire is generic, consumable by anyone, chrome dev tools is a key consumer, but anyone can consume (new consoles can compete!) + +cons: + +APIs going to need to be tightly integrated — needs to know about all async events + add conditionals to e.g. nextTick + timers + +Domenic: add something to MakeCallback? + +Trevor: we have to add it to that + on the way back in + +Domenic: this is for async stack traces + +Trevor: we don’t have to have it + +Bert: that’s awesome, because we have to grow a single entry point (opposite MakeCallback) + +Trevor: not going touch nextTick/timers, though — need to wrap each (because those APIs don’t roundtrip to C++ for each callback) + +Bert: we don’t have to do that immediately though, but eventually it’d be a good idea + +Domenic: could also move to microtask for nexttick — integrating with domains sounds hard, then we get those events for us + +Trevor: would you be able to do unhandledRejections? + +Domenic: we already have this for promises + +Rod: if we could use this as a good justification for removing domains, that’d be awesome + +Trevor: next point is pro and con: importantly, we’d have to support websockets natively in node + +Jeremiah: we could just keep ‘em private + +Trevor: that would just anger people + +Domenic: you could bundle them and hide them while you’re not clear on the api, iterate and expose later + +Rod: that’s a good point + +Trevor: the interesting flip to this: they need to be running off the main thread, in a debugger thread — it can all be written in C++ + +mscdex: any way to avoid websockets? + +Trevor: no + +Bert: is the protocol really that complicated? I don’t think so — especially sans full HTTP and WSS — just websockets though is probably not difficult + +Trevor: necessary because it’s the protocol that chrome dev tools uses + +Rod: decision points: are we being asked to get on board? + +Trevor: them removing the inspector from blink depends on whether we’ll use it if they do it. + +Rod: debugging in node sucks, we are shipping with substandard debugging in v4, we don’t have the contributors + collaborators to make this better, so if we can lean on v8 to do this, I’m +1 + +debugging is important enough to override “small core” + +Bert: we’re not adding the full inspector, _just_ the protocol + +Trevor: wasn’t completely clear on how much API we’d need to implement + +Domenic: we should get clarification on this + +Trevor: if we can implement this in segments — if we’re all +1 on this, we need to create a new isolate, but … + +Domenic: would the workers pr solve this? + +Trevor: probably overkill. I’m +1 on the debugger + +Bert: I propose we don’t vote + +{broad assent} + +Rod: trevor + domenic: you’ve got enough input + +Domenic: only worry is finding someone to devote some of their daytime hours to implement websockets + +Rod: nodesource could contribute, related to our interests + +Trevor: even if we don’t say yes today, taking inspector out of blink is a complicated process and will take time + +Rod: anything else? + +### Next Meeting + +September 9th diff --git a/doc/tsc-meetings/2015-09-16.md b/doc/tsc-meetings/2015-09-16.md new file mode 100644 index 00000000000000..2f3d6af395a331 --- /dev/null +++ b/doc/tsc-meetings/2015-09-16.md @@ -0,0 +1,116 @@ +# Node Foundation TSC Meeting 2015-09-16 + +## Links + +* **Audio Recording**: https://soundcloud.com/node-foundation/tsc-meeting-2015-09-16 +* **GitHub Issue**: https://github.com/nodejs/node/issues/2898 +* **Minutes Google Doc**: https://docs.google.com/document/d/1RCR2pGOc2d80NNusaX5DZaktWvHEsDUqfEZP-tvexBk +* _Previous Minutes Google Doc: _ + +## Present + +* Rod Vagg (TSC) +* Brian White (TSC) +* Steven R Loomis +* Fedor Indutny (TSC) +* Bert Belder (TSC) +* Colin Ihrig (TSC) +* Trevor Norris (TSC) +* Shigeki Ohtsu (TSC) +* Chris Dickinson (TSC) +* Jeremiah Senkpiel (TSC) +* Ben Noordhuis (TSC) +* Alexis Campailla (TSC) +* Domenic Denicola +* Michael Dawson + +## Agenda + +Extracted from **tsc-agenda** labelled issues and pull requests in the nodejs org prior to meeting. + +### nodejs/node-v0.x-archive + +* 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) + +### nodejs/node + +* 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) + +## Minutes + +Due to IBM’s acquisition of StrongLoop, IBM is over the TSC 25% company limit rule. Michael Dawson and Steven Loomis have stepped down from TSC, but they are here as observers. + +### Standup + +* Rod Vagg: Released 4.0.0, also 3.3.1 maintenance release. Getting the build system ready for building/publishing 0.10 and 0.12 binaries. +* Brian White: not much, triaging issues and PRs, some work on dns parser +* Steven R Loomis: tsc resignation for IBM/SL merge, some issue triage, working on a more robust download for ICU (ICU server was overloaded, fixed to ICU again redirects to sourceforge, discussed longer term discussions) +* Fedor Indutny: v8’s ArrayBuffer fixes, reviewing PRs, fixing issues +* Bert Belder: very few reviews/issue comments. Some libuv work on rwlocks. +* Colin Ihrig: not much, some issue tracker work +* Trevor Norris: Trying to make things (including Buffers) faster, some issue/PR review +* Shigeki Ohtsu: Just a few reviews of issues. +* Chris Dickinson: Working on shoving static npm analysis data into a database, slowly +* Jeremiah Senkpiel: NodeConf.eu, issues and PRs, 4.1.0 release +* Ben Noordhuis: only PR review and responding to bug reports, a patch or two upstreamed to v8 +* Alexis Campailla: ARM cross-compile for CI. Misc fixes for VS 2015 / Win10 +* Domenic Denicola: some issue and PR review, talking with v8 team +* Michael Dawson: landed the build updated for AIX, also updating the tests for AIX where necessary. Looking into PPC failures. Working on getting us hooked into v8 security notifications. + +### Previous meeting’s agenda + +* Jenkins merge jobs always overwrites PR-URL and Reviewed-By [#179](https://github.com/nodejs/build/issues/179) +* doc: update COLLABORATOR_GUIDE [#2638](https://github.com/nodejs/node/pull/2638) +* deps: update v8 to 4.5.103.30 [#2632](https://github.com/nodejs/node/pull/2632) +* Node.js v4 Release Timeline [#2522](https://github.com/nodejs/node/issues/2522) +* Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) + +### 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) + +Jeremiah: Are these things that we think we can do? Should we go ahead with that? Is it a good idea to deprecate these things? + +Ben: How are we going to deprecate? Literal `util.deprecate`? + +Jeremiah: Probably? + +Trevor: They’re already floating a patch + +Rod: I’m fine with deprecating smalloc + +Trevor: Is there a deprecation cycle between LTS? I’m not sure how this would work? (i.e., if we deprecate now, LTS -> LTS upgraders will not see a deprecation warning.) + +Rod: Maybe punt to LTS WG? It could be quite a lot — it could be that we decide between stable versions to remove things (or we’re forced to), do we backport the deprecation to LTS? + +Jeremiah: I think it should be only for things we’re _forced_ to remove + +Action: Punt to LTS WG + +### Inspecting Node.js with Chrome DevTools [#2546](https://github.com/nodejs/node/issues/2546) + +Trevor: Have an 80% understanding of the work needed: WebSocket support in core (though not necessarily exposed publicly), API injection points. Are we ok with including web sockets support one way or another? + +Rod, Domenic, others: +1 + +### util: Remove p, has been deprecated for years [#2529](https://github.com/nodejs/node/pull/2529) + +Discussion of Buffer “raw{s,}” encoding as well — undocumented, deprecated, inconsistently implemented in core. + +Action: Remove util.p (Jeremiah to respond.) + +Bert: Perhaps we should bulk remove? + +Rod: util.p is relatively trivial, has a deprecation warning, etc. + +Jeremiah: Brought this up because these things have been deprecated forever. util.exec has been deprecated for a while, as well. + +Trevor: raw/raws are deprecated in name only, no warnings, but C++ layer does not know about them (falls back to utf8) — maybe should be removed as a bugfix, because it does not work consistently. + +Action: Chris to list “least used stuff” (with apologies for how longs its taken!) + +### Next Meeting + +September 23 diff --git a/doc/tsc-meetings/2015-09-30.md b/doc/tsc-meetings/2015-09-30.md new file mode 100644 index 00000000000000..c10b9e75bc2ad9 --- /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/doc/tsc-meetings/io.js/2015-03-04.md b/doc/tsc-meetings/io.js/2015-03-04.md index 33431a5fab0f4a..4b1751a5c705be 100644 --- a/doc/tsc-meetings/io.js/2015-03-04.md +++ b/doc/tsc-meetings/io.js/2015-03-04.md @@ -117,7 +117,7 @@ Discussion of how we should probably just add more Buffer methods to core. Bert: there’s another aspect of this. At some point Node was really modern, but we’ve fallen behind. We can’t even get HTTP/2 or web sockets, we’re in trouble. -Domenic: we’ve learned a lot over the last few years that pushes us to user-land code instead of in core. But we need to have some things be “official.” +Domenic: we’ve learned a lot over the last few years that pushes us to userland code instead of in core. But we need to have some things be “official.” Trevor: I would like the infrastructure for HTTP/2 to be similar to HTTP/1, with http-parser etc. @@ -125,9 +125,9 @@ Ben: is there any reason HTTP/2 couldn’t be done in pure JS? Discussion of http-parser and current HTTP/1 implementation strategy and speed. -Bert: I think as a TC what we should say is “we would like to support HTTP/2, but want to see some user-land ideas first.” We don’t need to actually start implementation progress right now. +Bert: I think as a TC what we should say is “we would like to support HTTP/2, but want to see some userland ideas first.” We don’t need to actually start implementation progress right now. -Ben: does anyone on the TC want to write a user-land HTTP/2 module? +Ben: does anyone on the TC want to write a userland HTTP/2 module? Discussion of how Fedor already has a SPDY implementation. diff --git a/e.js b/e.js new file mode 100644 index 00000000000000..1f917aae762d1c --- /dev/null +++ b/e.js @@ -0,0 +1,21 @@ +s = require("child_process").spawn + +console.log('argv %j', process.argv); + +if (process.argv[2]) { + console.log('in child') + var l = require("net").createServer().listen(7001) + l.on('listening', function() { + console.log(this.address()); + }) + return +} + + +console.log("parent",process.execPath) + +// XXX stdio must be ignored or detach doesn't work - not mentioned in docs :-( +c=s(process.execPath, [__filename, 'child'], {detached: true, stdio: 'ignore'}); + +console.log('pid', c.pid) +c.unref() diff --git a/lib/_debug_agent.js b/lib/_debug_agent.js index 63c50357894b08..152a7c65a63575 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); diff --git a/lib/_debugger.js b/lib/_debugger.js index 9f8fa26f2189c3..bd655ff45c7b2a 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(); @@ -159,7 +159,7 @@ function Client() { protocol.execute(d); }); - protocol.onResponse = this._onResponse.bind(this); + protocol.onResponse = (res) => this._onResponse(res); } inherits(Client, net.Stream); 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 = []; @@ -573,7 +573,7 @@ Client.prototype.mirrorObject = function(handle, depth, cb) { }); cb(null, mirror); } - }; + } }); return; } else if (handle.type === 'function') { @@ -676,8 +676,8 @@ var helpMessage = 'Commands: ' + commands.map(function(group) { 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 +697,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 +733,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 +764,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 +798,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 @@ -969,8 +969,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,9 +1004,9 @@ 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; + const s = n.toString(); + const nchars = Math.max(2, String(maxN).length) + 1; + const nspaces = nchars - s.length - 1; for (var i = 0; i < nspaces; i++) { prefix += ' '; @@ -1078,10 +1078,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 +1096,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 +1139,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 +1153,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 +1183,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 +1323,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 +1345,10 @@ Interface.prototype.setBreakpoint = function(script, line, return; } + let req; if (/\(\)$/.test(script)) { // setBreakpoint('functionname()'); - var req = { + req = { type: 'function', target: script.replace(/\(\)$/, ''), condition: condition @@ -1373,7 +1374,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 +1429,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 +1474,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 +1511,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) { @@ -1546,8 +1544,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 +1554,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 +1582,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 +1621,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 +1656,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 +1670,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'); diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 1db331c3d12aa6..ddb1c5bfff9b63 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -2,7 +2,7 @@ const net = require('net'); const util = require('util'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const debug = util.debuglog('http'); // New Agent code. @@ -58,7 +58,7 @@ function Agent(options) { if (req && req.shouldKeepAlive && !socket.destroyed && - self.options.keepAlive) { + 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(); } } @@ -94,19 +92,16 @@ Agent.prototype.createConnection = net.createConnection; // Get the key for a given set of request options Agent.prototype.getName = function(options) { - var name = ''; - - if (options.host) - name += options.host; - else - name += 'localhost'; + var name = options.host || 'localhost'; name += ':'; if (options.port) name += options.port; + name += ':'; if (options.localAddress) name += options.localAddress; + return name; }; diff --git a/lib/_http_client.js b/lib/_http_client.js index e490dce5d821d6..04740d5dcb1348 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').EventEmitter; const HTTPParser = process.binding('http_parser').HTTPParser; const assert = require('assert').ok; const common = require('_http_common'); @@ -116,8 +115,7 @@ function ClientRequest(options, cb) { if (self.socketPath) { self._last = true; self.shouldKeepAlive = false; - var conn = self.agent.createConnection({ path: self.socketPath }); - self.onSocket(conn); + self.onSocket(self.agent.createConnection({ path: self.socketPath })); } 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! @@ -136,12 +134,11 @@ function ClientRequest(options, cb) { self._last = true; self.shouldKeepAlive = false; if (options.createConnection) { - var conn = options.createConnection(options); + self.onSocket(options.createConnection(options)); } else { debug('CLIENT use net.createConnection', options); - var conn = net.createConnection(options); + self.onSocket(net.createConnection(options)); } - self.onSocket(conn); } self._deferToConnect(null, null, function() { @@ -277,6 +274,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; @@ -443,6 +447,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); @@ -460,6 +465,7 @@ function tickOnSocket(req, socket) { parser.reinitialize(HTTPParser.RESPONSE); parser.socket = socket; parser.incoming = null; + parser.outgoing = req; req.parser = parser; socket.parser = parser; @@ -477,6 +483,7 @@ function tickOnSocket(req, socket) { } parser.onIncoming = parserOnIncomingClient; + socket.removeListener('error', freeSocketErrorListener); socket.on('error', socketErrorListener); socket.on('data', socketOnData); socket.on('end', socketOnEnd); @@ -504,21 +511,23 @@ ClientRequest.prototype._deferToConnect = function(method, arguments_, cb) { // in the future (when a socket gets assigned out of the pool and is // eventually writable). var self = this; + + function callSocketMethod() { + if (method) + self.socket[method].apply(self.socket, arguments_); + + if (typeof cb === 'function') + cb(); + } + var onSocket = function() { if (self.socket.writable) { - if (method) { - self.socket[method].apply(self.socket, arguments_); - } - if (cb) { cb(); } + callSocketMethod(); } else { - self.socket.once('connect', function() { - if (method) { - self.socket[method].apply(self.socket, arguments_); - } - if (cb) { cb(); } - }); + self.socket.once('connect', callSocketMethod); } }; + if (!self.socket) { self.once('socket', onSocket); } else { diff --git a/lib/_http_common.js b/lib/_http_common.js index 757032929444b1..328b6eea8affba 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,6 +78,20 @@ 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 @@ -140,6 +155,11 @@ var parsers = new FreeList('parsers', 1000, function() { parser._headers = []; 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 @@ -150,6 +170,7 @@ var parsers = new FreeList('parsers', 1000, function() { parser[kOnHeadersComplete] = parserOnHeadersComplete; parser[kOnBody] = parserOnBody; parser[kOnMessageComplete] = parserOnMessageComplete; + parser[kOnExecute] = null; return parser; }); @@ -167,10 +188,15 @@ function freeParser(parser, req, socket) { if (parser) { parser._headers = []; parser.onIncoming = null; + if (parser._consumed) + parser.unconsume(); + parser._consumed = false; if (parser.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; @@ -195,3 +221,30 @@ function httpSocketSetup(socket) { socket.on('drain', ondrain); } exports.httpSocketSetup = httpSocketSetup; + +/** + * Verifies that the given val is a valid HTTP token + * per the rules defined in RFC 7230 + **/ +const token = /^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/; +function checkIsHttpToken(val) { + return typeof val === 'string' && token.test(val); +} +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 e16f198dba71bd..4f001041f8af89 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -159,7 +159,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 c9b0a87b3dbd0c..47c6f93e99b277 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -19,6 +19,7 @@ const contentLengthExpression = /^Content-Length$/i; const dateExpression = /^Date$/i; const expectExpression = /^Expect$/i; const trailerExpression = /^Trailer$/i; +const lenientHttpHeaders = !!process.REVERT_CVE_2016_2216; const automaticHeaders = { connection: true, @@ -46,10 +47,18 @@ utcDate._onTimeout = function() { function OutgoingMessage() { Stream.call(this); + // Queue that holds all currently pending data, until the response will be + // assigned to the socket (until it will its turn in the HTTP pipeline). this.output = []; this.outputEncodings = []; this.outputCallbacks = []; + // `outputSize` is an approximate measure of how much data is queued on this + // response. `_onPendingData` will be invoked to update similar global + // per-connection counter. That counter will be used to pause/unpause the + // TCP socket and HTTP Parser and thus handle the backpressure. + this.outputSize = 0; + this.writable = true; this._last = false; @@ -71,6 +80,8 @@ function OutgoingMessage() { this._header = null; this._headers = null; this._headerNames = {}; + + this._onPendingData = null; } util.inherits(OutgoingMessage, Stream); @@ -120,6 +131,9 @@ OutgoingMessage.prototype._send = function(data, encoding, callback) { this.output.unshift(this._header); this.outputEncodings.unshift('binary'); this.outputCallbacks.unshift(null); + this.outputSize += this._header.length; + if (typeof this._onPendingData === 'function') + this._onPendingData(this._header.length); } this._headerSent = true; } @@ -133,12 +147,6 @@ OutgoingMessage.prototype._writeRaw = function(data, encoding, callback) { encoding = null; } - if (data.length === 0) { - if (typeof callback === 'function') - process.nextTick(callback); - return true; - } - var connection = this.connection; if (connection && connection._httpMessage === this && @@ -147,17 +155,11 @@ OutgoingMessage.prototype._writeRaw = function(data, encoding, callback) { // There might be pending data in the this.output buffer. var outputLength = this.output.length; if (outputLength > 0) { - var output = this.output; - var outputEncodings = this.outputEncodings; - var outputCallbacks = this.outputCallbacks; - for (var i = 0; i < outputLength; i++) { - connection.write(output[i], outputEncodings[i], - outputCallbacks[i]); - } - - this.output = []; - this.outputEncodings = []; - this.outputCallbacks = []; + this._flushOutput(connection); + } else if (data.length === 0) { + if (typeof callback === 'function') + process.nextTick(callback); + return true; } // Directly write to socket. @@ -177,6 +179,9 @@ OutgoingMessage.prototype._buffer = function(data, encoding, callback) { this.output.push(data); this.outputEncodings.push(encoding); this.outputCallbacks.push(callback); + this.outputSize += data.length; + if (typeof this._onPendingData === 'function') + this._onPendingData(data.length); return false; }; @@ -295,12 +300,16 @@ OutgoingMessage.prototype._storeHeader = function(firstLine, headers) { }; function storeHeader(self, state, field, value) { - // Protect against response splitting. The if statement is there to - // minimize the performance impact in the common case. - if (/[\r\n]/.test(value)) - value = value.replace(/[\r\n]+[ \t]*/g, ''); - - state.messageHeader += field + ': ' + value + CRLF; + if (!lenientHttpHeaders) { + if (!common._checkIsHttpToken(field)) { + throw new TypeError( + 'Header name must be a valid HTTP Token ["' + field + '"]'); + } + 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; @@ -333,7 +342,15 @@ 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 (!lenientHttpHeaders) { + if (!common._checkIsHttpToken(name)) { + throw new TypeError( + 'Trailer name must be a valid HTTP Token ["' + name + '"]'); + } + if (common._checkInvalidHeaderChar(value) === true) { + throw new TypeError('The header content contains invalid characters'); + } + } if (this._headers === null) this._headers = {}; @@ -481,6 +498,14 @@ function connectionCorkNT(conn) { } +function escapeHeaderValue(value) { + if (!lenientHttpHeaders) return value; + // Protect against response splitting. The regex test is there to + // minimize the performance impact in the common case. + return /[\r\n]/.test(value) ? value.replace(/[\r\n]+[ \t]*/g, '') : value; +} + + OutgoingMessage.prototype.addTrailers = function(headers) { this._trailer = ''; var keys = Object.keys(headers); @@ -495,8 +520,16 @@ OutgoingMessage.prototype.addTrailers = function(headers) { field = key; value = headers[key]; } - - this._trailer += field + ': ' + value + CRLF; + if (!lenientHttpHeaders) { + if (!common._checkIsHttpToken(field)) { + 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; } }; @@ -553,7 +586,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) { @@ -608,24 +641,11 @@ OutgoingMessage.prototype._finish = function() { // to attempt to flush any pending messages out to the socket. OutgoingMessage.prototype._flush = function() { var socket = this.socket; - var outputLength, ret; + var ret; if (socket && socket.writable) { // There might be remaining data in this.output; write it out - outputLength = this.output.length; - if (outputLength > 0) { - var output = this.output; - var outputEncodings = this.outputEncodings; - var outputCallbacks = this.outputCallbacks; - for (var i = 0; i < outputLength; i++) { - ret = socket.write(output[i], outputEncodings[i], - outputCallbacks[i]); - } - - this.output = []; - this.outputEncodings = []; - this.outputCallbacks = []; - } + ret = this._flushOutput(socket); if (this.finished) { // This is a queue to the server or client to bring in the next this. @@ -637,6 +657,32 @@ OutgoingMessage.prototype._flush = function() { } }; +OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) { + var ret; + var outputLength = this.output.length; + if (outputLength <= 0) + return ret; + + var output = this.output; + var outputEncodings = this.outputEncodings; + var outputCallbacks = this.outputCallbacks; + socket.cork(); + for (var i = 0; i < outputLength; i++) { + ret = socket.write(output[i], outputEncodings[i], + outputCallbacks[i]); + } + socket.uncork(); + + this.output = []; + this.outputEncodings = []; + this.outputCallbacks = []; + if (typeof this._onPendingData === 'function') + this._onPendingData(-this.outputSize); + this.outputSize = 0; + + return ret; +}; + OutgoingMessage.prototype.flushHeaders = function() { if (!this._header) { diff --git a/lib/_http_server.js b/lib/_http_server.js index dd787fa2f7ad99..7473008a1e8c31 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -2,7 +2,7 @@ const util = require('util'); const net = require('net'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const HTTPParser = process.binding('http_parser').HTTPParser; const assert = require('assert').ok; const common = require('_http_common'); @@ -64,7 +64,7 @@ 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 500 : 'Internal Server Error', 501 : 'Not Implemented', 502 : 'Bad Gateway', @@ -117,7 +117,8 @@ function onServerResponseClose() { // array. That is, in the example below, b still gets called even though // it's been removed by a: // - // var obj = new events.EventEmitter; + // var EventEmitter = require('events'); + // var obj = new EventEmitter(); // obj.on('event', a); // obj.on('event', b); // function a() { obj.removeListener('event', b) } @@ -240,6 +241,8 @@ function Server(requestListener) { }); this.timeout = 2 * 60 * 1000; + + this._pendingResponseData = 0; } util.inherits(Server, net.Server); @@ -259,6 +262,17 @@ function connectionListener(socket) { var self = this; var outgoing = []; var incoming = []; + var outgoingData = 0; + + function updateOutgoingData(delta) { + // `outgoingData` is an approximate amount of bytes queued through all + // inactive responses. If more data than the high watermark is queued - we + // need to pause TCP socket/HTTP parser, and wait until the data will be + // sent to the client. + outgoingData += delta; + if (socket._paused && outgoingData < socket._writableState.highWaterMark) + return socketOnDrain(); + } function abortIncoming() { while (incoming.length) { @@ -329,8 +343,10 @@ function connectionListener(socket) { socket.on = socketOnWrap; var external = socket._handle._externalStream; - if (external) + if (external) { + parser._consumed = true; parser.consume(external); + } external = null; parser[kOnExecute] = onParserExecute; @@ -368,13 +384,13 @@ function connectionListener(socket) { socket.removeListener('data', socketOnData); socket.removeListener('end', socketOnEnd); socket.removeListener('close', serverSocketCloseListener); - parser.unconsume(socket._handle._externalStream); + unconsume(parser, socket); parser.finish(); freeParser(parser, req, null); parser = null; var eventName = req.method === 'CONNECT' ? 'connect' : 'upgrade'; - if (self.listenerCount(eventName) > 0) { + if (EventEmitter.listenerCount(self, eventName) > 0) { debug('SERVER have listener for %s', eventName); var bodyHead = d.slice(bytesParsed, d.length); @@ -388,7 +404,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(); @@ -424,10 +440,13 @@ function connectionListener(socket) { socket._paused = false; function socketOnDrain() { + var needPause = outgoingData > socket._writableState.highWaterMark; + // If we previously paused, then start reading again. - if (socket._paused) { + if (socket._paused && !needPause) { socket._paused = false; - socket.parser.resume(); + if (socket.parser) + socket.parser.resume(); socket.resume(); } } @@ -439,7 +458,8 @@ function connectionListener(socket) { // so that we don't become overwhelmed by a flood of // pipelined requests that may never be resolved. if (!socket._paused) { - var needPause = socket._writableState.needDrain; + var needPause = socket._writableState.needDrain || + outgoingData >= socket._writableState.highWaterMark; if (needPause) { socket._paused = true; // We also need to pause the parser, but don't do that until after @@ -450,6 +470,7 @@ function connectionListener(socket) { } var res = new ServerResponse(req); + res._onPendingData = updateOutgoingData; res.shouldKeepAlive = shouldKeepAlive; DTRACE_HTTP_SERVER_REQUEST(req, socket); @@ -497,7 +518,7 @@ function connectionListener(socket) { (req.httpVersionMajor == 1 && req.httpVersionMinor == 1) && continueExpression.test(req.headers['expect'])) { res._expect_continue = true; - if (self.listenerCount('checkContinue') > 0) { + if (EventEmitter.listenerCount(self, 'checkContinue') > 0) { self.emit('checkContinue', req, res); } else { res.writeContinue(); @@ -512,11 +533,38 @@ function connectionListener(socket) { exports._connectionListener = connectionListener; function onSocketResume() { - this._handle.readStart(); + // It may seem that the socket is resumed, but this is an enemy's trick to + // deceive us! `resume` is emitted asynchronously, and may be called from + // `incoming.readStart()`. Stop the socket again here, just to preserve the + // state. + // + // We don't care about stream semantics for the consumed socket anyway. + if (this._paused) { + this.pause(); + return; + } + + if (this._handle && !this._handle.reading) { + this._handle.reading = true; + this._handle.readStart(); + } } function onSocketPause() { - this._handle.readStop(); + if (this._handle && this._handle.reading) { + this._handle.reading = false; + this._handle.readStop(); + } +} + +function unconsume(parser, socket) { + if (socket._handle) { + if (parser._consumed) + parser.unconsume(socket._handle._externalStream); + parser._consumed = false; + socket.removeListener('pause', onSocketPause); + socket.removeListener('resume', onSocketResume); + } } function socketOnWrap(ev, fn) { @@ -527,7 +575,7 @@ function socketOnWrap(ev, fn) { } if (ev === 'data' || ev === 'readable') - this.parser.unconsume(this._handle._externalStream); + unconsume(this.parser, this); return res; } diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 681c3eaec245be..274a8dc8a4864f 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -3,7 +3,7 @@ module.exports = Readable; Readable.ReadableState = ReadableState; -const EE = require('events').EventEmitter; +const EE = require('events'); const Stream = require('stream'); const Buffer = require('buffer').Buffer; const util = require('util'); @@ -129,10 +129,10 @@ 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) @@ -497,6 +497,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 @@ -509,6 +510,8 @@ 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. @@ -524,9 +527,16 @@ 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(); } } @@ -537,7 +547,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); - if (dest.listenerCount('error') === 0) + if (EE.listenerCount(dest, 'error') === 0) dest.emit('error', er); } // This is a brutally ugly hack to make sure that our error handler @@ -586,7 +596,7 @@ function pipeOnDrain(src) { debug('pipeOnDrain', state.awaitDrain); if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && src.listenerCount('data')) { + if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { state.flowing = true; flow(src); } @@ -629,13 +639,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; @@ -826,6 +836,8 @@ function fromList(n, state) { // 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; @@ -834,7 +846,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) { @@ -850,7 +862,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..eec442226252af 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -75,8 +75,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 19c0c8a006f62a..7bbb97b16aa415 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -1,5 +1,5 @@ // 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'; @@ -108,6 +108,14 @@ 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() { @@ -274,6 +282,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 +366,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 +373,26 @@ 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 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 + state.corkedRequestsFree = holder.next; + holder.next = null; } else { // Slow case, write chunks one-by-one while (entry) { @@ -407,6 +415,8 @@ function clearBuffer(stream, state) { if (entry === null) state.lastBufferedRequest = null; } + + state.bufferedRequestCount = 0; state.bufferedRequest = entry; state.bufferProcessing = false; } @@ -484,3 +494,26 @@ function endWritable(stream, state, cb) { } state.ended = true; } + +// 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 d857717dabae15..9e6b00ea3d0ebe 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) @@ -103,7 +103,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 e0c60dbdf6ea83..bf79d7c8678331 100644 --- a/lib/_tls_legacy.js +++ b/lib/_tls_legacy.js @@ -1,7 +1,7 @@ 'use strict'; const assert = require('assert'); -const events = require('events'); +const EventEmitter = require('events'); const stream = require('stream'); const tls = require('tls'); const util = require('util'); @@ -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); @@ -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 || @@ -672,7 +674,7 @@ function SecurePair(context, isServer, requestCert, rejectUnauthorized, options || (options = {}); - events.EventEmitter.call(this); + EventEmitter.call(this); this.server = options.server; this._secureEstablished = false; @@ -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) { @@ -741,7 +744,7 @@ function SecurePair(context, isServer, requestCert, rejectUnauthorized, process.nextTick(securePairNT, this, options); } -util.inherits(SecurePair, events.EventEmitter); +util.inherits(SecurePair, EventEmitter); function securePairNT(self, options) { /* The Connection may be destroyed by an abort call */ @@ -761,11 +764,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; }; diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index 1bff7579fc2914..39d91984e296ed 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; @@ -295,8 +313,11 @@ 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) { - setImmediate(cb); + this._parentWrap.once('close', cb); return this._parentWrap.destroy(); } return this._parent.close(cb); @@ -321,7 +342,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 +392,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 +403,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 +421,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); @@ -476,8 +491,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; @@ -869,9 +884,7 @@ Server.prototype.setOptions = function(options) { if (options.sessionIdContext) { this.sessionIdContext = options.sessionIdContext; } else { - this.sessionIdContext = crypto.createHash('md5') - .update(process.argv.join(' ')) - .digest('hex'); + this.sessionIdContext = defaultSessionIdContext; } }; @@ -950,9 +963,9 @@ exports.connect = function(/* [port, host], options, cb */) { var hostname = options.servername || options.host || (options.socket && options.socket._host) || - 'localhost', - NPN = {}, - context = tls.createSecureContext(options); + 'localhost'; + const NPN = {}; + const context = tls.createSecureContext(options); tls.convertNPNProtocols(options.NPNProtocols, NPN); var socket = new TLSSocket(options.socket, { diff --git a/lib/assert.js b/lib/assert.js index ea142ed01f8f6e..928420521e03e3 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -170,6 +170,11 @@ 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 them in + // a Buffer each to increase performance + } else if (ArrayBuffer.isView(actual) && ArrayBuffer.isView(expected)) { + return compare(new Buffer(actual), new Buffer(expected)) === 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 +198,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 +207,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) @@ -268,13 +273,21 @@ function expectedException(actual, expected) { if (Object.prototype.toString.call(expected) == '[object RegExp]') { return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; } - return false; + try { + if (actual instanceof expected) { + return true; + } + } catch (e) { + // Ignore. The instanceof check doesn't work for arrow functions. + } + + if (Error.isPrototypeOf(expected)) { + return false; + } + + return expected.call({}, actual) === true; } function _throws(shouldThrow, block, expected, message) { diff --git a/lib/buffer.js b/lib/buffer.js index 4166724b73248e..3fb24bef648d48 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -3,6 +3,7 @@ const binding = process.binding('buffer'); const internalUtil = require('internal/util'); +const bindingObj = {}; exports.Buffer = Buffer; exports.SlowBuffer = SlowBuffer; @@ -14,11 +15,24 @@ Buffer.poolSize = 8 * 1024; var poolSize, poolOffset, allocPool; +binding.setupBufferJS(Buffer.prototype, bindingObj); +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; - allocPool = binding.create(poolSize); + if (poolSize > 0) + flags[kNoZeroFill] = 1; + allocPool = createBuffer(poolSize); poolOffset = 0; } +createPool(); function alignPool() { @@ -30,7 +44,7 @@ function alignPool() { } -function Buffer(arg) { +function Buffer(arg, encoding) { // Common case. if (typeof arg === 'number') { // If less than zero, or NaN. @@ -41,44 +55,47 @@ function Buffer(arg) { // Slightly less common case. if (typeof arg === 'string') { - return fromString(arg, arguments[1]); + return fromString(arg, encoding); } // Unusual. return fromObject(arg); -}; - -Buffer.prototype.__proto__ = Uint8Array.prototype; -Buffer.__proto__ = Uint8Array; - +} -binding.setupBufferJS(Buffer.prototype); -// Buffer prototype must be past before creating our first pool. -createPool(); +Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); +Object.setPrototypeOf(Buffer, Uint8Array); function SlowBuffer(length) { - if (length < 0) + if (+length != length) length = 0; - return binding.create(length); -}; + if (length > 0) + flags[kNoZeroFill] = 1; + return createBuffer(+length); +} -SlowBuffer.prototype.__proto__ = Buffer.prototype; -SlowBuffer.__proto__ = Buffer; +Object.setPrototypeOf(SlowBuffer.prototype, Uint8Array.prototype); +Object.setPrototypeOf(SlowBuffer, Uint8Array); function allocate(size) { - if (size === 0) - return binding.create(0); + if (size === 0) { + return createBuffer(size); + } if (size < (Buffer.poolSize >>> 1)) { if (size > (poolSize - poolOffset)) createPool(); - var b = binding.slice(allocPool, poolOffset, poolOffset + size); + var b = allocPool.slice(poolOffset, poolOffset + size); poolOffset += size; alignPool(); return b; } else { - return binding.create(size); + // Even though this is checked above, the conditional is a safety net and + // sanity check to prevent any subsequent typed array allocation from not + // being zero filled. + if (size > 0) + flags[kNoZeroFill] = 1; + return createBuffer(size); } } @@ -94,7 +111,7 @@ function fromString(string, encoding) { if (length > (poolSize - poolOffset)) createPool(); var actual = allocPool.write(string, poolOffset, encoding); - var b = binding.slice(allocPool, poolOffset, poolOffset + actual); + var b = allocPool.slice(poolOffset, poolOffset + actual); poolOffset += actual; alignPool(); return b; @@ -103,15 +120,19 @@ function fromString(string, encoding) { function fromObject(obj) { if (obj instanceof Buffer) { - var b = allocate(obj.length); + const b = allocate(obj.length); + + if (b.length === 0) + return b; + 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++) + const length = obj.length; + const b = allocate(length); + for (let i = 0; i < length; i++) b[i] = obj[i] & 255; return b; } @@ -125,13 +146,13 @@ function fromObject(obj) { } if (obj.buffer instanceof ArrayBuffer || obj.length) { - var length; + let 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++) { + const b = allocate(length); + for (let i = 0; i < length; i++) { b[i] = obj[i] & 255; } return b; @@ -139,8 +160,8 @@ function fromObject(obj) { 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++) + const b = allocate(array.length); + for (let i = 0; i < array.length; i++) b[i] = array[i] & 255; return b; } @@ -206,7 +227,7 @@ Buffer.concat = function(list, length) { if (length === undefined) { length = 0; - for (var i = 0; i < list.length; i++) + for (let i = 0; i < list.length; i++) length += list[i].length; } else { length = length >>> 0; @@ -214,7 +235,7 @@ Buffer.concat = function(list, length) { var buffer = new Buffer(length); var pos = 0; - for (var i = 0; i < list.length; i++) { + for (let i = 0; i < list.length; i++) { var buf = list[i]; buf.copy(buffer, pos); pos += buf.length; @@ -237,6 +258,9 @@ function base64ByteLength(str, bytes) { function byteLength(string, encoding) { + if (string instanceof Buffer) + return string.length; + if (typeof string !== 'string') string = '' + string; @@ -257,6 +281,7 @@ function byteLength(string, encoding) { case 'utf8': case 'utf-8': + case undefined: return binding.byteLengthUtf8(string); case 'ucs2': @@ -289,6 +314,8 @@ Buffer.byteLength = byteLength; Object.defineProperty(Buffer.prototype, 'parent', { enumerable: true, get: function() { + if (!(this instanceof Buffer)) + return undefined; if (this.byteLength === 0 || this.byteLength === this.buffer.byteLength) { return undefined; @@ -299,6 +326,8 @@ Object.defineProperty(Buffer.prototype, 'parent', { Object.defineProperty(Buffer.prototype, 'offset', { enumerable: true, get: function() { + if (!(this instanceof Buffer)) + return undefined; return this.byteOffset; } }); @@ -350,10 +379,15 @@ function slowToString(encoding, start, end) { Buffer.prototype.toString = function() { - const length = this.length | 0; - if (arguments.length === 0) - return this.utf8Slice(0, length); - return slowToString.apply(this, arguments); + let result; + if (arguments.length === 0) { + result = this.utf8Slice(0, this.length); + } else { + result = slowToString.apply(this, arguments); + } + if (result === undefined) + throw new Error('toString failed'); + return result; }; @@ -391,20 +425,57 @@ Buffer.prototype.compare = function compare(b) { return binding.compare(this, b); }; +function slowIndexOf(buffer, val, byteOffset, encoding) { + var loweredCase = false; + for (;;) { + switch (encoding) { + case 'utf8': + case 'utf-8': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + case 'binary': + return binding.indexOfString(buffer, val, byteOffset, encoding); + + case 'base64': + case 'ascii': + case 'hex': + return binding.indexOfBuffer( + buffer, Buffer(val, encoding), byteOffset, encoding); + + default: + if (loweredCase) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } +} -Buffer.prototype.indexOf = function indexOf(val, byteOffset) { - if (byteOffset > 0x7fffffff) +Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + 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') - return binding.indexOfString(this, val, byteOffset); - if (val instanceof Buffer) - return binding.indexOfBuffer(this, val, byteOffset); - if (typeof val === 'number') + if (typeof val === 'string') { + if (encoding === undefined) { + return binding.indexOfString(this, val, byteOffset, encoding); + } + return slowIndexOf(this, val, byteOffset, encoding); + } else if (val instanceof Buffer) { + return binding.indexOfBuffer(this, val, byteOffset, encoding); + } else if (typeof val === 'number') { return binding.indexOfNumber(this, val, byteOffset); + } throw new TypeError('val must be string, number or Buffer'); }; @@ -450,9 +521,6 @@ Buffer.prototype.set = internalUtil.deprecate(function set(offset, v) { return this[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]]' + @@ -545,33 +613,10 @@ 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) { - var len = this.length; - start = ~~start; - end = end === undefined ? len : ~~end; - - if (start < 0) { - start += len; - if (start < 0) - start = 0; - } else if (start > len) { - start = len; - } - - if (end < 0) { - end += len; - if (end < 0) - end = 0; - } else if (end > len) { - end = len; - } - - if (end < start) - end = start; - - return binding.slice(this, start, end); + const buffer = this.subarray(start, end); + Object.setPrototypeOf(buffer, Buffer.prototype); + return buffer; }; @@ -797,8 +842,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; @@ -814,8 +861,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; @@ -899,10 +948,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; }; @@ -922,10 +974,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; }; diff --git a/lib/child_process.js b/lib/child_process.js index 57a8601df59a98..ddbb0448d90c20 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -23,6 +23,8 @@ exports.fork = function(modulePath /*, args, options*/) { if (Array.isArray(arguments[1])) { args = arguments[1]; options = util._extend({}, arguments[2]); + } else if (arguments[1] && typeof arguments[1] !== 'object') { + throw new TypeError('Incorrect value of args option'); } else { args = []; options = util._extend({}, arguments[1]); @@ -30,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 @@ -48,16 +60,12 @@ exports._forkChild = function(fd) { var p = new Pipe(true); p.open(fd); p.unref(); - setupChannel(process, p); - - var refs = 0; + const control = setupChannel(process, p); process.on('newListener', function(name) { - if (name !== 'message' && name !== 'disconnect') return; - if (++refs === 1) p.ref(); + if (name === 'message' || name === 'disconnect') control.ref(); }); process.on('removeListener', function(name) { - if (name !== 'message' && name !== 'disconnect') return; - if (--refs === 0) p.unref(); + if (name === 'message' || name === 'disconnect') control.unref(); }); }; @@ -108,7 +116,7 @@ exports.exec = function(command /*, options, callback*/) { exports.execFile = function(file /*, args, options, callback*/) { - var args, callback; + var args = [], callback; var options = { encoding: 'utf8', timeout: 0, @@ -118,18 +126,26 @@ exports.execFile = function(file /*, args, options, callback*/) { env: null }; - // Parse the parameters. + // Parse the optional positional parameters. + var pos = 1; + if (pos < arguments.length && Array.isArray(arguments[pos])) { + args = arguments[pos++]; + } else if (pos < arguments.length && arguments[pos] == null) { + pos++; + } - if (typeof arguments[arguments.length - 1] === 'function') { - callback = arguments[arguments.length - 1]; + if (pos < arguments.length && typeof arguments[pos] === 'object') { + options = util._extend(options, arguments[pos++]); + } else if (pos < arguments.length && arguments[pos] == null) { + pos++; } - if (Array.isArray(arguments[1])) { - args = arguments[1]; - options = util._extend(options, arguments[2]); - } else { - args = []; - options = util._extend(options, arguments[1]); + if (pos < arguments.length && typeof arguments[pos] === 'function') { + callback = arguments[pos++]; + } + + if (pos === 1 && arguments.length > 1) { + throw new TypeError('Incorrect value of args option'); } var child = spawn(file, args, { @@ -206,14 +222,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 { @@ -231,37 +255,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); diff --git a/lib/cluster.js b/lib/cluster.js index cbccd02605cb67..4f7ca58170468f 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -1,6 +1,6 @@ 'use strict'; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const assert = require('assert'); const dgram = require('dgram'); const fork = require('child_process').fork; @@ -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); @@ -57,7 +61,7 @@ Worker.prototype.isConnected = function isConnected() { // Master/worker specific methods are defined in the *Init() functions. -function SharedHandle(key, address, port, addressType, backlog, fd) { +function SharedHandle(key, address, port, addressType, backlog, fd, flags) { this.key = key; this.workers = []; this.handle = null; @@ -66,7 +70,7 @@ function SharedHandle(key, address, port, addressType, backlog, fd) { // FIXME(bnoordhuis) Polymorphic return type for lack of a better solution. var rval; if (addressType === 'udp4' || addressType === 'udp6') - rval = dgram._createSocketHandle(address, port, addressType, fd); + rval = dgram._createSocketHandle(address, port, addressType, fd, flags); else rval = net._createServerHandle(address, port, addressType, fd); @@ -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) { @@ -291,7 +295,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 +312,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 +341,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 +351,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 +410,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 +434,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,11 +445,20 @@ 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, - message.fd]; + message.fd, + message.index]; var key = args.join(':'); var handle = handles[key]; if (handle === undefined) { @@ -456,7 +476,8 @@ function masterInit() { message.port, message.addressType, message.backlog, - message.fd); + message.fd, + message.flags); } if (!handle.data) handle.data = message.data; @@ -485,11 +506,12 @@ function masterInit() { cluster.emit('listening', worker, info); } - // Round-robin only. 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) { @@ -500,6 +522,7 @@ function masterInit() { function workerInit() { var handles = {}; + var indexes = {}; // Called from src/node.js cluster._setupWorker = function() { @@ -523,20 +546,27 @@ function workerInit() { if (message.act === 'newconn') onconnection(message, handle); else if (message.act === 'disconnect') - worker.disconnect(); + _disconnect.call(worker, true); } }; // obj is a net#Server or a dgram#Socket object. - cluster._getServer = function(obj, address, port, addressType, fd, cb) { - var message = { - addressType: addressType, - address: address, - port: port, + cluster._getServer = function(obj, options, cb) { + const key = [ options.address, + options.port, + options.addressType, + options.fd ].join(':'); + if (indexes[key] === undefined) + indexes[key] = 0; + else + indexes[key]++; + + const message = util._extend({ act: 'queryServer', - fd: fd, + index: indexes[key], data: null - }; + }, options); + // Set custom data on handle (i.e. tls tickets key) if (obj._getServerData) message.data = obj._getServerData(); send(message, function(reply, handle) { @@ -549,9 +579,9 @@ function workerInit() { }); obj.once('listening', function() { cluster.worker.state = 'listening'; - var address = obj.address(); + const address = obj.address(); message.act = 'listening'; - message.port = address && address.port || port; + message.port = address && address.port || options.port; send(message); }); }; @@ -563,6 +593,7 @@ function workerInit() { // closed. Avoids resource leaks when the handle is short-lived. var close = handle.close; handle.close = function() { + send({ act: 'close', key: key }); delete handles[key]; return close.apply(this, arguments); }; @@ -636,41 +667,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..5628c93007dde7 100644 --- a/lib/console.js +++ b/lib/console.js @@ -33,7 +33,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 +41,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'); }; @@ -75,7 +75,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); }; @@ -84,7 +84,7 @@ 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)); + require('assert').ok(false, util.format.apply(null, arr)); } }; diff --git a/lib/crypto.js b/lib/crypto.js index bfe7837cb4ea54..b32d9aff90b72b 100644 --- a/lib/crypto.js +++ b/lib/crypto.js @@ -20,6 +20,7 @@ const constants = require('constants'); const stream = require('stream'); const util = require('util'); const internalUtil = require('internal/util'); +const LazyTransform = require('internal/streams/lazy_transform'); const DH_GENERATOR = 2; @@ -42,37 +43,6 @@ const assert = require('assert'); const StringDecoder = require('string_decoder').StringDecoder; -function LazyTransform(options) { - this._options = options; -} -util.inherits(LazyTransform, stream.Transform); - -[ - '_readableState', - '_writableState', - '_transformState' -].forEach(function(prop, i, props) { - Object.defineProperty(LazyTransform.prototype, prop, { - get: function() { - stream.Transform.call(this, this._options); - this._writableState.decodeStrings = false; - this._writableState.defaultEncoding = 'binary'; - return this[prop]; - }, - set: function(val) { - Object.defineProperty(this, prop, { - value: val, - enumerable: true, - configurable: true, - writable: true - }); - }, - configurable: true, - enumerable: true - }); -}); - - exports.createHash = exports.Hash = Hash; function Hash(algorithm, options) { if (!(this instanceof Hash)) diff --git a/lib/dgram.js b/lib/dgram.js index b7bb7d3d703eb1..93ae5c5ca1df48 100644 --- a/lib/dgram.js +++ b/lib/dgram.js @@ -3,7 +3,7 @@ const assert = require('assert'); const Buffer = require('buffer').Buffer; const util = require('util'); -const events = require('events'); +const EventEmitter = require('events'); const constants = require('constants'); const UDP = process.binding('udp_wrap').UDP; @@ -40,13 +40,13 @@ function lookup6(address, 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; @@ -60,14 +60,14 @@ function newHandle(type) { } -exports._createSocketHandle = function(address, port, addressType, fd) { +exports._createSocketHandle = function(address, port, addressType, fd, flags) { // Opening an existing fd is not supported for UDP handles. assert(typeof fd !== 'number' || fd < 0); var handle = newHandle(addressType); if (port || address) { - var err = handle.bind(address, port || 0, 0); + var err = handle.bind(address, port || 0, flags); if (err) { handle.close(); return err; @@ -79,7 +79,7 @@ exports._createSocketHandle = function(address, port, addressType, fd) { function Socket(type, listener) { - events.EventEmitter.call(this); + EventEmitter.call(this); if (typeof type === 'object') { var options = type; @@ -101,7 +101,7 @@ function Socket(type, listener) { if (typeof listener === 'function') this.on('message', listener); } -util.inherits(Socket, events.EventEmitter); +util.inherits(Socket, EventEmitter); exports.Socket = Socket; @@ -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(); @@ -176,8 +177,12 @@ Socket.prototype.bind = function(port /*, address, callback*/) { if (!cluster) cluster = require('cluster'); + var flags = 0; + if (self._reuseAddr) + flags |= constants.UV_UDP_REUSEADDR; + if (cluster.isWorker && !exclusive) { - cluster._getServer(self, ip, port, self.type, -1, function(err, handle) { + function onHandle(err, handle) { if (err) { var ex = exceptionWithHostPort(err, 'bind', ip, port); self.emit('error', ex); @@ -191,17 +196,20 @@ Socket.prototype.bind = function(port /*, address, callback*/) { replaceHandle(self, handle); startListening(self); - }); + } + cluster._getServer(self, { + address: ip, + port: port, + addressType: self.type, + fd: -1, + flags: flags + }, onHandle); } else { if (!self._handle) return; // handle has been closed in the mean time - var flags = 0; - if (self._reuseAddr) - flags |= constants.UV_UDP_REUSEADDR; - - 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); @@ -245,8 +253,7 @@ Socket.prototype.send = function(buffer, if (typeof buffer === 'string') buffer = new Buffer(buffer); - - if (!(buffer instanceof Buffer)) + else if (!(buffer instanceof Buffer)) throw new TypeError('First argument must be a buffer or string.'); offset = offset | 0; @@ -325,7 +332,7 @@ Socket.prototype.send = function(buffer, !!callback); if (err && callback) { // don't emit as error, dgram_legacy.js compatibility - var ex = exceptionWithHostPort(err, 'send', address, port); + const ex = exceptionWithHostPort(err, 'send', address, port); process.nextTick(callback, ex); } } diff --git a/lib/dns.js b/lib/dns.js index 97f730c27b7ea0..6683eacf14008f 100644 --- a/lib/dns.js +++ b/lib/dns.js @@ -8,12 +8,13 @@ const uv = process.binding('uv'); const GetAddrInfoReqWrap = cares.GetAddrInfoReqWrap; const GetNameInfoReqWrap = cares.GetNameInfoReqWrap; +const QueryReqWrap = cares.QueryReqWrap; const isIp = net.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 || @@ -188,6 +189,9 @@ exports.lookupService = function(host, port, callback) { if (cares.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(); @@ -223,12 +227,11 @@ function resolver(bindingName) { } callback = makeAsync(callback); - var req = { - bindingName: bindingName, - callback: callback, - hostname: name, - oncomplete: onresolve - }; + var req = new QueryReqWrap(); + req.bindingName = bindingName; + req.callback = callback; + req.hostname = name; + req.oncomplete = onresolve; var err = binding(req, name); if (err) throw errnoException(err, bindingName); callback.immediately = true; @@ -330,7 +333,7 @@ exports.NOTFOUND = 'ENOTFOUND'; exports.NOTIMP = 'ENOTIMP'; exports.REFUSED = 'EREFUSED'; exports.BADQUERY = 'EBADQUERY'; -exports.ADNAME = 'EADNAME'; +exports.BADNAME = 'EBADNAME'; exports.BADFAMILY = 'EBADFAMILY'; exports.BADRESP = 'EBADRESP'; exports.CONNREFUSED = 'ECONNREFUSED'; diff --git a/lib/domain.js b/lib/domain.js index 4ee4d71b196c07..d0f51d9c14296b 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; @@ -59,6 +60,20 @@ Domain.prototype._disposed = undefined; // Called by process._fatalException in case an error was thrown. Domain.prototype._errorHandler = function errorHandler(er) { var caught = false; + var self = this; + + function emitError() { + var handled = self.emit('error', er); + + // Exit all domains on the stack. Uncaught exceptions end the + // current tick and no domains should be left on the stack + // between ticks. + stack.length = 0; + exports.active = process.domain = null; + + return handled; + } + // ignore errors on disposed domains. // // XXX This is a bit stupid. We should probably get rid of @@ -71,38 +86,60 @@ Domain.prototype._errorHandler = function errorHandler(er) { er.domain = this; er.domainThrown = true; } - // wrap this in a try/catch so we don't get infinite throwing - try { - // One of three things will happen here. - // - // 1. There is a handler, caught = true - // 2. There is no handler, caught = false - // 3. It throws, caught = false - // - // If caught is false after this, then there's no need to exit() - // the domain, because we're going to crash the process anyway. - caught = this.emit('error', er); - // Exit all domains on the stack. Uncaught exceptions end the - // current tick and no domains should be left on the stack - // between ticks. - stack.length = 0; - exports.active = process.domain = null; - } catch (er2) { - // The domain error handler threw! oh no! - // See if another domain can catch THIS error, - // or else crash on the original one. - // If the user already exited it, then don't double-exit. - if (this === exports.active) { - stack.pop(); + // The top-level domain-handler is handled separately. + // + // The reason is that if V8 was passed a command line option + // asking it to abort on an uncaught exception (currently + // "--abort-on-uncaught-exception"), we want an uncaught exception + // in the top-level domain error handler to make the + // process abort. Using try/catch here would always make V8 think + // that these exceptions are caught, and thus would prevent it from + // aborting in these cases. + if (stack.length === 1) { + // 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(self, '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; + } } - if (stack.length) { - exports.active = process.domain = stack[stack.length - 1]; - caught = process._fatalException(er2); - } else { - caught = false; + } else { + // wrap this in a try/catch so we don't get infinite throwing + try { + // One of three things will happen here. + // + // 1. There is a handler, caught = true + // 2. There is no handler, caught = false + // 3. It throws, caught = false + // + // If caught is false after this, then there's no need to exit() + // the domain, because we're going to crash the process anyway. + caught = emitError(); + } catch (er2) { + // The domain error handler threw! oh no! + // See if another domain can catch THIS error, + // or else crash on the original one. + // If the user already exited it, then don't double-exit. + if (this === exports.active) { + stack.pop(); + } + if (stack.length) { + exports.active = process.domain = stack[stack.length - 1]; + caught = process._fatalException(er2); + } else { + caught = false; + } + return caught; } - return caught; } return caught; }; diff --git a/lib/events.js b/lib/events.js index 722b64537e109d..6cb6900267b2ec 100644 --- a/lib/events.js +++ b/lib/events.js @@ -395,10 +395,15 @@ EventEmitter.prototype.listeners = function listeners(type) { }; EventEmitter.listenerCount = function(emitter, type) { - return emitter.listenerCount(type); + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } }; -EventEmitter.prototype.listenerCount = function listenerCount(type) { +EventEmitter.prototype.listenerCount = listenerCount; +function listenerCount(type) { const events = this._events; if (events) { @@ -412,7 +417,7 @@ EventEmitter.prototype.listenerCount = 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 9bfd14cd29b512..3deb3090fd9731 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -12,7 +12,7 @@ const constants = require('constants'); const fs = exports; const Buffer = require('buffer').Buffer; const Stream = require('stream').Stream; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const FSReqWrap = binding.FSReqWrap; const FSEvent = process.binding('fs_event_wrap').FSEvent; @@ -552,8 +552,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); @@ -614,17 +614,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 +629,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 +644,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 +872,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); }; @@ -1045,7 +1040,13 @@ fs.chownSync = function(path, uid, gid) { // converts Date or number to a fractional UNIX timestamp function toUnixTimestamp(time) { + if (typeof time === 'string' && +time == time) { + return +time; + } if (typeof time === 'number') { + if (!Number.isFinite(time) || time < 0) { + return Date.now() / 1000; + } return time; } if (util.isDate(time)) { @@ -1213,7 +1214,9 @@ function FSWatcher() { this._handle.onchange = function(status, event, filename) { if (status < 0) { self._handle.close(); - self.emit('error', errnoException(status, 'watch')); + const error = errnoException(status, `watch ${filename}`); + error.filename = filename; + self.emit('error', error); } else { self.emit('change', event, filename); } @@ -1228,7 +1231,9 @@ FSWatcher.prototype.start = function(filename, persistent, recursive) { recursive); if (err) { this._handle.close(); - throw errnoException(err, 'watch'); + const error = errnoException(err, `watch ${filename}`); + error.filename = filename; + throw error; } }; @@ -1362,18 +1367,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 @@ -1383,9 +1384,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; @@ -1485,9 +1486,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; @@ -1758,7 +1759,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(); @@ -1867,6 +1868,50 @@ WriteStream.prototype._write = function(data, encoding, cb) { }; +function writev(fd, chunks, position, callback) { + function wrapper(err, written) { + // Retain a reference to chunks so that they can't be GC'ed too soon. + callback(err, written || 0, chunks); + } + + const req = new FSReqWrap(); + req.oncomplete = wrapper; + binding.writeBuffers(fd, chunks, position, req); +} + + +WriteStream.prototype._writev = function(data, cb) { + if (typeof this.fd !== 'number') + return this.once('open', function() { + this._writev(data, cb); + }); + + const self = this; + const len = data.length; + const chunks = new Array(len); + var size = 0; + + for (var i = 0; i < len; i++) { + var chunk = data[i].chunk; + + chunks[i] = chunk; + size += chunk.length; + } + + writev(this.fd, chunks, this.pos, function(er, bytes) { + if (er) { + self.destroy(); + return cb(er); + } + self.bytesWritten += bytes; + cb(); + }); + + if (this.pos !== undefined) + this.pos += size; +}; + + WriteStream.prototype.destroy = ReadStream.prototype.destroy; WriteStream.prototype.close = ReadStream.prototype.close; @@ -1892,9 +1937,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) { diff --git a/lib/http.js b/lib/http.js index cead865749bfd9..64788dd5c07f9f 100644 --- a/lib/http.js +++ b/lib/http.js @@ -2,7 +2,7 @@ const util = require('util'); const internalUtil = require('internal/util'); -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); exports.IncomingMessage = require('_http_incoming').IncomingMessage; diff --git a/lib/https.js b/lib/https.js index abe4a20907dfdd..25c24a3879443e 100644 --- a/lib/https.js +++ b/lib/https.js @@ -76,6 +76,13 @@ function createConnection(port, host, options) { self._cacheSession(options._agentKey, socket.getSession()); }); + + // Evict session on error + socket.once('close', (err) => { + if (err) + this._evictSession(options._agentKey); + }); + return socket; } @@ -123,6 +130,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; }; @@ -148,6 +159,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; diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index c6bb41ffdeb544..f482d85a2c84d3 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -2,7 +2,7 @@ const StringDecoder = require('string_decoder').StringDecoder; const Buffer = require('buffer').Buffer; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const net = require('net'); const dgram = require('dgram'); const util = require('util'); @@ -217,7 +217,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 +250,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); @@ -397,6 +397,25 @@ function setupChannel(target, channel) { target._channel = channel; target._handleQueue = null; + const control = new class extends EventEmitter { + constructor() { + super(); + this.channel = channel; + this.refs = 0; + } + ref() { + if (++this.refs === 1) { + this.channel.ref(); + } + } + unref() { + if (--this.refs === 0) { + this.channel.unref(); + this.emit('unref'); + } + } + }; + var decoder = new StringDecoder('utf8'); var jsonBuffer = ''; channel.buffering = false; @@ -430,6 +449,7 @@ function setupChannel(target, channel) { target.disconnect(); channel.onread = nop; channel.close(); + target._channel = null; maybeClose(target); } }; @@ -446,7 +466,7 @@ function setupChannel(target, channel) { target._handleQueue = null; queue.forEach(function(args) { - target._send(args.message, args.handle, false); + target._send(args.message, args.handle, false, args.callback); }); // Process a pending disconnect (if any). @@ -478,14 +498,24 @@ function setupChannel(target, channel) { }); }); - target.send = function(message, handle) { - if (!this.connected) - this.emit('error', new Error('channel closed')); - else - this._send(message, handle, false); + target.send = function(message, handle, callback) { + if (typeof handle === 'function') { + callback = handle; + handle = undefined; + } + if (this.connected) { + this._send(message, handle, false, callback); + return; + } + const ex = new Error('channel closed'); + if (typeof callback === 'function') { + process.nextTick(callback, ex); + } else { + this.emit('error', ex); // FIXME(bnoordhuis) Defer to next tick. + } }; - target._send = function(message, handle, swallowErrors) { + target._send = function(message, handle, swallowErrors, callback) { assert(this.connected || this._channel); if (message === undefined) @@ -516,7 +546,11 @@ function setupChannel(target, channel) { // Queue-up message and handle if we haven't received ACK yet. if (this._handleQueue) { - this._handleQueue.push({ message: message.msg, handle: handle }); + this._handleQueue.push({ + callback: callback, + handle: handle, + message: message.msg, + }); return; } @@ -538,24 +572,49 @@ function setupChannel(target, channel) { } else if (this._handleQueue && !(message && message.cmd === 'NODE_HANDLE_ACK')) { // Queue request anyway to avoid out-of-order messages. - this._handleQueue.push({ message: message, handle: null }); + this._handleQueue.push({ + callback: callback, + handle: null, + message: message, + }); return; } var req = new WriteWrap(); - req.oncomplete = nop; + req.async = false; + var string = JSON.stringify(message) + '\n'; var err = channel.writeUtf8String(req, string, handle); - if (err) { - if (!swallowErrors) - this.emit('error', errnoException(err, 'write')); - } else if (handle && !this._handleQueue) { - this._handleQueue = []; - } - - if (obj && obj.postSend) { - req.oncomplete = obj.postSend.bind(null, handle); + if (err === 0) { + if (handle && !this._handleQueue) + this._handleQueue = []; + req.oncomplete = function() { + if (this.async === true) + control.unref(); + if (obj && obj.postSend) + obj.postSend(handle); + if (typeof callback === 'function') + callback(null); + }; + if (req.async === true) { + control.ref(); + } else { + process.nextTick(function() { req.oncomplete(); }); + } + } else { + // Cleanup handle on error + if (obj && obj.postSend) + obj.postSend(handle); + + 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. + } + } } /* If the master is > 2 read() calls behind, please stop sending. */ @@ -616,11 +675,15 @@ function setupChannel(target, channel) { }; channel.readStart(); + return control; } const INTERNAL_PREFIX = 'NODE_'; function handleMessage(target, message, handle) { + if (!target._channel) + return; + var eventName = 'message'; if (message !== null && typeof message === 'object' && @@ -635,8 +698,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') { @@ -713,7 +776,7 @@ function _validateStdio(stdio, sync) { } else if (typeof stdio === 'number' || typeof stdio.fd === 'number') { acc.push({ type: 'fd', - fd: stdio.fd || stdio + fd: typeof stdio === 'number' ? stdio : stdio.fd }); } else if (getHandleWrapType(stdio) || getHandleWrapType(stdio.handle) || getHandleWrapType(stdio._handle)) { 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/module.js b/lib/internal/module.js new file mode 100644 index 00000000000000..ef55aa64bd5642 --- /dev/null +++ b/lib/internal/module.js @@ -0,0 +1,39 @@ +'use strict'; + +module.exports = { makeRequireFunction, stripBOM }; + +// 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) { + 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; + + return require; +} + +/** + * 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. + */ +function stripBOM(content) { + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1); + } + return content; +} 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/repl.js b/lib/internal/repl.js index b2c74e179c59d0..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; @@ -34,7 +28,10 @@ function createRepl(env, opts, cb) { if (parseInt(env.NODE_NO_READLINE)) { opts.terminal = false; } - if (parseInt(env.NODE_DISABLE_COLORS)) { + // the "dumb" special terminal, as defined by terminfo, doesn't support + // ANSI colour control codes. + // see http://invisible-island.net/ncurses/terminfo.ti.html#toc-_Specials + if (parseInt(env.NODE_DISABLE_COLORS) || env.TERM === 'dumb') { opts.useColors = false; } @@ -58,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'); @@ -89,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); } @@ -107,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' + @@ -116,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 e9b388d420c29a..950d632a26360d 100644 --- a/lib/internal/socket_list.js +++ b/lib/internal/socket_list.js @@ -2,7 +2,7 @@ module.exports = {SocketListSend, SocketListReceive}; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); const util = require('util'); // This object keep track of the socket there are sended diff --git a/lib/internal/streams/lazy_transform.js b/lib/internal/streams/lazy_transform.js new file mode 100644 index 00000000000000..7e290b16cf5cae --- /dev/null +++ b/lib/internal/streams/lazy_transform.js @@ -0,0 +1,39 @@ +// LazyTransform is a special type of Transform stream that is lazily loaded. +// This is used for performance with bi-API-ship: when two APIs are available +// for the stream, one conventional and one non-conventional. +'use strict'; + +const stream = require('stream'); +const util = require('util'); + +module.exports = LazyTransform; + +function LazyTransform(options) { + this._options = options; +} +util.inherits(LazyTransform, stream.Transform); + +[ + '_readableState', + '_writableState', + '_transformState' +].forEach(function(prop, i, props) { + Object.defineProperty(LazyTransform.prototype, prop, { + get: function() { + stream.Transform.call(this, this._options); + this._writableState.decodeStrings = false; + this._writableState.defaultEncoding = 'binary'; + return this[prop]; + }, + set: function(val) { + Object.defineProperty(this, prop, { + value: val, + enumerable: true, + configurable: true, + writable: true + }); + }, + configurable: true, + enumerable: true + }); +}); 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..05452c18084938 --- /dev/null +++ b/lib/internal/v8_prof_processor.js @@ -0,0 +1,29 @@ +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 aaa6220e40a25e..141ee18ddb9f8a 100644 --- a/lib/module.js +++ b/lib/module.js @@ -2,6 +2,7 @@ const NativeModule = require('native_module'); const util = require('util'); +const internalModule = require('internal/module'); const internalUtil = require('internal/util'); const runInThisContext = require('vm').runInThisContext; const assert = require('assert').ok; @@ -10,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. @@ -43,7 +47,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; @@ -123,19 +126,18 @@ 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 @@ -190,7 +192,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); @@ -243,7 +244,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); @@ -253,8 +254,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)]]; }; @@ -269,18 +270,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); @@ -291,7 +281,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); } @@ -328,8 +318,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) { @@ -343,8 +332,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; @@ -376,41 +364,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); - }; - - Object.defineProperty(require, 'paths', { get: function() { - throw new Error('require.paths is removed. Use ' + - 'node_modules folders, or the NODE_PATH ' + - 'environment variable instead.'); - }}); - - require.main = process.mainModule; - - // Enable support to add extra extension types - require.extensions = Module._extensions; - require.registerExtension = function() { - throw new Error('require.registerExtension() removed. Use ' + - 'require.extensions instead.'); - }; - - 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. @@ -423,29 +384,36 @@ Module.prototype._compile = function(content, filename) { // Set breakpoint on module start if (filename === resolvedArgv) { + // Installing this dummy debug event listener tells V8 to start + // the debugger. Without it, the setBreakPoint() fails with an + // 'illegal access' error. + global.v8debug.Debug.setListener(function() {}); 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); + + Object.defineProperty(require, 'paths', { get: function() { + throw new Error('require.paths is removed. Use ' + + 'node_modules folders, or the NODE_PATH ' + + 'environment variable instead.'); + }}); + require.registerExtension = function() { + throw new Error('require.registerExtension() removed. Use ' + + 'require.extensions instead.'); + }; -function stripBOM(content) { - // 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; -} + const args = [this.exports, require, this, filename, dirname]; + return compiledWrapper.apply(this.exports, args); +}; // Native extension for .js Module._extensions['.js'] = function(module, filename) { var content = fs.readFileSync(filename, 'utf8'); - module._compile(stripBOM(content), filename); + module._compile(internalModule.stripBOM(content), filename); }; @@ -453,7 +421,7 @@ Module._extensions['.js'] = function(module, filename) { Module._extensions['.json'] = function(module, filename) { var content = fs.readFileSync(filename, 'utf8'); try { - module.exports = JSON.parse(stripBOM(content)); + module.exports = JSON.parse(internalModule.stripBOM(content)); } catch (err) { err.message = filename + ': ' + err.message; throw err; @@ -462,7 +430,9 @@ Module._extensions['.json'] = function(module, filename) { //Native extension for .node -Module._extensions['.node'] = process.dlopen; +Module._extensions['.node'] = function(module, filename) { + return process.dlopen(module, path._makeLong(filename)); +}; // bootstrap main module. @@ -476,10 +446,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')]; @@ -502,10 +473,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 10e789678440fd..4ecc4e28367f9d 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1,10 +1,11 @@ 'use strict'; -const events = require('events'); +const EventEmitter = require('events'); 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() {} @@ -169,6 +171,10 @@ function Socket(options) { this.read(0); } } + + // Reserve properties + this.server = null; + this._server = null; } util.inherits(Socket, stream.Duplex); @@ -322,7 +328,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 +342,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 +390,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'); @@ -479,12 +485,12 @@ Socket.prototype._destroy = function(exception, cb) { this.destroyed = true; fireErrorCallbacks(); - 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(); } } }; @@ -651,10 +657,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); @@ -722,10 +726,13 @@ function createWriteReq(req, handle, data, encoding) { Socket.prototype.__defineGetter__('bytesWritten', function() { - var bytes = this._bytesDispatched, - state = this._writableState, - data = this._pendingData, - encoding = this._pendingEncoding; + var bytes = this._bytesDispatched; + const state = this._writableState; + const data = this._pendingData; + const encoding = this._pendingEncoding; + + if (!state) + return undefined; state.getBuffer().forEach(function(el) { if (el.chunk instanceof Buffer) @@ -757,7 +764,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; @@ -803,17 +810,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); @@ -821,7 +830,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); @@ -835,21 +844,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; @@ -926,7 +926,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() { @@ -946,12 +945,12 @@ function lookupAndConnect(self, options) { if (dnsopts.family !== 4 && dnsopts.family !== 6) { 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; } @@ -1053,15 +1052,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); } } @@ -1071,10 +1072,9 @@ function Server(options, connectionListener) { if (!(this instanceof Server)) return new Server(options, connectionListener); - events.EventEmitter.call(this); + EventEmitter.call(this); var self = this; - var options; if (typeof options === 'function') { connectionListener = options; @@ -1113,7 +1113,7 @@ function Server(options, connectionListener) { this.allowHalfOpen = options.allowHalfOpen || false; this.pauseOnConnect = !!options.pauseOnConnect; } -util.inherits(Server, events.EventEmitter); +util.inherits(Server, EventEmitter); exports.Server = Server; @@ -1126,8 +1126,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; @@ -1182,7 +1181,8 @@ var createServerHandle = exports._createServerHandle = } return handle; -}; +} +exports._createServerHandle = createServerHandle; Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { @@ -1268,7 +1268,13 @@ function listen(self, address, port, addressType, backlog, fd, exclusive) { return; } - cluster._getServer(self, address, port, addressType, fd, cb); + cluster._getServer(self, { + address: address, + port: port, + addressType: addressType, + fd: fd, + flags: 0 + }, cb); function cb(err, handle) { // EADDRINUSE may not be reported until we call listen(). To complicate @@ -1339,7 +1345,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); @@ -1347,7 +1353,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 || @@ -1414,6 +1420,7 @@ function onconnection(err, clientHandle) { self._connections++; socket.server = self; + socket._server = self; DTRACE_NET_SERVER_CONNECTION(socket); LTTNG_NET_SERVER_CONNECTION(socket); @@ -1432,8 +1439,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) { @@ -1475,8 +1482,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. diff --git a/lib/os.js b/lib/os.js index 2d537f53840a35..ddf7cee9d48791 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'; diff --git a/lib/path.js b/lib/path.js index 4bcb2b3672091c..44f398d0a792ca 100644 --- a/lib/path.js +++ b/lib/path.js @@ -74,21 +74,21 @@ 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]; + const result = splitDeviceRe.exec(filename); + const device = (result[1] || '') + (result[2] || ''); + const 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]; + const result2 = splitTailRe.exec(tail); + const dir = result2[1]; + const basename = result2[2]; + const ext = result2[3]; return [device, dir, basename, ext]; } function win32StatPath(path) { - var result = splitDeviceRe.exec(path), - device = result[1] || '', - isUnc = !!device && device[1] !== ':'; + const result = splitDeviceRe.exec(path); + const device = result[1] || ''; + const isUnc = !!device && device[1] !== ':'; return { device, isUnc, @@ -103,9 +103,9 @@ function normalizeUNCRoot(device) { // path.resolve([from ...], to) win32.resolve = function() { - var resolvedDevice = '', - resolvedTail = '', - resolvedAbsolute = false; + var resolvedDevice = ''; + var resolvedTail = ''; + var resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1; i--) { var path; @@ -134,11 +134,11 @@ win32.resolve = function() { continue; } - var result = win32StatPath(path), - device = result.device, - isUnc = result.isUnc, - isAbsolute = result.isAbsolute, - tail = result.tail; + const result = win32StatPath(path); + const device = result.device; + var isUnc = result.isUnc; + const isAbsolute = result.isAbsolute; + const tail = result.tail; if (device && resolvedDevice && @@ -182,12 +182,12 @@ win32.resolve = function() { win32.normalize = function(path) { assertPath(path); - var result = win32StatPath(path), - device = result.device, - isUnc = result.isUnc, - isAbsolute = result.isAbsolute, - tail = result.tail, - trailingSlash = /[\\\/]$/.test(tail); + const result = win32StatPath(path); + var device = result.device; + const isUnc = result.isUnc; + const isAbsolute = result.isAbsolute; + var tail = result.tail; + const trailingSlash = /[\\\/]$/.test(tail); // Normalize the tail path tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); @@ -282,7 +282,7 @@ win32.relative = function(from, to) { } var outputParts = []; - for (var i = samePartsLength; i < lowerFromParts.length; i++) { + for (var j = samePartsLength; j < lowerFromParts.length; j++) { outputParts.push('..'); } @@ -318,9 +318,9 @@ win32._makeLong = function(path) { win32.dirname = function(path) { - var result = win32SplitPath(path), - root = result[0], - dir = result[1]; + const result = win32SplitPath(path); + const root = result[0]; + var dir = result[1]; if (!root && !dir) { // No dirname whatsoever @@ -408,15 +408,17 @@ var posix = {}; function posixSplitPath(filename) { - return splitPathRe.exec(filename).slice(1); + const out = splitPathRe.exec(filename); + out.shift(); + return out; } // path.resolve([from ...], to) // posix version posix.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; + var resolvedPath = ''; + var resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = (i >= 0) ? arguments[i] : process.cwd(); @@ -447,8 +449,8 @@ posix.resolve = function() { posix.normalize = function(path) { assertPath(path); - var isAbsolute = posix.isAbsolute(path), - trailingSlash = path && path[path.length - 1] === '/'; + const isAbsolute = posix.isAbsolute(path); + const trailingSlash = path && path[path.length - 1] === '/'; // Normalize the path path = normalizeArray(path.split('/'), !isAbsolute).join('/'); @@ -509,7 +511,7 @@ posix.relative = function(from, to) { } var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { + for (var j = samePartsLength; j < fromParts.length; j++) { outputParts.push('..'); } @@ -525,9 +527,9 @@ posix._makeLong = function(path) { posix.dirname = function(path) { - var result = posixSplitPath(path), - root = result[0], - dir = result[1]; + const result = posixSplitPath(path); + const root = result[0]; + var dir = result[1]; if (!root && !dir) { // No dirname whatsoever diff --git a/lib/querystring.js b/lib/querystring.js index 8735d2814bc307..b034635668faa8 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -202,13 +202,13 @@ QueryString.stringify = QueryString.encode = function(obj, sep, eq, options) { QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { sep = sep || '&'; eq = eq || '='; + const eqLen = eq.length; var obj = {}; if (typeof qs !== 'string' || qs.length === 0) { return obj; } - var regexp = /\+/g; qs = qs.split(sep); var maxKeys = 1000; @@ -229,22 +229,28 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { var keys = []; for (var i = 0; i < len; ++i) { - var x = qs[i].replace(regexp, '%20'), - idx = x.indexOf(eq), - k, v; + // replacePlus() is used instead of a regexp because it is ~15-30% faster + // with v8 4.7 + const x = replacePlus(qs[i]); + const idx = x.indexOf(eq); + var k, v; if (idx >= 0) { k = decodeStr(x.substring(0, idx), decode); - v = decodeStr(x.substring(idx + 1), decode); + v = decodeStr(x.substring(idx + eqLen), decode); } else { k = decodeStr(x, decode); v = ''; } + // Use a key array lookup instead of using hasOwnProperty(), which is slower if (keys.indexOf(k) === -1) { obj[k] = v; keys.push(k); - } else if (Array.isArray(obj[k])) { + } else if (obj[k] instanceof Array) { + // `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 obj[k].push(v); } else { obj[k] = [obj[k], v]; @@ -255,6 +261,25 @@ QueryString.parse = QueryString.decode = function(qs, sep, eq, options) { }; +function replacePlus(str) { + var ret = ''; + var start = 0; + var i = -1; + while ((i = str.indexOf('+', i + 1)) !== -1) { + ret += str.slice(start, i); + ret += '%20'; + start = i + 1; + } + if (start === 0) + return str; + if (start < str.length) + ret += str.slice(start); + return ret; +} + + +// 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 6164bcc85fb8ff..8ee10850e54f89 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -9,10 +9,11 @@ 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; -const EventEmitter = require('events').EventEmitter; +const EventEmitter = require('events'); exports.createInterface = function(input, output, completer, terminal) { @@ -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) { @@ -390,7 +391,10 @@ Interface.prototype._tabComplete = function() { var width = completions.reduce(function(a, b) { return a.length > b.length ? a : b; }).length + 2; // 2 space padding - var maxColumns = Math.floor(self.columns / width) || 1; + var maxColumns = Math.floor(self.columns / width); + if (!maxColumns || maxColumns === Infinity) { + maxColumns = 1; + } var group = [], c; for (var i = 0, compLen = completions.length; i < compLen; i++) { c = completions[i]; diff --git a/lib/repl.js b/lib/repl.js index e61a5edb519aeb..5d13e74026f65a 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -21,6 +21,8 @@ 'use strict'; +const internalModule = require('internal/module'); +const internalUtil = require('internal/util'); const util = require('util'); const inherits = util.inherits; const Stream = require('stream'); @@ -29,9 +31,13 @@ const path = require('path'); const fs = require('fs'); const rl = require('readline'); 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'); @@ -68,6 +74,88 @@ 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; + } + + 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; + } + + if (!this._literal) { + 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 === '/' && current === '*') { + this.blockComment = true; + previous = null; + } + } + + if (this.blockComment) 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, stream, eval_, @@ -189,11 +277,13 @@ 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); + top.outputStream.write((e.stack || e) + '\n'); + top.lineParser.reset(); + top.bufferedCommand = ''; + top.lines.level = []; + top.displayPrompt(); }); if (!input && !output) { @@ -217,8 +307,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 = []; @@ -271,92 +360,28 @@ 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 - previous = current; - 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, @@ -389,9 +414,9 @@ function REPLServer(prompt, } debug('eval %j', evalCmd); - self.eval(evalCmd, self.context, 'repl', finisherFn); + self.eval(evalCmd, self.context, 'repl', finish); } else { - finisherFn(null); + finish(null); } function finish(e, ret) { @@ -402,7 +427,7 @@ function REPLServer(prompt, 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; @@ -410,7 +435,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 @@ -419,12 +444,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) @@ -471,6 +496,7 @@ exports.start = function(prompt, ignoreUndefined, replMode); if (!exports.repl) exports.repl = repl; + replMap.set(repl, repl); return repl; }; @@ -486,6 +512,10 @@ 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; @@ -524,7 +554,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 + ' '; } @@ -600,6 +631,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); } } @@ -609,7 +641,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; @@ -624,7 +656,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('|') + ')$'); @@ -875,7 +907,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(''); @@ -965,7 +998,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(); } @@ -980,7 +1013,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'); @@ -1037,6 +1070,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'); diff --git a/lib/smalloc.js b/lib/smalloc.js deleted file mode 100644 index 9d52e02cd098a4..00000000000000 --- a/lib/smalloc.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const util = require('internal/util'); - -module.exports = require('internal/smalloc'); -util.printDeprecationMessage('smalloc is deprecated. ' + - 'Use typed arrays instead.'); diff --git a/lib/stream.js b/lib/stream.js index 2e0cdfc3134065..047fbceb4bdb30 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -2,7 +2,7 @@ module.exports = Stream; -const EE = require('events').EventEmitter; +const EE = require('events'); const util = require('util'); util.inherits(Stream, EE); @@ -70,7 +70,7 @@ Stream.prototype.pipe = function(dest, options) { // don't leave dangling pipes when there are errors. function onerror(er) { cleanup(); - if (this.listenerCount('error') === 0) { + if (EE.listenerCount(this, 'error') === 0) { throw er; // Unhandled stream error in pipe. } } diff --git a/lib/string_decoder.js b/lib/string_decoder.js index 0c9fdfb416dd4e..ffb04ffff56b84 100644 --- a/lib/string_decoder.js +++ b/lib/string_decoder.js @@ -96,7 +96,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); + const charCode = charStr.charCodeAt(charStr.length - 1); if (charCode >= 0xD800 && charCode <= 0xDBFF) { charLength += surrogateSize; charStr = ''; @@ -128,8 +128,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; + const 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 494c599b3cdfa1..ec3676a6692263 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -23,13 +23,16 @@ const TIMEOUT_MAX = 2147483647; // 2^31-1 // 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. -function insert(item, msecs) { - item._idleStart = Timer.now(); - item._idleTimeout = msecs; +exports.active = function(item) { + const msecs = item._idleTimeout; + if (msecs < 0 || msecs === undefined) return; - if (msecs < 0) return; + item._idleStart = Timer.now(); var list; @@ -48,7 +51,7 @@ function insert(item, msecs) { L.append(list, item); assert(!L.isEmpty(list)); // list is not empty -} +}; function listOnTimeout() { var msecs = this.msecs; @@ -116,16 +119,27 @@ function listOnTimeoutNT(list) { } -const unenroll = exports.unenroll = function(item) { +function reuse(item) { L.remove(item); var list = lists[item._idleTimeout]; - // if empty then stop the watcher - debug('unenroll'); + // if empty - reuse the watcher if (list && L.isEmpty(list)) { + debug('reuse hit'); + list.stop(); + delete lists[item._idleTimeout]; + return list; + } + + return null; +} + + +const unenroll = exports.unenroll = function(item) { + var list = reuse(item); + if (list) { debug('unenroll: list empty'); list.close(); - delete lists[item._idleTimeout]; } // if active is called later, then we want to make sure not to insert again item._idleTimeout = -1; @@ -156,15 +170,6 @@ exports.enroll = function(item, msecs) { }; -// call this whenever the item is active (not idle) -// it will reset its timeout. -exports.active = function(item) { - var msecs = item._idleTimeout; - if (msecs >= 0) - insert(item, msecs); -}; - - /* * DOM-style timers */ @@ -187,21 +192,21 @@ 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; @@ -242,20 +247,20 @@ 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; @@ -267,7 +272,7 @@ exports.setInterval = function(callback, repeat) { return timer; function wrapper() { - timer._repeat.call(this); + timer._repeat(); // Timer might be closed - no point in restarting it if (!timer._repeat) @@ -313,28 +318,34 @@ function unrefdHandle() { Timeout.prototype.unref = function() { if (this._handle) { this._handle.unref(); - } else if (typeof(this._onTimeout) === 'function') { + } else if (typeof this._onTimeout === 'function') { var now = Timer.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) { + exports.unenroll(this); + return; + } + + var handle = reuse(this); - this._handle = new Timer(); + this._handle = handle || new Timer(); this._handle.owner = this; this._handle[kOnTimeout] = unrefdHandle; this._handle.start(delay, 0); this._handle.domain = this.domain; this._handle.unref(); } + return this; }; Timeout.prototype.ref = function() { if (this._handle) this._handle.ref(); + return this; }; Timeout.prototype.close = function() { @@ -345,6 +356,7 @@ Timeout.prototype.close = function() { } else { exports.unenroll(this); } + return this; }; @@ -477,47 +489,110 @@ exports.clearImmediate = function(immediate) { 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 diff, domain, first, threw; - while (first = L.peek(unrefList)) { - diff = now - first._idleStart; + 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; - if (diff < first._idleTimeout) { - diff = first._idleTimeout - diff; - unrefTimer.start(diff, 0); - unrefTimer.when = now + diff; - debug('unrefTimer rescheudling for later'); - return; + // 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); } - L.remove(first); + cur = cur._idlePrev; + } - domain = first.domain; + var nbTimersToTimeout = timersToTimeout.length; + for (var timerIdx = 0; timerIdx < nbTimersToTimeout; ++timerIdx) + _makeTimerTimeout(timersToTimeout[timerIdx]); - if (!first._onTimeout) continue; - if (domain && domain._disposed) continue; - try { - if (domain) domain.enter(); - threw = true; - debug('unreftimer firing timeout'); - first._called = true; - first._onTimeout(); - threw = false; - if (domain) - domain.exit(); - } finally { - if (threw) process.nextTick(unrefTimeout); - } + // 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'); } - - debug('unrefList is empty'); - unrefTimer.when = -1; } @@ -543,38 +618,14 @@ exports._unrefActive = function(item) { var now = Timer.now(); item._idleStart = now; - if (L.isEmpty(unrefList)) { - debug('unrefList empty'); - L.append(unrefList, item); + 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 = now + msecs; + unrefTimer.when = when; debug('unrefTimer scheduled'); - return; - } - - var when = now + msecs; - - debug('unrefList find where we can insert'); - - var cur, them; - - for (cur = unrefList._idlePrev; cur != unrefList; cur = cur._idlePrev) { - them = cur._idleStart + cur._idleTimeout; - - if (when < them) { - debug('unrefList inserting into middle of list'); - - L.append(cur, item); - - if (unrefTimer.when > when) { - debug('unrefTimer is scheduled to fire too late, reschedule'); - unrefTimer.start(msecs, 0); - unrefTimer.when = when; - } - - return; - } } debug('unrefList append to end'); diff --git a/lib/tls.js b/lib/tls.js index 0d85a948dcc511..aad17c9ef2d6a3 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'); @@ -91,12 +90,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,9 +125,7 @@ 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 @@ -174,13 +171,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 +184,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..d9be77a1ec64f1 100644 --- a/lib/url.js +++ b/lib/url.js @@ -93,11 +93,11 @@ 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; + const queryIndex = url.indexOf('?'); + const splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#'; + const uSplit = url.split(splitter); + const slashRegex = /\\/g; uSplit[0] = uSplit[0].replace(slashRegex, '/'); url = uSplit.join(splitter); @@ -169,8 +169,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // find the first instance of any hostEndingChars var hostEnd = -1; - for (var i = 0; i < hostEndingChars.length; i++) { - var hec = rest.indexOf(hostEndingChars[i]); + for (let i = 0; i < hostEndingChars.length; i++) { + const hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } @@ -197,8 +197,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // 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]); + for (let i = 0; i < nonHostChars.length; i++) { + const hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec; } @@ -224,12 +224,12 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // validate a little. if (!ipv6Hostname) { var hostparts = this.hostname.split(/\./); - for (var i = 0, l = hostparts.length; i < l; i++) { + for (let 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++) { + for (let 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 @@ -294,7 +294,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { // 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++) { + for (let i = 0, l = autoEscape.length; i < l; i++) { var ae = autoEscape[i]; if (rest.indexOf(ae) === -1) continue; @@ -335,8 +335,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { //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; } @@ -370,11 +370,11 @@ Url.prototype.format = function() { 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; @@ -498,7 +498,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 +525,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]; + const isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'); + const isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ); + var mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)); + const removeAllDots = mustEndAbs; + let srcPath = result.pathname && result.pathname.split('/') || []; + const relPath = relative.pathname && relative.pathname.split('/') || []; + const psychotic = result.protocol && !slashedProtocol[result.protocol]; // if the url is a non-slashed url, then relative // links like ../.. should be able @@ -586,10 +586,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(); @@ -632,7 +632,7 @@ Url.prototype.resolveObject = function(relative) { // strip single dots, resolve double dots to parent dir // if the path tries to go above the root, `up` ends up > 0 var up = 0; - for (var i = srcPath.length; i >= 0; i--) { + for (let i = srcPath.length; i >= 0; i--) { last = srcPath[i]; if (last === '.') { spliceOne(srcPath, i); @@ -668,10 +668,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(); diff --git a/lib/util.js b/lib/util.js index c5d7bea7db352d..c302bd9c0bf0ba 100644 --- a/lib/util.js +++ b/lib/util.js @@ -3,14 +3,18 @@ const uv = process.binding('uv'); 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; exports.format = function(f) { if (typeof f !== 'string') { var objects = []; - for (var i = 0; i < arguments.length; i++) { - objects.push(inspect(arguments[i])); + for (var index = 0; index < arguments.length; index++) { + objects.push(inspect(arguments[index])); } return objects.join(' '); } @@ -159,9 +163,10 @@ function stylizeNoColor(str, styleType) { function arrayToHash(array) { var hash = {}; - array.forEach(function(val, idx) { + for (var i = 0; i < array.length; i++) { + var val = array[i]; hash[val] = true; - }); + } return hash; } @@ -183,11 +188,20 @@ function getConstructorOf(obj) { } +function ensureDebugIsInitialized() { + if (Debug === undefined) { + const runInDebugContext = require('vm').runInDebugContext; + Debug = runInDebugContext('Debug'); + } +} + + function inspectPromise(p) { - Debug = Debug || require('vm').runInDebugContext('Debug'); - var mirror = Debug.MakeMirror(p, true); - if (!mirror.isPromise()) + ensureDebugIsInitialized(); + // Only create a mirror if the object is a Promise. + if (!binding.isPromise(p)) return null; + const mirror = Debug.MakeMirror(p, true); return {status: mirror.status(), value: mirror.promiseValue().value_}; } @@ -279,13 +293,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)) { - if (constructor === 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 @@ -294,7 +314,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) @@ -302,17 +322,29 @@ 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; } else { - if (constructor === Object) - constructor = null; - braces = ['{', '}']; - empty = true; // No other data than keys. - formatter = formatObject; + if (binding.isMapIterator(value)) { + constructor = { name: 'MapIterator' }; + braces = ['{', '}']; + empty = false; + formatter = formatCollectionIterator; + } else if (binding.isSetIterator(value)) { + constructor = { name: 'SetIterator' }; + braces = ['{', '}']; + empty = false; + formatter = formatCollectionIterator; + } else { + // Unset the constructor to prevent "Object {...}" for ordinary objects. + if (constructor && constructor.name === 'Object') + constructor = null; + braces = ['{', '}']; + empty = true; // No other data than keys. + formatter = formatObject; + } } } @@ -486,6 +518,18 @@ function formatMap(ctx, value, recurseTimes, visibleKeys, keys) { return output; } +function formatCollectionIterator(ctx, value, recurseTimes, visibleKeys, keys) { + ensureDebugIsInitialized(); + const mirror = Debug.MakeMirror(value, true); + var nextRecurseTimes = recurseTimes === null ? null : recurseTimes - 1; + var vals = mirror.preview(); + var output = []; + for (const o of vals) { + output.push(formatValue(ctx, o, nextRecurseTimes)); + } + return output; +} + function formatPromise(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; var internals = inspectPromise(value); @@ -538,13 +582,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 { @@ -633,7 +673,7 @@ function isUndefined(arg) { exports.isUndefined = isUndefined; function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; + return binding.isRegExp(re); } exports.isRegExp = isRegExp; @@ -643,13 +683,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) { @@ -665,10 +702,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); diff --git a/lib/zlib.js b/lib/zlib.js index a10d9118d6194e..82b08018e7403e 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -444,10 +444,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); diff --git a/node.gyp b/node.gyp index 7716287d345529..d549e18c050cef 100644 --- a/node.gyp +++ b/node.gyp @@ -13,6 +13,7 @@ 'node_shared_openssl%': 'false', 'node_v8_options%': '', 'node_target_type%': 'executable', + 'node_core_target_name%': 'node', 'library_files': [ 'src/node.js', 'lib/_debug_agent.js', @@ -69,16 +70,32 @@ 'lib/vm.js', 'lib/zlib.js', 'lib/internal/child_process.js', + 'lib/internal/cluster.js', 'lib/internal/freelist.js', + 'lib/internal/net.js', + 'lib/internal/module.js', 'lib/internal/socket_list.js', 'lib/internal/repl.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': [ @@ -113,6 +130,8 @@ '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', 'src/node_watchdog.cc', @@ -151,6 +170,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', @@ -166,6 +186,7 @@ 'src/util.h', 'src/util-inl.h', 'src/util.cc', + 'src/string_search.cc', 'deps/http_parser/http_parser.h', 'deps/v8/include/v8.h', 'deps/v8/include/v8-debug.h', @@ -180,6 +201,8 @@ 'NODE_ARCH="<(target_arch)"', 'NODE_PLATFORM="<(OS)"', 'NODE_WANT_INTERNALS=1', + # Warn when using deprecated V8 APIs. + 'V8_DEPRECATION_WARNINGS=1', ], @@ -225,6 +248,9 @@ 'src/tls_wrap.h' ], 'conditions': [ + ['openssl_fips != ""', { + 'defines': [ 'NODE_FIPS_MODE' ], + }], [ 'node_shared_openssl=="false"', { 'dependencies': [ './deps/openssl/openssl.gyp:openssl', @@ -387,6 +413,11 @@ '-lkvm', ], }], + [ 'OS=="aix"', { + 'defines': [ + '_LINUX_SOURCE_COMPAT', + ], + }], [ 'OS=="solaris"', { 'libraries': [ '-lkstat', @@ -488,7 +519,7 @@ }] ], 'action': [ - '<(python)', + 'python', 'tools/js2c.py', '<@(_outputs)', '<@(_inputs)', @@ -658,5 +689,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/spawn.js b/spawn.js new file mode 100644 index 00000000000000..ac15f58638d472 --- /dev/null +++ b/spawn.js @@ -0,0 +1,52 @@ +var fs = require('fs'); +var spawn = require("child_process").spawn; + +console.log('argv %j', process.argv); + +if (process.argv[2]) { + console.log('in child') + var l = require("http").createServer(fn).listen(7001) + l.on('listening', function() { + console.log(this.address()); + }) + function fn(req, rsp) { + rsp.end('HELLO\n'); + } + return +} + + +console.log("parent",process.execPath) + +options = { + log: 0, //true, + logFile: 'error.log', +}; + +// Ignore stdin, it causes the detached process to still be associated +// with the terminal (on Windows). +var stdio = ['ignore', process.stdout, process.stderr]; + +if (options.log) { + // Create or truncate file (append-mode has no append-after-truncate). + fs.openSync(options.logFile, 'w'); + + // Early versions of node would close an fd that was used multiple times in + // a spawn `stdio` options.property, so open independent fds, in append + // mode so they won't conflict. + stdio[1] = fs.openSync(options.logFile, 'a'); + stdio[2] = fs.openSync(options.logFile, 'a'); + + console.log('child logs to %j', options.logFile); +} + + var child = spawn(process.execPath, [__filename, 'child'], { + detached: true, + stdio: stdio, + }); + + child.on('error', function(err) { + console.error(err.message); + }); + + child.unref(); diff --git a/src/async-wrap-inl.h b/src/async-wrap-inl.h index 5841c58faf18d5..1d9ebe27e45bef 100644 --- a/src/async-wrap-inl.h +++ b/src/async-wrap-inl.h @@ -14,41 +14,67 @@ namespace node { inline AsyncWrap::AsyncWrap(Environment* env, - v8::Handle object, + v8::Local object, ProviderType provider, AsyncWrap* parent) - : BaseObject(env, object), bits_(static_cast(provider) << 1) { - // Only set wrapper class id if object will be Wrap'd. - if (object->InternalFieldCount() > 0) - // Shift provider value over to prevent id collision. - persistent().SetWrapperClassId(NODE_ASYNC_ID_OFFSET + provider); - - // Check user controlled flag to see if the init callback should run. - if (!env->using_asyncwrap()) - return; + : BaseObject(env, object), bits_(static_cast(provider) << 1), + uid_(env->get_async_wrap_uid()) { + CHECK_NE(provider, PROVIDER_NONE); + CHECK_GE(object->InternalFieldCount(), 1); + + // Shift provider value over to prevent id collision. + persistent().SetWrapperClassId(NODE_ASYNC_ID_OFFSET + provider); - // If callback hooks have not been enabled, and there is no parent, return. - if (!env->async_wrap_callbacks_enabled() && parent == nullptr) + v8::Local init_fn = env->async_hooks_init_function(); + + // No init callback exists, no reason to go on. + if (init_fn.IsEmpty()) return; - // If callback hooks have not been enabled and parent has no queue, return. - if (!env->async_wrap_callbacks_enabled() && !parent->has_async_queue()) + // If async wrap callbacks are disabled and no parent was passed that has + // run the init callback then return. + if (!env->async_wrap_callbacks_enabled() && + (parent == nullptr || !parent->ran_init_callback())) return; v8::HandleScope scope(env->isolate()); - v8::TryCatch try_catch; - v8::Local n = v8::Int32::New(env->isolate(), provider); - env->async_hooks_init_function()->Call(object, 1, &n); + v8::Local argv[] = { + v8::Int32::New(env->isolate(), provider), + v8::Integer::New(env->isolate(), get_uid()), + Null(env->isolate()) + }; + + if (parent != nullptr) + argv[2] = parent->object(); - if (try_catch.HasCaught()) + v8::MaybeLocal ret = + init_fn->Call(env->context(), object, ARRAY_SIZE(argv), argv); + + if (ret.IsEmpty()) FatalError("node::AsyncWrap::AsyncWrap", "init hook threw"); - bits_ |= 1; // has_async_queue() is true now. + bits_ |= 1; // ran_init_callback() is true now. } -inline bool AsyncWrap::has_async_queue() const { +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::MaybeLocal ret = + fn->Call(env()->context(), v8::Null(env()->isolate()), 1, &uid); + if (ret.IsEmpty()) + FatalError("node::AsyncWrap::~AsyncWrap", "destroy hook threw"); + } +} + + +inline bool AsyncWrap::ran_init_callback() const { return static_cast(bits_ & 1); } @@ -58,20 +84,25 @@ inline AsyncWrap::ProviderType AsyncWrap::provider_type() const { } -inline v8::Handle AsyncWrap::MakeCallback( - const v8::Handle symbol, +inline int64_t AsyncWrap::get_uid() const { + return uid_; +} + + +inline v8::Local AsyncWrap::MakeCallback( + const v8::Local symbol, int argc, - v8::Handle* argv) { + v8::Local* argv) { v8::Local cb_v = object()->Get(symbol); CHECK(cb_v->IsFunction()); return MakeCallback(cb_v.As(), argc, argv); } -inline v8::Handle AsyncWrap::MakeCallback( +inline v8::Local AsyncWrap::MakeCallback( uint32_t index, int argc, - v8::Handle* argv) { + v8::Local* argv) { v8::Local cb_v = object()->Get(index); CHECK(cb_v->IsFunction()); return MakeCallback(cb_v.As(), argc, argv); diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 43a647b6d78758..c9f5caad1e4ea8 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -12,7 +12,6 @@ using v8::Array; using v8::Context; using v8::Function; using v8::FunctionCallbackInfo; -using v8::Handle; using v8::HandleScope; using v8::HeapProfiler; using v8::Integer; @@ -83,7 +82,7 @@ intptr_t RetainedAsyncInfo::GetSizeInBytes() { } -RetainedObjectInfo* WrapperInfo(uint16_t class_id, Handle wrapper) { +RetainedObjectInfo* WrapperInfo(uint16_t class_id, Local wrapper) { // No class_id should be the provider type of NONE. CHECK_NE(NODE_ASYNC_ID_OFFSET, class_id); CHECK(wrapper->IsObject()); @@ -104,6 +103,9 @@ RetainedObjectInfo* WrapperInfo(uint16_t class_id, Handle 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); } @@ -117,21 +119,26 @@ 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()); + if (env->async_hooks()->callbacks_enabled()) + return env->ThrowError("hooks should not be set while also enabled"); + + if (!args[0]->IsFunction()) + return env->ThrowTypeError("init callback must be a function"); 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()); - env->set_using_asyncwrap(true); + if (args[1]->IsFunction()) + env->set_async_hooks_pre_function(args[1].As()); + if (args[2]->IsFunction()) + env->set_async_hooks_post_function(args[2].As()); + if (args[3]->IsFunction()) + env->set_async_hooks_destroy_function(args[3].As()); } -static void Initialize(Handle target, - Handle unused, - Handle context) { +static void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); HandleScope scope(isolate); @@ -147,6 +154,11 @@ static void Initialize(Handle target, NODE_ASYNC_PROVIDER_TYPES(V) #undef V target->Set(FIXED_ONE_BYTE_STRING(isolate, "Providers"), async_providers); + + 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()); } @@ -160,16 +172,17 @@ void LoadAsyncWrapperInfo(Environment* env) { } -Handle AsyncWrap::MakeCallback(const Handle cb, +Local AsyncWrap::MakeCallback(const Local cb, int argc, - Handle* argv) { + 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 context = object(); Local process = env()->process_object(); Local domain; bool has_domain = false; - bool has_abort_on_uncaught_and_domains = false; if (env()->using_domains()) { Local domain_v = context->Get(env()->domain_string()); @@ -178,11 +191,10 @@ Handle AsyncWrap::MakeCallback(const Handle cb, domain = domain_v.As(); if (domain->Get(env()->disposed_string())->IsTrue()) return Undefined(env()->isolate()); - has_abort_on_uncaught_and_domains = env()->using_abort_on_uncaught_exc(); } } - TryCatch try_catch; + TryCatch try_catch(env()->isolate()); try_catch.SetVerbose(true); if (has_domain) { @@ -194,37 +206,23 @@ Handle AsyncWrap::MakeCallback(const Handle cb, } } - if (has_async_queue()) { + if (ran_init_callback() && !pre_fn.IsEmpty()) { try_catch.SetVerbose(false); - env()->async_hooks_pre_function()->Call(context, 0, nullptr); + pre_fn->Call(context, 0, nullptr); if (try_catch.HasCaught()) FatalError("node::AsyncWrap::MakeCallback", "pre hook threw"); try_catch.SetVerbose(true); } - Local ret; - - if (has_abort_on_uncaught_and_domains) { - Local fn = process->Get(env()->domain_abort_uncaught_exc_string()); - if (fn->IsFunction()) { - Local special_context = Array::New(env()->isolate(), 2); - special_context->Set(0, context); - special_context->Set(1, cb); - ret = fn.As()->Call(special_context, argc, argv); - } else { - ret = cb->Call(context, argc, argv); - } - } else { - ret = cb->Call(context, argc, argv); - } + Local ret = cb->Call(context, argc, argv); if (try_catch.HasCaught()) { return Undefined(env()->isolate()); } - if (has_async_queue()) { + if (ran_init_callback() && !post_fn.IsEmpty()) { try_catch.SetVerbose(false); - env()->async_hooks_post_function()->Call(context, 0, nullptr); + post_fn->Call(context, 0, nullptr); if (try_catch.HasCaught()) FatalError("node::AsyncWrap::MakeCallback", "post hook threw"); try_catch.SetVerbose(true); diff --git a/src/async-wrap.h b/src/async-wrap.h index bb93872ff79656..5db29600bcd180 100644 --- a/src/async-wrap.h +++ b/src/async-wrap.h @@ -12,8 +12,6 @@ namespace node { #define NODE_ASYNC_PROVIDER_TYPES(V) \ V(NONE) \ - V(CARES) \ - V(CONNECTWRAP) \ V(CRYPTO) \ V(FSEVENTWRAP) \ V(FSREQWRAP) \ @@ -21,17 +19,19 @@ namespace node { V(GETNAMEINFOREQWRAP) \ V(JSSTREAM) \ V(PIPEWRAP) \ + V(PIPECONNECTWRAP) \ V(PROCESSWRAP) \ V(QUERYWRAP) \ - V(REQWRAP) \ V(SHUTDOWNWRAP) \ V(SIGNALWRAP) \ V(STATWATCHER) \ V(TCPWRAP) \ + V(TCPCONNECTWRAP) \ V(TIMERWRAP) \ V(TLSWRAP) \ V(TTYWRAP) \ V(UDPWRAP) \ + V(UDPSENDWRAP) \ V(WRITEWRAP) \ V(ZLIB) @@ -47,35 +47,38 @@ class AsyncWrap : public BaseObject { }; inline AsyncWrap(Environment* env, - v8::Handle object, + v8::Local object, 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::Handle MakeCallback(const v8::Handle cb, + v8::Local MakeCallback(const v8::Local cb, int argc, - v8::Handle* argv); - inline v8::Handle MakeCallback(const v8::Handle symbol, + v8::Local* argv); + inline v8::Local MakeCallback(const v8::Local symbol, int argc, - v8::Handle* argv); - inline v8::Handle MakeCallback(uint32_t index, + v8::Local* argv); + inline v8::Local MakeCallback(uint32_t index, int argc, - v8::Handle* argv); + v8::Local* argv); virtual size_t self_size() const = 0; private: inline AsyncWrap(); - inline bool has_async_queue() const; + inline bool ran_init_callback() const; // When the async hooks init JS function is called from the constructor it is // 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/cares_wrap.cc b/src/cares_wrap.cc index d4be7c9b9bfa9b..8f57dfe477cda4 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -38,7 +38,6 @@ using v8::EscapableHandleScope; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Handle; using v8::HandleScope; using v8::Integer; using v8::Local; @@ -86,6 +85,11 @@ static void NewGetNameInfoReqWrap(const FunctionCallbackInfo& args) { } +static void NewQueryReqWrap(const FunctionCallbackInfo& args) { + CHECK(args.IsConstructCall()); +} + + static int cmp_ares_tasks(const ares_task_t* a, const ares_task_t* b) { if (a->sock < b->sock) return -1; @@ -918,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; @@ -1068,7 +1065,7 @@ static void GetAddrInfo(const FunctionCallbackInfo& args) { break; default: CHECK(0 && "bad address family"); - abort(); + ABORT(); } GetAddrInfoReqWrap* req_wrap = new GetAddrInfoReqWrap(env, req_wrap_obj); @@ -1194,7 +1191,7 @@ static void SetServers(const FunctionCallbackInfo& args) { break; default: CHECK(0 && "Bad address family."); - abort(); + ABORT(); } if (err) @@ -1240,9 +1237,9 @@ static void CaresTimerClose(Environment* env, } -static void Initialize(Handle target, - Handle unused, - Handle context) { +static void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); int r = ares_library_init(ARES_LIB_INIT_ALL); @@ -1313,6 +1310,14 @@ static void Initialize(Handle target, FIXED_ONE_BYTE_STRING(env->isolate(), "GetNameInfoReqWrap")); target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "GetNameInfoReqWrap"), niw->GetFunction()); + + Local qrw = + FunctionTemplate::New(env->isolate(), NewQueryReqWrap); + qrw->InstanceTemplate()->SetInternalFieldCount(1); + qrw->SetClassName( + FIXED_ONE_BYTE_STRING(env->isolate(), "QueryReqWrap")); + target->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "QueryReqWrap"), + qrw->GetFunction()); } } // namespace cares_wrap diff --git a/src/debug-agent.cc b/src/debug-agent.cc index 39d8bfe9e5afcc..93d2ce71f11a38 100644 --- a/src/debug-agent.cc +++ b/src/debug-agent.cc @@ -39,7 +39,6 @@ using v8::Context; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Handle; using v8::HandleScope; using v8::Integer; using v8::Isolate; @@ -160,7 +159,10 @@ void Agent::Stop() { void Agent::WorkerRun() { static const char* argv[] = { "node", "--debug-agent" }; - Isolate* isolate = Isolate::New(); + Isolate::CreateParams params; + ArrayBufferAllocator array_buffer_allocator; + params.array_buffer_allocator = &array_buffer_allocator; + Isolate* isolate = Isolate::New(params); { Locker locker(isolate); Isolate::Scope isolate_scope(isolate); @@ -283,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; @@ -319,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 cbc8c4ff1f5eaf..f73e9c6ba2000a 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -36,12 +36,26 @@ inline void Environment::IsolateData::Put() { } } +// Create string properties as internalized one byte strings. +// +// Internalized because it makes property lookups a little faster and because +// the string is created in the old space straight away. It's going to end up +// in the old space sooner or later anyway but now it doesn't go through +// v8::Eternal's new space handling first. +// +// One byte because our strings are ASCII and we can safely skip V8's UTF-8 +// decoding step. It's a one-time cost, but why pay it when you don't have to? inline Environment::IsolateData::IsolateData(v8::Isolate* isolate, uv_loop_t* loop) : event_loop_(loop), isolate_(isolate), #define V(PropertyName, StringValue) \ - PropertyName ## _(isolate, FIXED_ONE_BYTE_STRING(isolate, StringValue)), + PropertyName ## _(isolate, \ + v8::String::NewFromOneByte( \ + isolate, \ + reinterpret_cast(StringValue), \ + v8::NewStringType::kInternalized, \ + sizeof(StringValue) - 1).ToLocalChecked()), PER_ISOLATE_STRING_PROPERTIES(V) #undef V ref_count_(0) {} @@ -131,6 +145,27 @@ 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; +} + +inline uint32_t* Environment::ArrayBufferAllocatorInfo::fields() { + return fields_; +} + +inline int Environment::ArrayBufferAllocatorInfo::fields_count() const { + return kFieldsCount; +} + +inline bool Environment::ArrayBufferAllocatorInfo::no_zero_fill() const { + return fields_[kNoZeroFill] != 0; +} + +inline void Environment::ArrayBufferAllocatorInfo::reset_fill_flag() { + fields_[kNoZeroFill] = 0; +} + inline Environment* Environment::New(v8::Local context, uv_loop_t* loop) { Environment* env = new Environment(context, loop); @@ -173,10 +208,9 @@ inline Environment::Environment(v8::Local context, isolate_data_(IsolateData::GetOrCreate(context->GetIsolate(), loop)), timer_base_(uv_now(loop)), using_domains_(false), - using_abort_on_uncaught_exc_(false), - using_asyncwrap_(false), printed_error_(false), trace_sync_io_(false), + async_wrap_uid_(0), debugger_agent_(this), http_parser_buffer_(nullptr), context_(context->GetIsolate(), context) { @@ -186,6 +220,13 @@ inline Environment::Environment(v8::Local context, set_as_external(v8::External::New(isolate(), this)); set_binding_cache_object(v8::Object::New(isolate())); set_module_load_list_array(v8::Array::New(isolate())); + + v8::Local fn = v8::FunctionTemplate::New(isolate()); + fn->SetClassName(FIXED_ONE_BYTE_STRING(isolate(), "InternalFieldObject")); + v8::Local obj = fn->InstanceTemplate(); + obj->SetInternalFieldCount(1); + set_generic_internal_field_template(obj); + RB_INIT(&cares_task_list_); handle_cleanup_waiting_ = 0; } @@ -290,16 +331,13 @@ inline Environment::TickInfo* Environment::tick_info() { return &tick_info_; } -inline uint64_t Environment::timer_base() const { - return timer_base_; -} - -inline bool Environment::using_abort_on_uncaught_exc() const { - return using_abort_on_uncaught_exc_; +inline Environment::ArrayBufferAllocatorInfo* + Environment::array_buffer_allocator_info() { + return &array_buffer_allocator_info_; } -inline void Environment::set_using_abort_on_uncaught_exc(bool value) { - using_abort_on_uncaught_exc_ = value; +inline uint64_t Environment::timer_base() const { + return timer_base_; } inline bool Environment::using_domains() const { @@ -310,14 +348,6 @@ inline void Environment::set_using_domains(bool value) { using_domains_ = value; } -inline bool Environment::using_asyncwrap() const { - return using_asyncwrap_; -} - -inline void Environment::set_using_asyncwrap(bool value) { - using_asyncwrap_ = value; -} - inline bool Environment::printed_error() const { return printed_error_; } @@ -330,6 +360,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_; @@ -438,7 +472,10 @@ inline void Environment::SetMethod(v8::Local that, v8::FunctionCallback callback) { v8::Local function = NewFunctionTemplate(callback)->GetFunction(); - v8::Local name_string = v8::String::NewFromUtf8(isolate(), name); + // kInternalized strings are created in the old space. + const v8::NewStringType type = v8::NewStringType::kInternalized; + v8::Local name_string = + v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked(); that->Set(name_string, function); function->SetName(name_string); // NODE_SET_METHOD() compatibility. } @@ -449,7 +486,10 @@ inline void Environment::SetProtoMethod(v8::Local that, v8::Local signature = v8::Signature::New(isolate(), that); v8::Local function = NewFunctionTemplate(callback, signature)->GetFunction(); - v8::Local name_string = v8::String::NewFromUtf8(isolate(), name); + // kInternalized strings are created in the old space. + const v8::NewStringType type = v8::NewStringType::kInternalized; + v8::Local name_string = + v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked(); that->PrototypeTemplate()->Set(name_string, function); function->SetName(name_string); // NODE_SET_PROTOTYPE_METHOD() compatibility. } @@ -459,11 +499,20 @@ inline void Environment::SetTemplateMethod(v8::Local that, v8::FunctionCallback callback) { v8::Local function = NewFunctionTemplate(callback)->GetFunction(); - v8::Local name_string = v8::String::NewFromUtf8(isolate(), name); + // kInternalized strings are created in the old space. + const v8::NewStringType type = v8::NewStringType::kInternalized; + v8::Local name_string = + v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked(); that->Set(name_string, function); function->SetName(name_string); // NODE_SET_METHOD() compatibility. } +inline v8::Local Environment::NewInternalFieldObject() { + v8::MaybeLocal m_obj = + generic_internal_field_template()->NewInstance(context()); + return m_obj.ToLocalChecked(); +} + #define V(PropertyName, StringValue) \ inline \ v8::Local Environment::IsolateData::PropertyName() const { \ diff --git a/src/env.h b/src/env.h index ce972d598edf99..fd6444de9d8005 100644 --- a/src/env.h +++ b/src/env.h @@ -39,7 +39,7 @@ namespace node { #endif // Strings are per-isolate primitives but Environment proxies them -// for the sake of convenience. +// for the sake of convenience. Strings should be ASCII-only. #define PER_ISOLATE_STRING_PROPERTIES(V) \ V(address_string, "address") \ V(args_string, "args") \ @@ -69,7 +69,7 @@ namespace node { V(dev_string, "dev") \ V(disposed_string, "_disposed") \ V(domain_string, "domain") \ - V(domain_abort_uncaught_exc_string, "_makeCallbackAbortOnUncaught") \ + V(emitting_top_level_domain_error_string, "_emittingTopLevelDomainError") \ V(exchange_string, "exchange") \ V(idle_string, "idle") \ V(irq_string, "irq") \ @@ -100,6 +100,7 @@ namespace node { V(handle_string, "handle") \ V(heap_total_string, "heapTotal") \ V(heap_used_string, "heapUsed") \ + V(hide_string, "hide") \ V(hostmaster_string, "hostmaster") \ V(ignore_string, "ignore") \ V(immediate_callback_string, "_immediateCallback") \ @@ -231,12 +232,15 @@ namespace node { V(async_hooks_init_function, v8::Function) \ V(async_hooks_pre_function, v8::Function) \ V(async_hooks_post_function, v8::Function) \ + V(async_hooks_destroy_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) \ V(module_load_list_array, v8::Array) \ V(pipe_constructor_template, v8::FunctionTemplate) \ @@ -339,6 +343,27 @@ class Environment { DISALLOW_COPY_AND_ASSIGN(TickInfo); }; + class ArrayBufferAllocatorInfo { + public: + inline uint32_t* fields(); + inline int fields_count() const; + inline bool no_zero_fill() const; + inline void reset_fill_flag(); + + private: + friend class Environment; // So we can call the constructor. + inline ArrayBufferAllocatorInfo(); + + enum Fields { + kNoZeroFill, + kFieldsCount + }; + + uint32_t fields_[kFieldsCount]; + + DISALLOW_COPY_AND_ASSIGN(ArrayBufferAllocatorInfo); + }; + typedef void (*HandleCleanupCb)(Environment* env, uv_handle_t* handle, void* arg); @@ -401,6 +426,7 @@ class Environment { inline AsyncHooks* async_hooks(); inline DomainFlag* domain_flag(); inline TickInfo* tick_info(); + inline ArrayBufferAllocatorInfo* array_buffer_allocator_info(); inline uint64_t timer_base() const; static inline Environment* from_cares_timer_handle(uv_timer_t* handle); @@ -409,21 +435,17 @@ class Environment { inline ares_channel* cares_channel_ptr(); inline ares_task_list* cares_task_list(); - inline bool using_abort_on_uncaught_exc() const; - inline void set_using_abort_on_uncaught_exc(bool value); - inline bool using_domains() const; inline void set_using_domains(bool value); - inline bool using_asyncwrap() const; - inline void set_using_asyncwrap(bool value); - inline bool printed_error() const; inline void set_printed_error(bool value); void PrintSyncTrace() const; inline void set_trace_sync_io(bool value); + inline int64_t get_async_wrap_uid(); + bool KickNextTick(); inline uint32_t* heap_statistics_buffer() const; @@ -466,6 +488,7 @@ class Environment { const char* name, v8::FunctionCallback callback); + inline v8::Local NewInternalFieldObject(); // Strings are shared across shared contexts. The getters simply proxy to // the per-isolate primitive. @@ -510,15 +533,15 @@ class Environment { AsyncHooks async_hooks_; DomainFlag domain_flag_; TickInfo tick_info_; + ArrayBufferAllocatorInfo array_buffer_allocator_info_; const uint64_t timer_base_; uv_timer_t cares_timer_handle_; ares_channel cares_channel_; ares_task_list cares_task_list_; bool using_domains_; - bool using_abort_on_uncaught_exc_; - bool using_asyncwrap_; bool printed_error_; bool trace_sync_io_; + int64_t async_wrap_uid_; debugger::Agent debugger_agent_; HandleWrapQueue handle_wrap_queue_; diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index e17f9ce58ef5a3..7768f94459c16a 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -14,7 +14,6 @@ namespace node { using v8::Context; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Handle; using v8::HandleScope; using v8::Integer; using v8::Local; @@ -24,9 +23,9 @@ using v8::Value; class FSEventWrap: public HandleWrap { public: - static void Initialize(Handle target, - Handle unused, - Handle context); + static void Initialize(Local target, + Local unused, + Local context); static void New(const FunctionCallbackInfo& args); static void Start(const FunctionCallbackInfo& args); static void Close(const FunctionCallbackInfo& args); @@ -34,7 +33,7 @@ class FSEventWrap: public HandleWrap { size_t self_size() const override { return sizeof(*this); } private: - FSEventWrap(Environment* env, Handle object); + FSEventWrap(Environment* env, Local object); virtual ~FSEventWrap() override; static void OnEvent(uv_fs_event_t* handle, const char* filename, int events, @@ -45,7 +44,7 @@ class FSEventWrap: public HandleWrap { }; -FSEventWrap::FSEventWrap(Environment* env, Handle object) +FSEventWrap::FSEventWrap(Environment* env, Local object) : HandleWrap(env, object, reinterpret_cast(&handle_), @@ -59,9 +58,9 @@ FSEventWrap::~FSEventWrap() { } -void FSEventWrap::Initialize(Handle target, - Handle unused, - Handle context) { +void FSEventWrap::Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); @@ -147,7 +146,7 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, event_string = env->change_string(); } else { CHECK(0 && "bad fs events flag"); - abort(); + ABORT(); } Local argv[] = { diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index 341ecfdef5967b..43c5490eefa888 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -11,7 +11,6 @@ namespace node { using v8::Context; using v8::FunctionCallbackInfo; -using v8::Handle; using v8::HandleScope; using v8::Local; using v8::Object; @@ -59,7 +58,7 @@ void HandleWrap::Close(const FunctionCallbackInfo& args) { HandleWrap::HandleWrap(Environment* env, - Handle object, + Local object, uv_handle_t* handle, AsyncWrap::ProviderType provider, AsyncWrap* parent) diff --git a/src/handle_wrap.h b/src/handle_wrap.h index 94cfe3d5586deb..da712b33befbcc 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -44,7 +44,7 @@ class HandleWrap : public AsyncWrap { protected: HandleWrap(Environment* env, - v8::Handle object, + v8::Local object, uv_handle_t* handle, AsyncWrap::ProviderType provider, AsyncWrap* parent = nullptr); diff --git a/src/js_stream.cc b/src/js_stream.cc index 16fabc9df3449f..25938f111ba6ac 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -15,14 +15,13 @@ using v8::Context; using v8::External; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Handle; using v8::HandleScope; using v8::Local; using v8::Object; using v8::Value; -JSStream::JSStream(Environment* env, Handle obj, AsyncWrap* parent) +JSStream::JSStream(Environment* env, Local obj, AsyncWrap* parent) : StreamBase(env), AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) { node::Wrap(obj, this); @@ -45,7 +44,10 @@ AsyncWrap* JSStream::GetAsyncWrap() { bool JSStream::IsAlive() { - return MakeCallback(env()->isalive_string(), 0, nullptr)->IsTrue(); + v8::Local fn = object()->Get(env()->isalive_string()); + if (!fn->IsFunction()) + return false; + return MakeCallback(fn.As(), 0, nullptr)->IsTrue(); } @@ -201,9 +203,9 @@ void JSStream::EmitEOF(const FunctionCallbackInfo& args) { } -void JSStream::Initialize(Handle target, - Handle unused, - Handle context) { +void JSStream::Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); Local t = env->NewFunctionTemplate(New); diff --git a/src/js_stream.h b/src/js_stream.h index 9f7ba7de27153c..1a8902af466d87 100644 --- a/src/js_stream.h +++ b/src/js_stream.h @@ -10,9 +10,9 @@ namespace node { class JSStream : public StreamBase, public AsyncWrap { public: - static void Initialize(v8::Handle target, - v8::Handle unused, - v8::Handle context); + static void Initialize(v8::Local target, + v8::Local unused, + v8::Local context); ~JSStream(); @@ -31,7 +31,7 @@ class JSStream : public StreamBase, public AsyncWrap { size_t self_size() const override { return sizeof(*this); } protected: - JSStream(Environment* env, v8::Handle obj, AsyncWrap* parent); + JSStream(Environment* env, v8::Local obj, AsyncWrap* parent); AsyncWrap* GetAsyncWrap() override; diff --git a/src/node.cc b/src/node.cc index 084fe900cd35d4..87c82d678093bb 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" @@ -51,13 +52,21 @@ #include #include #include +#include + +#if defined(NODE_HAVE_I18N_SUPPORT) +#include +#endif + +#if defined(LEAK_SANITIZER) +#include +#endif #if defined(_MSC_VER) #include #include -#include #define strcasecmp _stricmp -#define getpid _getpid +#define getpid GetCurrentProcessId #define umask _umask typedef int mode_t; #else @@ -77,6 +86,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; @@ -88,7 +105,6 @@ using v8::Exception; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Handle; using v8::HandleScope; using v8::HeapStatistics; using v8::Integer; @@ -114,9 +130,9 @@ using v8::Value; static bool print_eval = false; static bool force_repl = false; +static bool syntax_check_only = false; static bool trace_deprecation = false; static bool throw_deprecation = false; -static bool abort_on_uncaught_exception = false; static bool trace_sync_io = false; static bool track_heap_objects = false; static const char* eval_string = nullptr; @@ -125,6 +141,7 @@ static const char** preload_modules = nullptr; static bool use_debug_agent = false; static bool debug_wait_connect = false; static int debug_port = 5858; +static bool prof_process = false; static bool v8_is_profiling = false; static bool node_is_initialized = false; static node_module* modpending; @@ -145,39 +162,40 @@ 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; -class ArrayBufferAllocator : public ArrayBuffer::Allocator { - public: - // Impose an upper limit to avoid out of memory errors that bring down - // the process. - static const size_t kMaxLength = 0x3fffffff; - static ArrayBufferAllocator the_singleton; - virtual ~ArrayBufferAllocator() = default; - virtual void* Allocate(size_t length) override; - virtual void* AllocateUninitialized(size_t length) override; - virtual void Free(void* data, size_t length) override; - private: - ArrayBufferAllocator() = default; - DISALLOW_COPY_AND_ASSIGN(ArrayBufferAllocator); -}; - -ArrayBufferAllocator ArrayBufferAllocator::the_singleton; - - -void* ArrayBufferAllocator::Allocate(size_t length) { - return calloc(length, 1); -} +static void PrintErrorString(const char* format, ...) { + va_list ap; + va_start(ap, format); +#ifdef _WIN32 + HANDLE stderr_handle = GetStdHandle(STD_ERROR_HANDLE); + + // Check if stderr is something other than a tty/console + if (stderr_handle == INVALID_HANDLE_VALUE || + stderr_handle == nullptr || + uv_guess_handle(_fileno(stderr)) != UV_TTY) { + vfprintf(stderr, format, ap); + va_end(ap); + return; + } -void* ArrayBufferAllocator::AllocateUninitialized(size_t length) { - return malloc(length); -} + // Fill in any placeholders + int n = _vscprintf(format, ap); + std::vector out(n + 1); + vsprintf(out.data(), format, ap); + // Get required wide buffer size + n = MultiByteToWideChar(CP_UTF8, 0, out.data(), -1, nullptr, 0); -void ArrayBufferAllocator::Free(void* data, size_t length) { - free(data); + std::vector wbuf(n); + MultiByteToWideChar(CP_UTF8, 0, out.data(), -1, wbuf.data(), n); + WriteConsoleW(stderr_handle, wbuf.data(), n, nullptr, nullptr); +#else + vfprintf(stderr, format, ap); +#endif + va_end(ap); } @@ -431,7 +449,9 @@ static inline const char *errno_string(int errorno) { #endif #ifdef ENOTEMPTY +# if ENOTEMPTY != EEXIST ERRNO_CASE(ENOTEMPTY); +# endif #endif #ifdef ENOTSOCK @@ -654,7 +674,9 @@ const char *signo_string(int signo) { #endif #ifdef SIGLOST +# if SIGLOST != SIGABRT SIGNO_CASE(SIGLOST); +# endif #endif #ifdef SIGPWR @@ -919,6 +941,77 @@ Local WinapiErrnoException(Isolate* isolate, #endif +void* ArrayBufferAllocator::Allocate(size_t size) { + if (env_ == nullptr || !env_->array_buffer_allocator_info()->no_zero_fill()) + 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 TopDomainHasErrorHandler(const Environment* env) { + HandleScope scope(env->isolate()); + + if (!env->using_domains()) + return false; + + Local domains_stack_array = env->domains_stack_array().As(); + if (domains_stack_array->Length() == 0) + return false; + + uint32_t domains_stack_length = domains_stack_array->Length(); + if (domains_stack_length == 0) + return false; + + Local top_domain_v = + domains_stack_array->Get(domains_stack_length - 1); + + if (!top_domain_v->IsObject()) + return false; + + Local top_domain = top_domain_v.As(); + if (DomainHasErrorHandler(env, top_domain)) + return true; + + return false; +} + + +static bool ShouldAbortOnUncaughtException(Isolate* isolate) { + HandleScope scope(isolate); + + Environment* env = Environment::GetCurrent(isolate); + Local process_object = env->process_object(); + Local emitting_top_level_domain_error_key = + env->emitting_top_level_domain_error_string(); + bool isEmittingTopLevelDomainError = + process_object->Get(emitting_top_level_domain_error_key)->BooleanValue(); + + return isEmittingTopLevelDomainError || !TopDomainHasErrorHandler(env); +} + + void SetupDomainUse(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -935,7 +1028,7 @@ void SetupDomainUse(const FunctionCallbackInfo& args) { if (!tick_callback_function->IsFunction()) { fprintf(stderr, "process._tickDomainCallback assigned to non-function\n"); - abort(); + ABORT(); } process_object->Set(env->tick_callback_string(), tick_callback_function); @@ -944,6 +1037,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")); @@ -1018,23 +1114,27 @@ void SetupPromises(const FunctionCallbackInfo& args) { } -Handle MakeCallback(Environment* env, - Handle recv, - const Handle callback, +Local MakeCallback(Environment* env, + Local recv, + const Local callback, int argc, - Handle argv[]) { + Local argv[]) { // If you hit this assertion, you forgot to enter the v8::Context first. CHECK_EQ(env->context(), env->isolate()->GetCurrentContext()); + Local pre_fn = env->async_hooks_pre_function(); + Local post_fn = env->async_hooks_post_function(); Local object, domain; - bool has_async_queue = false; + bool ran_init_callback = false; bool has_domain = false; + // 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()) { object = recv.As(); Local async_queue_v = object->Get(env->async_queue_string()); if (async_queue_v->IsObject()) - has_async_queue = true; + ran_init_callback = true; } if (env->using_domains()) { @@ -1060,9 +1160,9 @@ Handle MakeCallback(Environment* env, } } - if (has_async_queue) { + if (ran_init_callback && !pre_fn.IsEmpty()) { try_catch.SetVerbose(false); - env->async_hooks_pre_function()->Call(object, 0, nullptr); + pre_fn->Call(object, 0, nullptr); if (try_catch.HasCaught()) FatalError("node::MakeCallback", "pre hook threw"); try_catch.SetVerbose(true); @@ -1070,9 +1170,9 @@ Handle MakeCallback(Environment* env, Local ret = callback->Call(recv, argc, argv); - if (has_async_queue) { + if (ran_init_callback && !post_fn.IsEmpty()) { try_catch.SetVerbose(false); - env->async_hooks_post_function()->Call(object, 0, nullptr); + post_fn->Call(object, 0, nullptr); if (try_catch.HasCaught()) FatalError("node::MakeCallback", "post hook threw"); try_catch.SetVerbose(true); @@ -1099,43 +1199,43 @@ Handle MakeCallback(Environment* env, // Internal only. -Handle MakeCallback(Environment* env, - Handle recv, +Local MakeCallback(Environment* env, + Local recv, uint32_t index, int argc, - Handle argv[]) { + Local argv[]) { Local cb_v = recv->Get(index); CHECK(cb_v->IsFunction()); return MakeCallback(env, recv.As(), cb_v.As(), argc, argv); } -Handle MakeCallback(Environment* env, - Handle recv, - Handle symbol, +Local MakeCallback(Environment* env, + Local recv, + Local symbol, int argc, - Handle argv[]) { + Local argv[]) { Local cb_v = recv->Get(symbol); CHECK(cb_v->IsFunction()); return MakeCallback(env, recv.As(), cb_v.As(), argc, argv); } -Handle MakeCallback(Environment* env, - Handle recv, +Local MakeCallback(Environment* env, + Local recv, const char* method, int argc, - Handle argv[]) { + Local argv[]) { Local method_string = OneByteString(env->isolate(), method); return MakeCallback(env, recv, method_string, argc, argv); } -Handle MakeCallback(Isolate* isolate, - Handle recv, +Local MakeCallback(Isolate* isolate, + Local recv, const char* method, int argc, - Handle argv[]) { + Local argv[]) { EscapableHandleScope handle_scope(isolate); Local context = recv->CreationContext(); Environment* env = Environment::GetCurrent(context); @@ -1145,11 +1245,11 @@ Handle MakeCallback(Isolate* isolate, } -Handle MakeCallback(Isolate* isolate, - Handle recv, - Handle symbol, +Local MakeCallback(Isolate* isolate, + Local recv, + Local symbol, int argc, - Handle argv[]) { + Local argv[]) { EscapableHandleScope handle_scope(isolate); Local context = recv->CreationContext(); Environment* env = Environment::GetCurrent(context); @@ -1159,11 +1259,11 @@ Handle MakeCallback(Isolate* isolate, } -Handle MakeCallback(Isolate* isolate, - Handle recv, - Handle callback, +Local MakeCallback(Isolate* isolate, + Local recv, + Local callback, int argc, - Handle argv[]) { + Local argv[]) { EscapableHandleScope handle_scope(isolate); Local context = recv->CreationContext(); Environment* env = Environment::GetCurrent(context); @@ -1253,7 +1353,7 @@ enum encoding ParseEncoding(const char* encoding, enum encoding ParseEncoding(Isolate* isolate, - Handle encoding_v, + Local encoding_v, enum encoding default_encoding) { if (!encoding_v->IsString()) return default_encoding; @@ -1277,7 +1377,7 @@ Local Encode(Isolate* isolate, const uint16_t* buf, size_t len) { // Returns -1 if the handle was not valid for decoding ssize_t DecodeBytes(Isolate* isolate, - Handle val, + Local val, enum encoding encoding) { HandleScope scope(isolate); @@ -1295,14 +1395,14 @@ ssize_t DecodeBytes(Isolate* isolate, ssize_t DecodeWrite(Isolate* isolate, char* buf, size_t buflen, - Handle val, + Local val, enum encoding encoding) { return StringBytes::Write(isolate, buf, buflen, val, encoding, nullptr); } void AppendExceptionLine(Environment* env, - Handle er, - Handle message) { + Local er, + Local message) { if (message.IsEmpty()) return; @@ -1317,8 +1417,6 @@ void AppendExceptionLine(Environment* env, err_obj->SetHiddenValue(env->processed_string(), True(env->isolate())); } - char arrow[1024]; - // Print (filename):(line number): (message). node::Utf8Value filename(env->isolate(), message->GetScriptResourceName()); const char* filename_string = *filename; @@ -1351,6 +1449,9 @@ void AppendExceptionLine(Environment* env, int start = message->GetStartColumn(); int end = message->GetEndColumn(); + char arrow[1024]; + int max_off = sizeof(arrow) - 2; + int off = snprintf(arrow, sizeof(arrow), "%s:%i\n%s\n", @@ -1358,31 +1459,30 @@ void AppendExceptionLine(Environment* env, linenum, sourceline_string); CHECK_GE(off, 0); + if (off > max_off) { + off = max_off; + } // Print wavy underline (GetUnderline is deprecated). for (int i = 0; i < start; i++) { - if (sourceline_string[i] == '\0' || - static_cast(off) >= sizeof(arrow)) { + if (sourceline_string[i] == '\0' || off >= max_off) { break; } - CHECK_LT(static_cast(off), sizeof(arrow)); + CHECK_LT(off, max_off); arrow[off++] = (sourceline_string[i] == '\t') ? '\t' : ' '; } for (int i = start; i < end; i++) { - if (sourceline_string[i] == '\0' || - static_cast(off) >= sizeof(arrow)) { + if (sourceline_string[i] == '\0' || off >= max_off) { break; } - CHECK_LT(static_cast(off), sizeof(arrow)); + CHECK_LT(off, max_off); arrow[off++] = '^'; } - CHECK_LE(static_cast(off - 1), sizeof(arrow) - 1); - arrow[off++] = '\n'; - arrow[off] = '\0'; + CHECK_LE(off, max_off); + arrow[off] = '\n'; + 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()) @@ -1396,13 +1496,13 @@ void AppendExceptionLine(Environment* env, return; env->set_printed_error(true); uv_tty_reset_mode(); - fprintf(stderr, "\n%s", arrow); + PrintErrorString("\n%s", arrow); } static void ReportException(Environment* env, - Handle er, - Handle message) { + Local er, + Local message) { HandleScope scope(env->isolate()); AppendExceptionLine(env, er, message); @@ -1424,10 +1524,10 @@ static void ReportException(Environment* env, // range errors have a trace member set to undefined if (trace.length() > 0 && !trace_value->IsUndefined()) { if (arrow.IsEmpty() || !arrow->IsString()) { - fprintf(stderr, "%s\n", *trace); + PrintErrorString("%s\n", *trace); } else { node::Utf8Value arrow_string(env->isolate(), arrow); - fprintf(stderr, "%s\n%s\n", *arrow_string, *trace); + PrintErrorString("%s\n%s\n", *arrow_string, *trace); } } else { // this really only happens for RangeErrors, since they're the only @@ -1447,21 +1547,22 @@ static void ReportException(Environment* env, name.IsEmpty() || name->IsUndefined()) { // Not an error object. Just print as-is. - node::Utf8Value message(env->isolate(), er); - fprintf(stderr, "%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); if (arrow.IsEmpty() || !arrow->IsString()) { - fprintf(stderr, "%s: %s\n", *name_string, *message_string); + PrintErrorString("%s: %s\n", *name_string, *message_string); } else { node::Utf8Value arrow_string(env->isolate(), arrow); - fprintf(stderr, - "%s\n%s: %s\n", - *arrow_string, - *name_string, - *message_string); + PrintErrorString("%s\n%s: %s\n", + *arrow_string, + *name_string, + *message_string); } } } @@ -1477,8 +1578,8 @@ static void ReportException(Environment* env, const TryCatch& try_catch) { // Executes a str within the current v8 context. static Local ExecuteString(Environment* env, - Handle source, - Handle filename) { + Local source, + Local filename) { EscapableHandleScope scope(env->isolate()); TryCatch try_catch; @@ -1541,7 +1642,7 @@ void GetActiveHandles(const FunctionCallbackInfo& args) { static void Abort(const FunctionCallbackInfo& args) { - abort(); + ABORT(); } @@ -1701,7 +1802,7 @@ static const char* name_by_gid(gid_t gid) { #endif -static uid_t uid_by_name(Isolate* isolate, Handle value) { +static uid_t uid_by_name(Isolate* isolate, Local value) { if (value->IsUint32()) { return static_cast(value->Uint32Value()); } else { @@ -1711,7 +1812,7 @@ static uid_t uid_by_name(Isolate* isolate, Handle value) { } -static gid_t gid_by_name(Isolate* isolate, Handle value) { +static gid_t gid_by_name(Isolate* isolate, Local value) { if (value->IsUint32()) { return static_cast(value->Uint32Value()); } else { @@ -2068,7 +2169,7 @@ struct node_module* get_linked_module(const char* name) { return mp; } -typedef void (UV_DYNAMIC* extInit)(Handle exports); +typedef void (UV_DYNAMIC* extInit)(Local exports); // DLOpen is process.dlopen(module, filename). // Used to load 'module.node' dynamically shared objects. @@ -2114,12 +2215,15 @@ void DLOpen(const FunctionCallbackInfo& args) { return; } if (mp->nm_version != NODE_MODULE_VERSION) { - uv_dlclose(&lib); char errmsg[1024]; snprintf(errmsg, sizeof(errmsg), "Module version mismatch. Expected %d, got %d.", NODE_MODULE_VERSION, mp->nm_version); + + // NOTE: `mp` is allocated inside of the shared library's memory, calling + // `uv_dlclose` will deallocate it + uv_dlclose(&lib); env->ThrowError(errmsg); return; } @@ -2153,25 +2257,25 @@ void DLOpen(const FunctionCallbackInfo& args) { static void OnFatalError(const char* location, const char* message) { if (location) { - fprintf(stderr, "FATAL ERROR: %s %s\n", location, message); + PrintErrorString("FATAL ERROR: %s %s\n", location, message); } else { - fprintf(stderr, "FATAL ERROR: %s\n", message); + PrintErrorString("FATAL ERROR: %s\n", message); } fflush(stderr); - abort(); + ABORT(); } NO_RETURN void FatalError(const char* location, const char* message) { OnFatalError(location, message); // to suppress compiler warning - abort(); + ABORT(); } void FatalException(Isolate* isolate, - Handle error, - Handle message) { + Local error, + Local message) { HandleScope scope(isolate); Environment* env = Environment::GetCurrent(isolate); @@ -2217,7 +2321,7 @@ void FatalException(Isolate* isolate, const TryCatch& try_catch) { } -void OnMessage(Handle message, Handle error) { +void OnMessage(Local message, Local error) { // The current version of V8 sends messages for errors only // (thus `error` is always set). FatalException(Isolate::GetCurrent(), error, message); @@ -2486,7 +2590,7 @@ static void EnvEnumerator(const PropertyCallbackInfo& info) { } -static Handle GetFeatures(Environment* env) { +static Local GetFeatures(Environment* env) { EscapableHandleScope scope(env->isolate()); Local obj = Object::New(env->isolate()); @@ -2689,6 +2793,12 @@ void SetupProcessObject(Environment* env, "ares", FIXED_ONE_BYTE_STRING(env->isolate(), ARES_VERSION_STR)); +#if defined(NODE_HAVE_I18N_SUPPORT) && defined(U_ICU_VERSION) + READONLY_PROPERTY(versions, + "icu", + OneByteString(env->isolate(), U_ICU_VERSION)); +#endif + const char node_modules_version[] = NODE_STRINGIFY(NODE_MODULE_VERSION); READONLY_PROPERTY( versions, @@ -2745,6 +2855,11 @@ void SetupProcessObject(Environment* env, READONLY_PROPERTY(process, "release", release); READONLY_PROPERTY(release, "name", OneByteString(env->isolate(), "node")); +#if NODE_VERSION_IS_LTS + READONLY_PROPERTY(release, "lts", + OneByteString(env->isolate(), NODE_VERSION_LTS_CODENAME)); +#endif + // if this is a release build and no explicit base has been set // substitute the standard release download URL #ifndef NODE_RELEASE_URLBASE @@ -2754,22 +2869,25 @@ void SetupProcessObject(Environment* env, #endif #if defined(NODE_RELEASE_URLBASE) -# define _RELEASE_URLPFX NODE_RELEASE_URLBASE "v" NODE_VERSION_STRING "/" -# define _RELEASE_URLFPFX _RELEASE_URLPFX "node-v" NODE_VERSION_STRING +# define NODE_RELEASE_URLPFX NODE_RELEASE_URLBASE "v" NODE_VERSION_STRING "/" +# define NODE_RELEASE_URLFPFX NODE_RELEASE_URLPFX "node-v" NODE_VERSION_STRING READONLY_PROPERTY(release, "sourceUrl", OneByteString(env->isolate(), - _RELEASE_URLFPFX ".tar.gz")); + NODE_RELEASE_URLFPFX ".tar.gz")); READONLY_PROPERTY(release, "headersUrl", OneByteString(env->isolate(), - _RELEASE_URLFPFX "-headers.tar.gz")); + NODE_RELEASE_URLFPFX "-headers.tar.gz")); # ifdef _WIN32 READONLY_PROPERTY(release, "libUrl", OneByteString(env->isolate(), - _RELEASE_URLPFX "win-" NODE_ARCH "/node.lib")); + strcmp(NODE_ARCH, "ia32") ? NODE_RELEASE_URLPFX "win-" + NODE_ARCH "/node.lib" + : NODE_RELEASE_URLPFX + "win-x86/node.lib")); # endif #endif @@ -2818,6 +2936,11 @@ void SetupProcessObject(Environment* env, READONLY_PROPERTY(process, "_print_eval", True(env->isolate())); } + // -c, --check + if (syntax_check_only) { + READONLY_PROPERTY(process, "_syntax_check_only", True(env->isolate())); + } + // -i, --interactive if (force_repl) { READONLY_PROPERTY(process, "_forceRepl", True(env->isolate())); @@ -2850,11 +2973,26 @@ void SetupProcessObject(Environment* env, READONLY_PROPERTY(process, "throwDeprecation", True(env->isolate())); } + // --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; @@ -2960,7 +3098,7 @@ static void RawDebug(const FunctionCallbackInfo& args) { CHECK(args.Length() == 1 && args[0]->IsString() && "must be called with a single string"); node::Utf8Value message(args.GetIsolate(), args[0]); - fprintf(stderr, "%s\n", *message); + PrintErrorString("%s\n", *message); fflush(stderr); } @@ -2972,7 +3110,7 @@ void LoadEnvironment(Environment* env) { env->isolate()->AddMessageListener(OnMessage); // Compile, execute the src/node.js file. (Which was included as static C - // string in node_natives.h. 'natve_node' is the string containing that + // string in node_natives.h. 'native_node' is the string containing that // source code.) // The node.js file returns a function 'f' @@ -3074,6 +3212,7 @@ static void PrintHelp() { " -v, --version print Node.js version\n" " -e, --eval script evaluate script\n" " -p, --print evaluate script and print result\n" + " -c, --check syntax check script without executing\n" " -i, --interactive always enter the REPL even if stdin\n" " does not appear to be a terminal\n" " -r, --require module to preload (option can be repeated)\n" @@ -3085,6 +3224,8 @@ static void PrintHelp() { " 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" " --v8-options print v8 command line options\n" #if HAVE_OPENSSL " --tls-cipher-list=val use an alternative default TLS cipher list\n" @@ -3093,7 +3234,7 @@ static void PrintHelp() { " --icu-data-dir=dir set ICU data load path to dir\n" " (overrides NODE_ICU_DATA)\n" #if !defined(NODE_HAVE_SMALL_ICU) - " Note: linked-in ICU data is\n" + " note: linked-in ICU data is\n" " present.\n" #endif #endif @@ -3105,13 +3246,14 @@ static void PrintHelp() { "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" + "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" #endif #endif + "NODE_REPL_HISTORY path to the persistent REPL history file\n" "\n" "Documentation can be found at https://nodejs.org/\n"); } @@ -3155,7 +3297,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; @@ -3202,6 +3345,8 @@ static void ParseArgs(int* argc, } args_consumed += 1; local_preload_modules[preload_module_count++] = module; + } else if (strcmp(arg, "--check") == 0 || strcmp(arg, "-c") == 0) { + syntax_check_only = true; } else if (strcmp(arg, "--interactive") == 0 || strcmp(arg, "-i") == 0) { force_repl = true; } else if (strcmp(arg, "--no-deprecation") == 0) { @@ -3214,9 +3359,12 @@ static void ParseArgs(int* argc, track_heap_objects = true; } else if (strcmp(arg, "--throw-deprecation") == 0) { throw_deprecation = true; - } else if (strcmp(arg, "--abort-on-uncaught-exception") == 0 || - strcmp(arg, "--abort_on_uncaught_exception") == 0) { - abort_on_uncaught_exception = 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, "--v8-options") == 0) { new_v8_argv[new_v8_argc] = "--help"; new_v8_argc += 1; @@ -3314,28 +3462,46 @@ static void EnableDebug(Environment* env) { } +// 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(); } @@ -3389,8 +3555,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; } @@ -3563,9 +3728,9 @@ inline void PlatformInit() { // Anything but EBADF means something is seriously wrong. We don't // have to special-case EINTR, fstat() is not interruptible. if (errno != EBADF) - abort(); + ABORT(); if (fd != open("/dev/null", O_RDWR)) - abort(); + ABORT(); } CHECK_EQ(err, 0); @@ -3587,10 +3752,6 @@ inline void PlatformInit() { RegisterSignalHandler(SIGINT, SignalExit, true); RegisterSignalHandler(SIGTERM, SignalExit, true); - // Block SIGPROF signals when sleeping in epoll_wait/kevent/etc. Avoids the - // performance penalty of frequent EINTR wakeups when the profiler is running. - uv_loop_configure(uv_default_loop(), UV_LOOP_BLOCK_SIGNAL, SIGPROF); - // Raise the open file descriptor limit. struct rlimit lim; if (getrlimit(RLIMIT_NOFILE, &lim) == 0 && lim.rlim_cur != lim.rlim_max) { @@ -3632,25 +3793,6 @@ void Init(int* argc, DispatchDebugMessagesAsyncCallback); uv_unref(reinterpret_cast(&dispatch_debug_messages_async)); -#if defined(__ARM_ARCH_6__) || \ - defined(__ARM_ARCH_6J__) || \ - defined(__ARM_ARCH_6K__) || \ - defined(__ARM_ARCH_6M__) || \ - defined(__ARM_ARCH_6T2__) || \ - defined(__ARM_ARCH_6ZK__) || \ - defined(__ARM_ARCH_6Z__) - // See https://github.com/nodejs/node/issues/1376 - // and https://code.google.com/p/v8/issues/detail?id=4019 - // TODO(bnoordhuis): Remove test/parallel/test-arm-math-exp-regress-1376.js - // and this workaround when v8:4019 has been fixed and the patch back-ported. - V8::SetFlagsFromString("--nofast_math", sizeof("--nofast_math") - 1); - // See https://github.com/nodejs/node/pull/2220#issuecomment-126200059 - // and https://code.google.com/p/v8/issues/detail?id=4338 - // TODO(targos): Remove this workaround when v8:4338 has been fixed and the - // patch back-ported. - V8::SetFlagsFromString("--novector_ics", sizeof("--novector_ics") - 1); -#endif - #if defined(NODE_V8_OPTIONS) // Should come before the call to V8::SetFlagsFromCommandLine() // so the user can disable a flag --foo at run-time by passing @@ -3674,6 +3816,15 @@ void Init(int* argc, } } +#ifdef __POSIX__ + // Block SIGPROF signals when sleeping in epoll_wait/kevent/etc. Avoids the + // performance penalty of frequent EINTR wakeups when the profiler is running. + // Only do this for v8.log profiling, as it breaks v8::CpuProfiler users. + if (v8_is_profiling) { + uv_loop_configure(uv_default_loop(), UV_LOOP_BLOCK_SIGNAL, SIGPROF); + } +#endif + #if defined(NODE_HAVE_I18N_SUPPORT) if (icu_data_dir == nullptr) { // if the parameter isn't given, use the env variable. @@ -3688,7 +3839,7 @@ void Init(int* argc, #endif // The const_cast doesn't violate conceptual const-ness. V8 doesn't modify // the argv array or the elements it points to. - if (v8_argc != 0) + if (v8_argc > 1) V8::SetFlagsFromCommandLine(&v8_argc, const_cast(v8_argv), true); // Anything that's still in v8_argv is not a V8 or a node option. @@ -3707,7 +3858,11 @@ void Init(int* argc, V8::SetFlagsFromString(expose_debug_as, sizeof(expose_debug_as) - 1); } - V8::SetArrayBufferAllocator(&ArrayBufferAllocator::the_singleton); + // Unconditionally force typed arrays to allocate outside the v8 heap. This + // is to prevent memory pointers from being moved around that are returned by + // Buffer::Data(). + const char no_typed_array_heap[] = "--typed_array_max_size_in_heap=0"; + V8::SetFlagsFromString(no_typed_array_heap, sizeof(no_typed_array_heap) - 1); if (!use_debug_agent) { RegisterDebugSignalHandler(); @@ -3772,7 +3927,7 @@ int EmitExit(Environment* env) { Local process_object = env->process_object(); process_object->Set(env->exiting_string(), True(env->isolate())); - Handle exitCode = env->exit_code_string(); + Local exitCode = env->exit_code_string(); int code = process_object->Get(exitCode)->Int32Value(); Local args[] = { @@ -3789,7 +3944,7 @@ int EmitExit(Environment* env) { // Just a convenience method Environment* CreateEnvironment(Isolate* isolate, - Handle context, + Local context, int argc, const char* const* argv, int exec_argc, @@ -3811,7 +3966,7 @@ Environment* CreateEnvironment(Isolate* isolate, } static Environment* CreateEnvironment(Isolate* isolate, - Handle context, + Local context, NodeInstanceData* instance_data) { return CreateEnvironment(isolate, instance_data->event_loop(), @@ -3839,7 +3994,7 @@ static void HandleCleanup(Environment* env, Environment* CreateEnvironment(Isolate* isolate, uv_loop_t* loop, - Handle context, + Local context, int argc, const char* const* argv, int exec_argc, @@ -3910,7 +4065,10 @@ Environment* CreateEnvironment(Isolate* isolate, // node instance. static void StartNodeInstance(void* arg) { NodeInstanceData* instance_data = static_cast(arg); - Isolate* isolate = Isolate::New(); + Isolate::CreateParams params; + ArrayBufferAllocator* array_buffer_allocator = new ArrayBufferAllocator(); + params.array_buffer_allocator = array_buffer_allocator; + Isolate* isolate = Isolate::New(params); if (track_heap_objects) { isolate->GetHeapProfiler()->StartTrackingHeapObjects(true); } @@ -3918,16 +4076,20 @@ 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); HandleScope handle_scope(isolate); Local context = Context::New(isolate); Environment* env = CreateEnvironment(isolate, context, instance_data); + array_buffer_allocator->set_env(env); Context::Scope context_scope(context); - if (instance_data->is_main()) - env->set_using_abort_on_uncaught_exc(abort_on_uncaught_exception); + + isolate->SetAbortOnUncaughtExceptionCallback( + ShouldAbortOnUncaughtException); + // Start debug agent when argv has --debug if (instance_data->use_debug_agent()) StartDebug(env, debug_wait_connect); @@ -3967,15 +4129,24 @@ static void StartNodeInstance(void* arg) { instance_data->set_exit_code(exit_code); RunAtExit(env); +#if defined(LEAK_SANITIZER) + __lsan_do_leak_check(); +#endif + + array_buffer_allocator->set_env(nullptr); env->Dispose(); 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; - if (instance_data->is_main()) - node_isolate = nullptr; + delete array_buffer_allocator; } int Start(int argc, char** argv) { diff --git a/src/node.h b/src/node.h index 4d8551436628ff..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, @@ -131,24 +131,24 @@ inline v8::Local UVException(int errorno, * cb, you will appear to leak 4-bytes for every invocation. Take heed. */ -NODE_EXTERN v8::Handle MakeCallback( +NODE_EXTERN v8::Local MakeCallback( v8::Isolate* isolate, - v8::Handle recv, + v8::Local recv, const char* method, int argc, - v8::Handle* argv); -NODE_EXTERN v8::Handle MakeCallback( + v8::Local* argv); +NODE_EXTERN v8::Local MakeCallback( v8::Isolate* isolate, - v8::Handle recv, - v8::Handle symbol, + v8::Local recv, + v8::Local symbol, int argc, - v8::Handle* argv); -NODE_EXTERN v8::Handle MakeCallback( + v8::Local* argv); +NODE_EXTERN v8::Local MakeCallback( v8::Isolate* isolate, - v8::Handle recv, - v8::Handle callback, + v8::Local recv, + v8::Local callback, int argc, - v8::Handle* argv); + v8::Local* argv); } // namespace node @@ -190,7 +190,7 @@ class Environment; NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate, struct uv_loop_s* loop, - v8::Handle context, + v8::Local context, int argc, const char* const* argv, int exec_argc, @@ -201,7 +201,7 @@ NODE_EXTERN void LoadEnvironment(Environment* env); // CreateEnvironment() + LoadEnvironment() from above. // `uv_default_loop()` will be passed as `loop`. NODE_EXTERN Environment* CreateEnvironment(v8::Isolate* isolate, - v8::Handle context, + v8::Local context, int argc, const char* const* argv, int exec_argc, @@ -249,14 +249,14 @@ inline void NODE_SET_METHOD(const TypeName& recv, // Used to be a macro, hence the uppercase name. // Not a template because it only makes sense for FunctionTemplates. -inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle recv, +inline void NODE_SET_PROTOTYPE_METHOD(v8::Local recv, const char* name, v8::FunctionCallback callback) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handle_scope(isolate); - v8::Handle s = v8::Signature::New(isolate, recv); + v8::Local s = v8::Signature::New(isolate, recv); v8::Local t = - v8::FunctionTemplate::New(isolate, callback, v8::Handle(), s); + v8::FunctionTemplate::New(isolate, callback, v8::Local(), s); v8::Local fn = t->GetFunction(); recv->PrototypeTemplate()->Set(v8::String::NewFromUtf8(isolate, name), fn); v8::Local fn_name = v8::String::NewFromUtf8(isolate, name); @@ -267,11 +267,11 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Handle recv, enum encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; NODE_EXTERN enum encoding ParseEncoding( v8::Isolate* isolate, - v8::Handle encoding_v, + v8::Local encoding_v, enum encoding default_encoding = BINARY); NODE_DEPRECATED("Use ParseEncoding(isolate, ...)", inline enum encoding ParseEncoding( - v8::Handle encoding_v, + v8::Local encoding_v, enum encoding default_encoding = BINARY) { return ParseEncoding(v8::Isolate::GetCurrent(), encoding_v, default_encoding); }) @@ -312,11 +312,11 @@ NODE_DEPRECATED("Use Encode(isolate, ...)", // Returns -1 if the handle was not valid for decoding NODE_EXTERN ssize_t DecodeBytes(v8::Isolate* isolate, - v8::Handle, + v8::Local, enum encoding encoding = BINARY); NODE_DEPRECATED("Use DecodeBytes(isolate, ...)", inline ssize_t DecodeBytes( - v8::Handle val, + v8::Local val, enum encoding encoding = BINARY) { return DecodeBytes(v8::Isolate::GetCurrent(), val, encoding); }) @@ -325,12 +325,12 @@ NODE_DEPRECATED("Use DecodeBytes(isolate, ...)", NODE_EXTERN ssize_t DecodeWrite(v8::Isolate* isolate, char* buf, size_t buflen, - v8::Handle, + v8::Local, enum encoding encoding = BINARY); NODE_DEPRECATED("Use DecodeWrite(isolate, ...)", inline ssize_t DecodeWrite(char* buf, size_t buflen, - v8::Handle val, + v8::Local val, enum encoding encoding = BINARY) { return DecodeWrite(v8::Isolate::GetCurrent(), buf, buflen, val, encoding); }) @@ -359,14 +359,14 @@ const char *signo_string(int errorno); typedef void (*addon_register_func)( - v8::Handle exports, - v8::Handle module, + v8::Local exports, + v8::Local module, void* priv); typedef void (*addon_context_register_func)( - v8::Handle exports, - v8::Handle module, - v8::Handle context, + v8::Local exports, + v8::Local module, + v8::Local context, void* priv); #define NM_F_BUILTIN 0x01 diff --git a/src/node.js b/src/node.js index bd91fb888ae046..8914e855880a2f 100644 --- a/src/node.js +++ b/src/node.js @@ -1,8 +1,9 @@ // Hello, and welcome to hacking node.js! // -// This file is invoked by node::Load in src/node.cc, and responsible for -// bootstrapping the node.js core. Special caution is given to the performance -// of the startup process, so many dependencies are invoked lazily. +// 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'; @@ -10,13 +11,15 @@ this.global = this; function startup() { - var EventEmitter = NativeModule.require('events').EventEmitter; + var EventEmitter = NativeModule.require('events'); + process._eventsCount = 0; - process.__proto__ = Object.create(EventEmitter.prototype, { + Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, { constructor: { value: process.constructor } - }); + })); + EventEmitter.call(process); process.EventEmitter = EventEmitter; // process.EventEmitter is deprecated @@ -60,13 +63,14 @@ } else if (process.argv[1] == 'debug') { // Start the debugger agent - var d = NativeModule.require('_debugger'); - d.start(); + NativeModule.require('_debugger').start(); } else if (process.argv[1] == '--debug-agent') { // Start the debugger agent - var d = NativeModule.require('_debug_agent'); - d.start(); + NativeModule.require('_debug_agent').start(); + + } else if (process.profProcess) { + NativeModule.require('internal/v8_prof_processor'); } else { // There is user code to be run @@ -92,6 +96,24 @@ 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); + } + startup.preloadModules(); if (global.v8debug && process.execArgv.some(function(arg) { @@ -118,12 +140,10 @@ } } 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(); + var cliRepl = NativeModule.require('internal/repl'); cliRepl.createInternalRepl(process.env, function(err, repl) { if (err) { throw err; @@ -193,13 +213,6 @@ }; startup.processFatal = function() { - process._makeCallbackAbortOnUncaught = function() { - try { - return this[1].apply(this[0], arguments); - } catch (err) { - process._fatalException(err); - } - }; process._fatalException = function(er) { var caught; @@ -333,20 +346,20 @@ // callback invocation with small numbers of arguments to avoid the // performance hit associated with using `fn.apply()` if (args === undefined) { - doNTCallback0(callback); + nextTickCallbackWith0Args(callback); } else { switch (args.length) { case 1: - doNTCallback1(callback, args[0]); + nextTickCallbackWith1Arg(callback, args[0]); break; case 2: - doNTCallback2(callback, args[0], args[1]); + nextTickCallbackWith2Args(callback, args[0], args[1]); break; case 3: - doNTCallback3(callback, args[0], args[1], args[2]); + nextTickCallbackWith3Args(callback, args[0], args[1], args[2]); break; default: - doNTCallbackMany(callback, args); + nextTickCallbackWithManyArgs(callback, args); } } if (1e4 < tickInfo[kIndex]) @@ -374,20 +387,20 @@ // callback invocation with small numbers of arguments to avoid the // performance hit associated with using `fn.apply()` if (args === undefined) { - doNTCallback0(callback); + nextTickCallbackWith0Args(callback); } else { switch (args.length) { case 1: - doNTCallback1(callback, args[0]); + nextTickCallbackWith1Arg(callback, args[0]); break; case 2: - doNTCallback2(callback, args[0], args[1]); + nextTickCallbackWith2Args(callback, args[0], args[1]); break; case 3: - doNTCallback3(callback, args[0], args[1], args[2]); + nextTickCallbackWith3Args(callback, args[0], args[1], args[2]); break; default: - doNTCallbackMany(callback, args); + nextTickCallbackWithManyArgs(callback, args); } } if (1e4 < tickInfo[kIndex]) @@ -401,7 +414,7 @@ } while (tickInfo[kLength] !== 0); } - function doNTCallback0(callback) { + function nextTickCallbackWith0Args(callback) { var threw = true; try { callback(); @@ -412,7 +425,7 @@ } } - function doNTCallback1(callback, arg1) { + function nextTickCallbackWith1Arg(callback, arg1) { var threw = true; try { callback(arg1); @@ -423,7 +436,7 @@ } } - function doNTCallback2(callback, arg1, arg2) { + function nextTickCallbackWith2Args(callback, arg1, arg2) { var threw = true; try { callback(arg1, arg2); @@ -434,7 +447,7 @@ } } - function doNTCallback3(callback, arg1, arg2, arg3) { + function nextTickCallbackWith3Args(callback, arg1, arg2, arg3) { var threw = true; try { callback(arg1, arg2, arg3); @@ -445,7 +458,7 @@ } } - function doNTCallbackMany(callback, args) { + function nextTickCallbackWithManyArgs(callback, args) { var threw = true; try { callback.apply(null, args); @@ -543,7 +556,7 @@ // 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); + cwd = path.dirname(process.execPath); } var module = new Module(name); @@ -703,7 +716,7 @@ // not-reading state. if (stdin._handle && stdin._handle.readStop) { stdin._handle.reading = false; - stdin.push(''); + stdin._readableState.reading = false; stdin._handle.readStop(); } @@ -712,7 +725,7 @@ stdin.on('pause', function() { if (!stdin._handle) return; - stdin.push(''); + stdin._readableState.reading = false; stdin._handle.reading = false; stdin._handle.readStop(); }); @@ -774,7 +787,8 @@ var signalWraps = {}; function isSignal(event) { - return event.slice(0, 3) === 'SIG' && + return typeof event === 'string' && + event.slice(0, 3) === 'SIG' && startup.lazyConstants().hasOwnProperty(event); } @@ -938,7 +952,10 @@ var source = NativeModule.getSource(this.id); source = NativeModule.wrap(source); - var fn = runInThisContext(source, { filename: this.filename }); + var fn = runInThisContext(source, { + filename: this.filename, + lineOffset: 0 + }); fn(this.exports, NativeModule.require, this, this.filename); this.loaded = true; diff --git a/src/node_buffer.cc b/src/node_buffer.cc index c8be5b5a448c9e..90c5ee9d7797ca 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -4,6 +4,7 @@ #include "env.h" #include "env-inl.h" #include "string_bytes.h" +#include "string_search.h" #include "util.h" #include "util-inl.h" #include "v8-profiler.h" @@ -57,7 +58,6 @@ using v8::EscapableHandleScope; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Handle; using v8::HandleScope; using v8::Integer; using v8::Isolate; @@ -69,6 +69,7 @@ using v8::Object; using v8::Persistent; using v8::String; using v8::Uint32; +using v8::Uint32Array; using v8::Uint8Array; using v8::Value; using v8::WeakCallbackData; @@ -78,7 +79,7 @@ class CallbackInfo { public: static inline void Free(char* data, void* hint); static inline CallbackInfo* New(Isolate* isolate, - Handle object, + Local object, FreeCallback callback, void* hint = 0); inline void Dispose(Isolate* isolate); @@ -87,7 +88,7 @@ class CallbackInfo { static void WeakCallback(const WeakCallbackData&); inline void WeakCallback(Isolate* isolate, Local object); inline CallbackInfo(Isolate* isolate, - Handle object, + Local object, FreeCallback callback, void* hint); ~CallbackInfo(); @@ -104,7 +105,7 @@ void CallbackInfo::Free(char* data, void*) { CallbackInfo* CallbackInfo::New(Isolate* isolate, - Handle object, + Local object, FreeCallback callback, void* hint) { return new CallbackInfo(isolate, object, callback, hint); @@ -122,7 +123,7 @@ Persistent* CallbackInfo::persistent() { CallbackInfo::CallbackInfo(Isolate* isolate, - Handle object, + Local object, FreeCallback callback, void* hint) : persistent_(isolate, object), @@ -147,11 +148,14 @@ void CallbackInfo::WeakCallback( void CallbackInfo::WeakCallback(Isolate* isolate, Local object) { - SPREAD_ARG(object, obj); - CHECK_EQ(obj_offset, 0); - CHECK_EQ(obj_c.ByteLength(), obj_length); - - obj->Buffer()->Neuter(); + CHECK(object->IsArrayBuffer()); + Local buf = object.As(); + ArrayBuffer::Contents obj_c = buf->GetContents(); + char* const obj_data = static_cast(obj_c.Data()); + if (buf->ByteLength() != 0) + CHECK_NE(obj_data, nullptr); + + buf->Neuter(); callback_(obj_data, hint_); int64_t change_in_bytes = -static_cast(sizeof(*this)); isolate->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); @@ -162,29 +166,25 @@ void CallbackInfo::WeakCallback(Isolate* isolate, Local object) { // Buffer methods -bool HasInstance(Handle val) { - return val->IsObject() && HasInstance(val.As()); +bool HasInstance(Local val) { + return val->IsUint8Array(); } -bool HasInstance(Handle obj) { - if (!obj->IsUint8Array()) - return false; - Local array = obj.As(); - Environment* env = Environment::GetCurrent(array->GetIsolate()); - return array->GetPrototype()->StrictEquals(env->buffer_prototype_object()); +bool HasInstance(Local obj) { + return obj->IsUint8Array(); } -char* Data(Handle val) { - CHECK(val->IsObject()); - // Use a fully qualified name here to work around a bug in gcc 4.2. - // It mistakes an unadorned call to Data() for the v8::String::Data type. - return node::Buffer::Data(val.As()); +char* Data(Local val) { + CHECK(val->IsUint8Array()); + Local ui = val.As(); + ArrayBuffer::Contents ab_c = ui->Buffer()->GetContents(); + return static_cast(ab_c.Data()) + ui->ByteOffset(); } -char* Data(Handle obj) { +char* Data(Local obj) { CHECK(obj->IsUint8Array()); Local ui = obj.As(); ArrayBuffer::Contents ab_c = ui->Buffer()->GetContents(); @@ -192,13 +192,14 @@ char* Data(Handle obj) { } -size_t Length(Handle val) { - CHECK(val->IsObject()); - return Length(val.As()); +size_t Length(Local val) { + CHECK(val->IsUint8Array()); + Local ui = val.As(); + return ui->ByteLength(); } -size_t Length(Handle obj) { +size_t Length(Local obj) { CHECK(obj->IsUint8Array()); Local ui = obj.As(); return ui->ByteLength(); @@ -210,18 +211,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(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; @@ -356,7 +369,7 @@ MaybeLocal New(Environment* env, if (!mb.FromMaybe(false)) return Local(); - CallbackInfo::New(env->isolate(), ui, callback, hint); + CallbackInfo::New(env->isolate(), ab, callback, hint); return scope.Escape(ui); } @@ -393,43 +406,6 @@ MaybeLocal New(Environment* env, char* data, size_t length) { } -void Create(const FunctionCallbackInfo& args) { - Isolate* isolate = args.GetIsolate(); - Environment* env = Environment::GetCurrent(args); - - CHECK(args[0]->IsNumber()); - - int64_t length = args[0]->IntegerValue(); - - if (length < 0 || length > kMaxLength) { - return env->ThrowRangeError("invalid Buffer length"); - } - - void* data; - if (length > 0) { - data = malloc(length); - if (data == nullptr) { - return env->ThrowRangeError( - "Buffer allocation failed - process out of memory"); - } - } else { - data = nullptr; - } - - Local ab = - ArrayBuffer::New(isolate, - data, - length, - ArrayBufferCreationMode::kInternalized); - Local ui = Uint8Array::New(ab, 0, length); - Maybe mb = - ui->SetPrototype(env->context(), env->buffer_prototype_object()); - if (!mb.FromMaybe(false)) - return env->ThrowError("Unable to set Object prototype"); - args.GetReturnValue().Set(ui); -} - - void CreateFromString(const FunctionCallbackInfo& args) { CHECK(args[0]->IsString()); CHECK(args[1]->IsString()); @@ -457,29 +433,6 @@ void CreateFromArrayBuffer(const FunctionCallbackInfo& args) { } -void Slice(const FunctionCallbackInfo& args) { - CHECK(args[0]->IsUint8Array()); - CHECK(args[1]->IsNumber()); - CHECK(args[2]->IsNumber()); - Environment* env = Environment::GetCurrent(args); - Local ab_ui = args[0].As(); - Local ab = ab_ui->Buffer(); - ArrayBuffer::Contents ab_c = ab->GetContents(); - size_t offset = ab_ui->ByteOffset(); - size_t start = args[1]->NumberValue() + offset; - size_t end = args[2]->NumberValue() + offset; - CHECK_GE(end, start); - size_t size = end - start; - CHECK_GE(ab_c.ByteLength(), start + size); - Local ui = Uint8Array::New(ab, start, size); - Maybe mb = - ui->SetPrototype(env->context(), env->buffer_prototype_object()); - if (!mb.FromMaybe(false)) - return env->ThrowError("Unable to set Object prototype"); - args.GetReturnValue().Set(ui); -} - - template void StringSlice(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -519,10 +472,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. @@ -532,6 +486,8 @@ void StringSlice(const FunctionCallbackInfo& args) { } buf = copy; release = true; + } else { + buf = reinterpret_cast(data); } args.GetReturnValue().Set(StringBytes::Encode(env->isolate(), buf, length)); @@ -777,7 +733,9 @@ uint32_t WriteFloatGeneric(const FunctionCallbackInfo& args) { T val = args[1]->NumberValue(); uint32_t offset = args[2]->Uint32Value(); - CHECK_LE(offset + sizeof(T), ts_obj_length); + size_t memcpy_num = sizeof(T); + if (offset + sizeof(T) > ts_obj_length) + memcpy_num = ts_obj_length - offset; union NoAlias { T val; @@ -788,8 +746,8 @@ 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); + return offset + memcpy_num; } @@ -835,7 +793,7 @@ void Compare(const FunctionCallbackInfo &args) { size_t cmp_length = MIN(obj_a_length, obj_b_length); - int32_t val = memcmp(obj_a_data, obj_b_data, cmp_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. @@ -855,87 +813,174 @@ void Compare(const FunctionCallbackInfo &args) { } -int32_t IndexOf(const char* haystack, - size_t h_length, - const char* needle, - size_t n_length) { - CHECK_GE(h_length, n_length); - // TODO(trevnorris): Implement Boyer-Moore string search algorithm. - for (size_t i = 0; i < h_length - n_length + 1; i++) { - if (haystack[i] == needle[0]) { - if (memcmp(haystack + i, needle, n_length) == 0) - return i; - } - } - return -1; -} - - void IndexOfString(const FunctionCallbackInfo& args) { ASSERT(args[1]->IsString()); ASSERT(args[2]->IsNumber()); + enum encoding enc = ParseEncoding(args.GetIsolate(), + args[3], + UTF8); + THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); SPREAD_ARG(args[0], ts_obj); - node::Utf8Value str(args.GetIsolate(), args[1]); - int32_t offset_i32 = args[2]->Int32Value(); - uint32_t offset; + Local needle = args[1].As(); + const char* haystack = ts_obj_data; + const size_t haystack_length = ts_obj_length; + // 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) { + return args.GetReturnValue().Set(-1); + } - if (offset_i32 < 0) { - if (offset_i32 + static_cast(ts_obj_length) < 0) + int64_t offset_i64 = args[2]->IntegerValue(); + size_t offset = 0; + + if (offset_i64 < 0) { + if (offset_i64 + static_cast(haystack_length) < 0) { offset = 0; - else - offset = static_cast(ts_obj_length + offset_i32); + } else { + offset = static_cast(haystack_length + offset_i64); + } } else { - offset = static_cast(offset_i32); + offset = static_cast(offset_i64); } - if (str.length() == 0 || - ts_obj_length == 0 || - (offset != 0 && str.length() + offset <= str.length()) || - str.length() + offset > ts_obj_length) + if (haystack_length < offset || needle_length + offset > haystack_length) { return args.GetReturnValue().Set(-1); + } - int32_t r = - IndexOf(ts_obj_data + offset, ts_obj_length - offset, *str, str.length()); - args.GetReturnValue().Set(r == -1 ? -1 : static_cast(r + offset)); -} + size_t result = haystack_length; + + if (enc == UCS2) { + String::Value needle_value(needle); + if (*needle_value == nullptr) + return args.GetReturnValue().Set(-1); + if (haystack_length < 2 || needle_value.length() < 1) { + return args.GetReturnValue().Set(-1); + } + + if (IsBigEndian()) { + StringBytes::InlineDecoder decoder; + decoder.Decode(Environment::GetCurrent(args), needle, args[3], UCS2); + const uint16_t* decoded_string = + reinterpret_cast(decoder.out()); + + if (decoded_string == nullptr) + return args.GetReturnValue().Set(-1); + + result = SearchString(reinterpret_cast(haystack), + haystack_length / 2, + decoded_string, + decoder.size() / 2, + offset / 2); + } else { + result = SearchString(reinterpret_cast(haystack), + haystack_length / 2, + reinterpret_cast(*needle_value), + needle_value.length(), + offset / 2); + } + result *= 2; + } else if (enc == UTF8) { + String::Utf8Value needle_value(needle); + if (*needle_value == nullptr) + return args.GetReturnValue().Set(-1); + + result = SearchString(reinterpret_cast(haystack), + haystack_length, + reinterpret_cast(*needle_value), + needle_length, + offset); + } else if (enc == BINARY) { + uint8_t* needle_data = static_cast(malloc(needle_length)); + if (needle_data == nullptr) { + return args.GetReturnValue().Set(-1); + } + needle->WriteOneByte( + needle_data, 0, needle_length, String::NO_NULL_TERMINATION); + + result = SearchString(reinterpret_cast(haystack), + haystack_length, + needle_data, + needle_length, + offset); + free(needle_data); + } + + args.GetReturnValue().Set( + result == haystack_length ? -1 : static_cast(result)); +} void IndexOfBuffer(const FunctionCallbackInfo& args) { ASSERT(args[1]->IsObject()); ASSERT(args[2]->IsNumber()); + enum encoding enc = ParseEncoding(args.GetIsolate(), + args[3], + UTF8); + THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); SPREAD_ARG(args[0], ts_obj); SPREAD_ARG(args[1], buf); - const int32_t offset_i32 = args[2]->Int32Value(); - uint32_t offset; if (buf_length > 0) CHECK_NE(buf_data, nullptr); - if (offset_i32 < 0) { - if (offset_i32 + static_cast(ts_obj_length) < 0) + const char* haystack = ts_obj_data; + const size_t haystack_length = ts_obj_length; + const char* needle = buf_data; + const size_t needle_length = buf_length; + + if (needle_length == 0 || haystack_length == 0) { + return args.GetReturnValue().Set(-1); + } + + int64_t offset_i64 = args[2]->IntegerValue(); + size_t offset = 0; + + if (offset_i64 < 0) { + if (offset_i64 + static_cast(haystack_length) < 0) offset = 0; else - offset = static_cast(ts_obj_length + offset_i32); + offset = static_cast(haystack_length + offset_i64); } else { - offset = static_cast(offset_i32); + offset = static_cast(offset_i64); } - if (buf_length == 0 || - ts_obj_length == 0 || - (offset != 0 && buf_length + offset <= buf_length) || - buf_length + offset > ts_obj_length) + if (haystack_length < offset || needle_length + offset > haystack_length) { return args.GetReturnValue().Set(-1); + } - int32_t r = - IndexOf(ts_obj_data + offset, ts_obj_length - offset, buf_data, buf_length); - args.GetReturnValue().Set(r == -1 ? -1 : static_cast(r + offset)); -} + size_t result = haystack_length; + if (enc == UCS2) { + if (haystack_length < 2 || needle_length < 2) { + return args.GetReturnValue().Set(-1); + } + result = SearchString( + reinterpret_cast(haystack), + haystack_length / 2, + reinterpret_cast(needle), + needle_length / 2, + offset / 2); + result *= 2; + } else { + result = SearchString( + reinterpret_cast(haystack), + haystack_length, + reinterpret_cast(needle), + needle_length, + offset); + } + + args.GetReturnValue().Set( + result == haystack_length ? -1 : static_cast(result)); +} void IndexOfNumber(const FunctionCallbackInfo& args) { ASSERT(args[1]->IsNumber()); @@ -945,16 +990,16 @@ void IndexOfNumber(const FunctionCallbackInfo& args) { SPREAD_ARG(args[0], ts_obj); uint32_t needle = args[1]->Uint32Value(); - int32_t offset_i32 = args[2]->Int32Value(); - uint32_t offset; + int64_t offset_i64 = args[2]->IntegerValue(); + size_t offset; - if (offset_i32 < 0) { - if (offset_i32 + static_cast(ts_obj_length) < 0) + if (offset_i64 < 0) { + if (offset_i64 + static_cast(ts_obj_length) < 0) offset = 0; else - offset = static_cast(ts_obj_length + offset_i32); + offset = static_cast(ts_obj_length + offset_i64); } else { - offset = static_cast(offset_i32); + offset = static_cast(offset_i64); } if (ts_obj_length == 0 || offset + 1 > ts_obj_length) @@ -962,8 +1007,8 @@ void IndexOfNumber(const FunctionCallbackInfo& args) { void* ptr = memchr(ts_obj_data + offset, needle, ts_obj_length - offset); char* ptr_char = static_cast(ptr); - args.GetReturnValue().Set( - ptr ? static_cast(ptr_char - ts_obj_data) : -1); + args.GetReturnValue().Set(ptr ? static_cast(ptr_char - ts_obj_data) + : -1); } @@ -990,20 +1035,31 @@ void SetupBufferJS(const FunctionCallbackInfo& args) { env->SetMethod(proto, "utf8Write", Utf8Write); env->SetMethod(proto, "copy", Copy); + + CHECK(args[1]->IsObject()); + Local bObj = args[1].As(); + + uint32_t* const fields = env->array_buffer_allocator_info()->fields(); + uint32_t const fields_count = + env->array_buffer_allocator_info()->fields_count(); + + Local array_buffer = + ArrayBuffer::New(env->isolate(), fields, sizeof(*fields) * fields_count); + + bObj->Set(String::NewFromUtf8(env->isolate(), "flags"), + Uint32Array::New(array_buffer, 0, fields_count)); } -void Initialize(Handle target, - Handle unused, - Handle context) { +void Initialize(Local target, + Local unused, + Local context) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "setupBufferJS", SetupBufferJS); - env->SetMethod(target, "create", Create); env->SetMethod(target, "createFromString", CreateFromString); env->SetMethod(target, "createFromArrayBuffer", CreateFromArrayBuffer); - env->SetMethod(target, "slice", Slice); env->SetMethod(target, "byteLengthUtf8", ByteLengthUtf8); env->SetMethod(target, "compare", Compare); env->SetMethod(target, "fill", Fill); @@ -1024,6 +1080,10 @@ void Initialize(Handle target, target->Set(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), "kMaxLength"), Integer::NewFromUnsigned(env->isolate(), kMaxLength)).FromJust(); + + target->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "kStringMaxLength"), + Integer::New(env->isolate(), String::kMaxLength)).FromJust(); } diff --git a/src/node_buffer.h b/src/node_buffer.h index 49fb5741640060..503cbb167547a5 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -12,12 +12,12 @@ static const unsigned int kMaxLength = NODE_EXTERN typedef void (*FreeCallback)(char* data, void* hint); -NODE_EXTERN bool HasInstance(v8::Handle val); -NODE_EXTERN bool HasInstance(v8::Handle val); -NODE_EXTERN char* Data(v8::Handle val); -NODE_EXTERN char* Data(v8::Handle val); -NODE_EXTERN size_t Length(v8::Handle val); -NODE_EXTERN size_t Length(v8::Handle val); +NODE_EXTERN bool HasInstance(v8::Local val); +NODE_EXTERN bool HasInstance(v8::Local val); +NODE_EXTERN char* Data(v8::Local val); +NODE_EXTERN char* Data(v8::Local val); +NODE_EXTERN size_t Length(v8::Local val); +NODE_EXTERN size_t Length(v8::Local val); // public constructor - data is copied NODE_EXTERN v8::MaybeLocal Copy(v8::Isolate* isolate, @@ -29,7 +29,7 @@ NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, size_t length); // public constructor from string NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, - v8::Handle string, + v8::Local string, enum encoding enc = UTF8); // public constructor - data is used, callback is passed data on object gc diff --git a/src/node_constants.cc b/src/node_constants.cc index 59dd11113eb70c..51c2ee814ae504 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -21,14 +21,14 @@ namespace node { -using v8::Handle; +using v8::Local; using v8::Object; #if HAVE_OPENSSL const char* default_cipher_list = DEFAULT_CIPHER_LIST_CORE; #endif -void DefineErrnoConstants(Handle target) { +void DefineErrnoConstants(Local target) { #ifdef E2BIG NODE_DEFINE_CONSTANT(target, E2BIG); #endif @@ -346,7 +346,7 @@ void DefineErrnoConstants(Handle target) { #endif } -void DefineWindowsErrorConstants(Handle target) { +void DefineWindowsErrorConstants(Local target) { #ifdef WSAEINTR NODE_DEFINE_CONSTANT(target, WSAEINTR); #endif @@ -580,7 +580,7 @@ void DefineWindowsErrorConstants(Handle target) { #endif } -void DefineSignalConstants(Handle target) { +void DefineSignalConstants(Local target) { #ifdef SIGHUP NODE_DEFINE_CONSTANT(target, SIGHUP); #endif @@ -725,7 +725,7 @@ void DefineSignalConstants(Handle target) { #endif } -void DefineOpenSSLConstants(Handle target) { +void DefineOpenSSLConstants(Local target) { #ifdef SSL_OP_ALL NODE_DEFINE_CONSTANT(target, SSL_OP_ALL); #endif @@ -969,7 +969,7 @@ void DefineOpenSSLConstants(Handle target) { #endif } -void DefineSystemConstants(Handle target) { +void DefineSystemConstants(Local target) { // file access modes NODE_DEFINE_CONSTANT(target, O_RDONLY); NODE_DEFINE_CONSTANT(target, O_WRONLY); @@ -1108,11 +1108,11 @@ void DefineSystemConstants(Handle target) { #endif } -void DefineUVConstants(Handle target) { +void DefineUVConstants(Local target) { NODE_DEFINE_CONSTANT(target, UV_UDP_REUSEADDR); } -void DefineCryptoConstants(Handle target) { +void DefineCryptoConstants(Local target) { #if HAVE_OPENSSL NODE_DEFINE_STRING_CONSTANT(target, "defaultCoreCipherList", @@ -1123,7 +1123,7 @@ void DefineCryptoConstants(Handle target) { #endif } -void DefineConstants(Handle target) { +void DefineConstants(Local target) { DefineErrnoConstants(target); DefineWindowsErrorConstants(target); DefineSignalConstants(target); diff --git a/src/node_constants.h b/src/node_constants.h index 45c991022e6bc6..a7c75c4eb2bf38 100644 --- a/src/node_constants.h +++ b/src/node_constants.h @@ -34,7 +34,7 @@ namespace node { extern const char* default_cipher_list; #endif -void DefineConstants(v8::Handle target); +void DefineConstants(v8::Local target); } // namespace node #endif // SRC_NODE_CONSTANTS_H_ diff --git a/src/node_contextify.cc b/src/node_contextify.cc index ae043eb376a115..59a90c88c9993f 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -21,7 +21,6 @@ using v8::External; using v8::Function; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; -using v8::Handle; using v8::HandleScope; using v8::Integer; using v8::Isolate; @@ -65,9 +64,10 @@ class ContextifyContext { explicit ContextifyContext(Environment* env, Local sandbox) : env_(env), sandbox_(env->isolate(), sandbox), - context_(env->isolate(), CreateV8Context(env)), // Wait for sandbox_, proxy_global_, and context_ to die references_(0) { + context_.Reset(env->isolate(), CreateV8Context(env)); + sandbox_.SetWeak(this, WeakCallback); sandbox_.MarkIndependent(); references_++; @@ -188,7 +188,7 @@ class ContextifyContext { Local wrapper = env->script_data_constructor_function()->NewInstance(); if (wrapper.IsEmpty()) - return scope.Escape(Local::New(env->isolate(), Handle())); + return scope.Escape(Local::New(env->isolate(), Local())); Wrap(wrapper, this); return scope.Escape(wrapper); @@ -216,8 +216,9 @@ class ContextifyContext { object_template->SetHandler(config); Local ctx = Context::New(env->isolate(), nullptr, object_template); - if (!ctx.IsEmpty()) - ctx->SetSecurityToken(env->context()->GetSecurityToken()); + + CHECK(!ctx.IsEmpty()); + ctx->SetSecurityToken(env->context()->GetSecurityToken()); env->AssignToContext(ctx); @@ -238,31 +239,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); - ScopedEnvironment env_scope(debug_context, env); + 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); + } + 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-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-server.js b/test/parallel/test-http-server.js index 9ba13ddf96b6ec..b33c19a076fe04 100644 --- a/test/parallel/test-http-server.js +++ b/test/parallel/test-http-server.js @@ -23,21 +23,17 @@ var server = http.createServer(function(req, res) { } if (req.id == 1) { - common.error('req 1'); assert.equal('POST', req.method); assert.equal('/quit', url.parse(req.url).pathname); } if (req.id == 2) { - common.error('req 2'); assert.equal('foo', req.headers['x-x']); } if (req.id == 3) { - common.error('req 3'); assert.equal('bar', req.headers['x-x']); this.close(); - common.error('server closed'); } setTimeout(function() { diff --git a/test/parallel/test-http-set-timeout.js b/test/parallel/test-http-set-timeout.js index b3ca90a67bbe90..9bda60b2226443 100644 --- a/test/parallel/test-http-set-timeout.js +++ b/test/parallel/test-http-set-timeout.js @@ -10,7 +10,7 @@ var server = http.createServer(function(req, res) { assert.ok(s instanceof net.Socket); req.connection.on('timeout', function() { req.connection.destroy(); - common.debug('TIMEOUT'); + console.error('TIMEOUT'); server.close(); }); }); 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-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 9ec8c8a1572844..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? @@ -18,6 +17,8 @@ var server = http.createServer(function(req, res) { res.end(); }); +common.refreshTmpDir(); + server.listen(common.PIPE, function() { var options = { 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-upgrade-server2.js b/test/parallel/test-http-upgrade-server2.js index 9a22df52c210be..dec3bab1caeac0 100644 --- a/test/parallel/test-http-upgrade-server2.js +++ b/test/parallel/test-http-upgrade-server2.js @@ -5,12 +5,10 @@ var http = require('http'); var net = require('net'); var server = http.createServer(function(req, res) { - common.error('got req'); throw new Error('This shouldn\'t happen.'); }); server.on('upgrade', function(req, socket, upgradeHead) { - common.error('got upgrade event'); // test that throwing an error from upgrade gets // is uncaught throw new Error('upgrade error'); @@ -19,7 +17,6 @@ server.on('upgrade', function(req, socket, upgradeHead) { var gotError = false; process.on('uncaughtException', function(e) { - common.error('got \'clientError\' event'); assert.equal('upgrade error', e.message); gotError = true; process.exit(0); @@ -30,7 +27,6 @@ server.listen(common.PORT, function() { var c = net.createConnection(common.PORT); c.on('connect', function() { - common.error('client wrote message'); c.write('GET /blah HTTP/1.1\r\n' + 'Upgrade: WebSocket\r\n' + 'Connection: Upgrade\r\n' + @@ -42,7 +38,6 @@ server.listen(common.PORT, function() { }); c.on('close', function() { - common.error('client close'); server.close(); }); }); 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-http-write-empty-string.js b/test/parallel/test-http-write-empty-string.js index 50a9f5d509f381..44a1ae9d02dfef 100644 --- a/test/parallel/test-http-write-empty-string.js +++ b/test/parallel/test-http-write-empty-string.js @@ -31,7 +31,6 @@ server.listen(common.PORT, function() { res.on('data', function(chunk) { response += chunk; }); - common.error('Got /hello response'); }); }); diff --git a/test/parallel/test-http.js b/test/parallel/test-http.js index daa746cdbe5b7a..5738fc766d7cc7 100644 --- a/test/parallel/test-http.js +++ b/test/parallel/test-http.js @@ -4,10 +4,6 @@ var assert = require('assert'); var http = require('http'); var url = require('url'); -function p(x) { - common.error(common.inspect(x)); -} - var responses_sent = 0; var responses_recvd = 0; var body0 = ''; @@ -56,7 +52,7 @@ server.on('listening', function() { responses_recvd += 1; res.setEncoding('utf8'); res.on('data', function(chunk) { body0 += chunk; }); - common.debug('Got /hello response'); + console.error('Got /hello response'); }); setTimeout(function() { @@ -70,17 +66,17 @@ server.on('listening', function() { responses_recvd += 1; res.setEncoding('utf8'); res.on('data', function(chunk) { body1 += chunk; }); - common.debug('Got /world response'); + console.error('Got /world response'); }); req.end(); }, 1); }); process.on('exit', function() { - common.debug('responses_recvd: ' + responses_recvd); + console.error('responses_recvd: ' + responses_recvd); assert.equal(2, responses_recvd); - common.debug('responses_sent: ' + responses_sent); + console.error('responses_sent: ' + responses_sent); assert.equal(2, responses_sent); assert.equal('The path was /hello', body0); 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-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-drain.js b/test/parallel/test-https-drain.js index 43113ef980b47a..1ba5e2a4679f6d 100644 --- a/test/parallel/test-https-drain.js +++ b/test/parallel/test-https-drain.js @@ -34,7 +34,7 @@ server.listen(common.PORT, function() { }, function(res) { var timer; res.pause(); - common.debug('paused'); + console.error('paused'); send(); function send() { if (req.write(new Buffer(bufSize))) { @@ -43,10 +43,10 @@ server.listen(common.PORT, function() { return process.nextTick(send); } sent += bufSize; - common.debug('sent: ' + sent); + console.error('sent: ' + sent); resumed = true; res.resume(); - common.debug('resumed'); + console.error('resumed'); timer = setTimeout(function() { process.exit(1); }, 1000); @@ -60,7 +60,7 @@ server.listen(common.PORT, function() { } received += data.length; if (received >= sent) { - common.debug('received: ' + received); + console.error('received: ' + received); req.end(); server.close(); } 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 b3cb4ffe6b077b..f5bb1f84c310b3 100644 --- a/test/parallel/test-https-localaddress-bind-error.js +++ b/test/parallel/test-https-localaddress-bind-error.js @@ -28,14 +28,14 @@ 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: '/', method: 'GET', localAddress: invalidLocalAddress }, function(res) { - assert.fail('unexpectedly got response from server'); + assert.fail(null, null, 'unexpectedly got response from server'); }).on('error', function(e) { console.log('client got error: ' + e.message); gotError = true; 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 new file mode 100644 index 00000000000000..280e5d9dabee66 --- /dev/null +++ b/test/parallel/test-js-stream-call-properties.js @@ -0,0 +1,8 @@ +'use strict'; + +require('../common'); +const util = require('util'); +const JSStream = process.binding('js_stream').JSStream; + +// Testing if will abort when properties are printed. +util.inspect(new JSStream()); diff --git a/test/parallel/test-listen-fd-cluster.js b/test/parallel/test-listen-fd-cluster.js index f6d00c72a0f78c..c321f699d7a89d 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'); 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/parallel/test-memory-usage.js b/test/parallel/test-memory-usage.js index 09dc4f820a8d74..9b39601e2e20b3 100644 --- a/test/parallel/test-memory-usage.js +++ b/test/parallel/test-memory-usage.js @@ -1,7 +1,6 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var r = process.memoryUsage(); -console.log(common.inspect(r)); assert.equal(true, r['rss'] > 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 f430b65d8cf0a5..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'); -common.debug('load test-module-loading-error.js'); +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-net-access-byteswritten.js b/test/parallel/test-net-access-byteswritten.js new file mode 100644 index 00000000000000..362d533bbb87c1 --- /dev/null +++ b/test/parallel/test-net-access-byteswritten.js @@ -0,0 +1,16 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const net = require('net'); +const tls = require('tls'); +const tty = require('tty'); + +// Check that the bytesWritten getter doesn't crash if object isn't +// constructed. +assert.strictEqual(net.Socket.prototype.bytesWritten, undefined); +assert.strictEqual(tls.TLSSocket.super_.prototype.bytesWritten, undefined); +assert.strictEqual(tls.TLSSocket.prototype.bytesWritten, undefined); +assert.strictEqual(tty.ReadStream.super_.prototype.bytesWritten, undefined); +assert.strictEqual(tty.ReadStream.prototype.bytesWritten, undefined); +assert.strictEqual(tty.WriteStream.prototype.bytesWritten, undefined); 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-binary.js b/test/parallel/test-net-binary.js index cf29cfe63bad71..484ae60c111b3a 100644 --- a/test/parallel/test-net-binary.js +++ b/test/parallel/test-net-binary.js @@ -7,13 +7,6 @@ var binaryString = ''; for (var i = 255; i >= 0; i--) { var s = '\'\\' + i.toString(8) + '\''; var S = eval(s); - common.error(s + - ' ' + - JSON.stringify(S) + - ' ' + - JSON.stringify(String.fromCharCode(i)) + - ' ' + - S.charCodeAt(0)); assert.ok(S.charCodeAt(0) == i); assert.ok(S == String.fromCharCode(i)); binaryString += S; @@ -21,14 +14,11 @@ for (var i = 255; i >= 0; i--) { // safe constructor var echoServer = net.Server(function(connection) { - console.error('SERVER got connection'); connection.setEncoding('binary'); connection.on('data', function(chunk) { - common.error('SERVER recved: ' + JSON.stringify(chunk)); connection.write(chunk, 'binary'); }); connection.on('end', function() { - console.error('SERVER ending'); connection.end(); }); }); @@ -37,7 +27,6 @@ echoServer.listen(common.PORT); var recv = ''; echoServer.on('listening', function() { - console.error('SERVER listening'); var j = 0; var c = net.createConnection({ port: common.PORT @@ -45,48 +34,34 @@ echoServer.on('listening', function() { c.setEncoding('binary'); c.on('data', function(chunk) { - console.error('CLIENT data %j', chunk); var n = j + chunk.length; while (j < n && j < 256) { - common.error('CLIENT write ' + j); c.write(String.fromCharCode(j), 'binary'); j++; } if (j === 256) { - console.error('CLIENT ending'); c.end(); } recv += chunk; }); c.on('connect', function() { - console.error('CLIENT connected, writing'); c.write(binaryString, 'binary'); }); c.on('close', function() { - console.error('CLIENT closed'); - console.dir(recv); echoServer.close(); }); - - c.on('finish', function() { - console.error('CLIENT finished'); - }); }); process.on('exit', function() { - console.log('recv: ' + JSON.stringify(recv)); - assert.equal(2 * 256, recv.length); var a = recv.split(''); var first = a.slice(0, 256).reverse().join(''); - console.log('first: ' + JSON.stringify(first)); var second = a.slice(256, 2 * 256).join(''); - console.log('second: ' + JSON.stringify(second)); assert.equal(first, second); }); 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..8b11612a1286f2 100644 --- a/test/parallel/test-net-connect-options-ipv6.js +++ b/test/parallel/test-net-connect-options-ipv6.js @@ -1,57 +1,56 @@ '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) { + if (err.syscall === 'getaddrinfo' && err.code === 'ENOTFOUND') { + 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-connect-paused-connection.js b/test/parallel/test-net-connect-paused-connection.js index 60af9e44fb31f6..bb258ef009a657 100644 --- a/test/parallel/test-net-connect-paused-connection.js +++ b/test/parallel/test-net-connect-paused-connection.js @@ -11,5 +11,5 @@ net.createServer(function(conn) { net.connect(common.PORT, 'localhost').pause(); setTimeout(function() { - assert.fail('expected to exit'); + assert.fail(null, null, 'expected to exit'); }, 1000).unref(); diff --git a/test/parallel/test-net-create-connection.js b/test/parallel/test-net-create-connection.js index c245ddc2ae7860..38452be6e6a954 100644 --- a/test/parallel/test-net-create-connection.js +++ b/test/parallel/test-net-create-connection.js @@ -22,7 +22,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; }); 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-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..76432ed3488240 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'); 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-listen-close-server.js b/test/parallel/test-net-listen-close-server.js index 9c4dbcfe2e15e2..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) { }); @@ -10,7 +9,7 @@ server.listen(common.PORT, function() { assert(false); }); server.on('error', function(error) { - common.debug(error); + console.error(error); assert(false); }); server.close(); diff --git a/test/parallel/test-net-listen-error.js b/test/parallel/test-net-listen-error.js index b0d8aac8f816e3..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; @@ -10,7 +10,7 @@ server.listen(1, '1.1.1.1', function() { // EACCESS or EADDRNOTAVAIL assert(false); }); server.on('error', function(error) { - common.debug(error); + console.error(error); gotError = true; }); 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-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/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-pingpong.js b/test/parallel/test-net-pingpong.js index be7dfa435949b5..e27ae2f1819fa6 100644 --- a/test/parallel/test-net-pingpong.js +++ b/test/parallel/test-net-pingpong.js @@ -106,7 +106,7 @@ function pingPongTest(port, host) { } /* All are run at once, so run on different ports */ -console.log(common.PIPE); +common.refreshTmpDir(); pingPongTest(common.PIPE); pingPongTest(common.PORT); pingPongTest(common.PORT + 1, 'localhost'); diff --git a/test/parallel/test-net-pipe-connect-errors.js b/test/parallel/test-net-pipe-connect-errors.js index e2ec1debf12617..8e341015d96b3f 100644 --- a/test/parallel/test-net-pipe-connect-errors.js +++ b/test/parallel/test-net-pipe-connect-errors.js @@ -19,9 +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 - emptyTxt = common.PIPE + '.txt'; + common.refreshTmpDir(); + // 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 { @@ -41,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/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..76ed7b020fb89e 100644 --- a/test/parallel/test-net-settimeout.js +++ b/test/parallel/test-net-settimeout.js @@ -2,36 +2,28 @@ // 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(function(c) { c.write('hello'); }); server.listen(common.PORT); -var killers = [0]; +const socket = net.createConnection(common.PORT, 'localhost'); -var left = killers.length; -killers.forEach(function(killer) { - var socket = net.createConnection(common.PORT, 'localhost'); +const s = socket.setTimeout(T, function() { + common.fail('Socket timeout event is not expected to fire'); +}); +assert.ok(s instanceof net.Socket); - 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); +socket.setTimeout(0); - socket.setTimeout(killer); +setTimeout(function() { + socket.destroy(); + server.close(); +}, T * 2); - var timeout = setTimeout(function() { - socket.destroy(); - if (--left === 0) server.close(); - assert.ok(killer === 0); - }, T * 2); -}); 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..b7ed0ec344a996 100644 --- a/test/parallel/test-net-socket-timeout-unref.js +++ b/test/parallel/test-net-socket-timeout-unref.js @@ -11,15 +11,26 @@ server.listen(common.PORT); server.unref(); var timedout = false; +var connections = 0; +var sockets = []; +var delays = [8, 5, 3, 6, 2, 4]; -[8, 5, 3, 6, 2, 4].forEach(function(T) { +delays.forEach(function(T) { var socket = net.createConnection(common.PORT, 'localhost'); - socket.setTimeout(T * 1000, function() { - console.log(process._getActiveHandles()); - timedout = true; - socket.destroy(); + socket.on('connect', function() { + if (++connections === delays.length) { + sockets.forEach(function(s) { + s[0].setTimeout(s[1] * 1000, function() { + timedout = true; + s[0].destroy(); + }); + + s[0].unref(); + }); + } }); - socket.unref(); + + sockets.push([socket, T]); }); process.on('exit', function() { diff --git a/test/parallel/test-net-socket-timeout.js b/test/parallel/test-net-socket-timeout.js index 5ab11909b4c306..f15b20c023194f 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); }); 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-write-slow.js b/test/parallel/test-net-write-slow.js index 4b8163984f556a..8ded93ee71a8d3 100644 --- a/test/parallel/test-net-write-slow.js +++ b/test/parallel/test-net-write-slow.js @@ -14,7 +14,7 @@ var server = net.createServer(function(socket) { socket.setNoDelay(); socket.setTimeout(1000); socket.on('timeout', function() { - assert.fail('flushed: ' + flushed + + assert.fail(null, null, 'flushed: ' + flushed + ', received: ' + received + '/' + SIZE * N); }); diff --git a/test/parallel/test-next-tick-doesnt-hang.js b/test/parallel/test-next-tick-doesnt-hang.js index 5e63463d4d1f94..28797b4280e716 100644 --- a/test/parallel/test-next-tick-doesnt-hang.js +++ b/test/parallel/test-next-tick-doesnt-hang.js @@ -4,6 +4,7 @@ * does not hang the event loop. If this test times out it has failed. */ +require('../common'); process.nextTick(function() { // Nothing }); 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..fe13d6ed4dac93 100644 --- a/test/parallel/test-next-tick-errors.js +++ b/test/parallel/test-next-tick-errors.js @@ -1,9 +1,9 @@ '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. 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-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 e90fe217de93ec..f635f7f010012c 100644 --- a/test/parallel/test-path-parse-format.js +++ b/test/parallel/test-path-parse-format.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var path = require('path'); @@ -79,7 +80,7 @@ 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), @@ -88,7 +89,7 @@ function checkErrors(path) { return; } - assert.fail('should have thrown'); + assert.fail(null, null, 'should have thrown'); }); } diff --git a/test/parallel/test-path-zero-length-strings.js b/test/parallel/test-path-zero-length-strings.js index 083eb3e7ac03c6..07de030aa0b323 100644 --- a/test/parallel/test-path-zero-length-strings.js +++ b/test/parallel/test-path-zero-length-strings.js @@ -5,7 +5,7 @@ // 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(); diff --git a/test/parallel/test-path.js b/test/parallel/test-path.js index c13b8d4efd1540..e8c282053550cf 100644 --- a/test/parallel/test-path.js +++ b/test/parallel/test-path.js @@ -304,9 +304,10 @@ assert.equal(path.posix.normalize('a//b//./c'), 'a/b/c'); assert.equal(path.posix.normalize('a//b//.'), 'a/b'); // path.resolve tests +var resolveTests; if (common.isWindows) { // windows - var resolveTests = + 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'], @@ -322,7 +323,7 @@ if (common.isWindows) { ]; } else { // Posix - var resolveTests = + resolveTests = // arguments result [[['/var/lib', '../', 'file/'], '/var/file'], [['/var/lib', '/../', 'file/'], '/file'], @@ -330,7 +331,7 @@ if (common.isWindows) { [['.'], process.cwd()], [['/some/dir', '.', '/absolute/'], '/absolute']]; } -var failures = []; +failures = []; resolveTests.forEach(function(test) { var actual = path.resolve.apply(path, test[0]); var expected = test[1]; @@ -358,9 +359,10 @@ assert.equal(path.posix.isAbsolute('bar/'), false); assert.equal(path.posix.isAbsolute('./baz'), false); // path.relative tests +var relativeTests; if (common.isWindows) { // windows - var relativeTests = + relativeTests = // arguments result [['c:/blah\\blah', 'd:/games', 'd:\\games'], ['c:/aaaa/bbbb', 'c:/aaaa', '..'], @@ -372,7 +374,7 @@ if (common.isWindows) { ['c:/aaaa/bbbb', 'd:\\', 'd:\\']]; } else { // posix - var relativeTests = + relativeTests = // arguments result [['/var/lib', '/var', '..'], ['/var/lib', '/bin', '../../bin'], @@ -381,7 +383,7 @@ if (common.isWindows) { ['/var/', '/var/lib', 'lib'], ['/', '/var/lib', 'var/lib']]; } -var failures = []; +failures = []; relativeTests.forEach(function(test) { var actual = path.relative(test[0], test[1]); var expected = test[2]; diff --git a/test/parallel/test-pipe-file-to-http.js b/test/parallel/test-pipe-file-to-http.js index aac59d917c05ff..06c7d7997e179a 100644 --- a/test/parallel/test-pipe-file-to-http.js +++ b/test/parallel/test-pipe-file-to-http.js @@ -13,19 +13,15 @@ var clientReqComplete = false; var count = 0; var server = http.createServer(function(req, res) { - console.error('SERVER request'); var timeoutId; assert.equal('POST', req.method); req.pause(); - common.error('request paused'); setTimeout(function() { req.resume(); - common.error('request resumed'); }, 1000); req.on('data', function(chunk) { - common.error('recv data! nchars = ' + chunk.length); count += chunk.length; }); @@ -33,7 +29,6 @@ var server = http.createServer(function(req, res) { if (timeoutId) { clearTimeout(timeoutId); } - console.log('request complete from server'); res.writeHead(200, {'Content-Type': 'text/plain'}); res.end(); }); @@ -42,12 +37,9 @@ server.listen(common.PORT); server.on('listening', function() { var cmd = common.ddCommand(filename, 10240); - console.log('dd command: ', cmd); cp.exec(cmd, function(err, stdout, stderr) { if (err) throw err; - console.error('EXEC returned successfully stdout=%d stderr=%d', - stdout.length, stderr.length); makeRequest(); }); }); @@ -59,27 +51,16 @@ function makeRequest() { method: 'POST' }); - common.error('pipe!'); - var s = fs.ReadStream(filename); s.pipe(req); - s.on('data', function(chunk) { - console.error('FS data chunk=%d', chunk.length); - }); - s.on('end', function() { - console.error('FS end'); - }); s.on('close', function(err) { if (err) throw err; clientReqComplete = true; - common.error('client finished sending request'); }); req.on('response', function(res) { - console.error('RESPONSE', res.statusCode, res.headers); res.resume(); res.on('end', function() { - console.error('RESPONSE end'); server.close(); }); }); 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/parallel/test-preload.js b/test/parallel/test-preload.js index b4a3af78d8df3b..f94a7eae942493 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'); +require('../common'); +const assert = require('assert'); +const path = require('path'); +const child_process = require('child_process'); var nodeBinary = process.argv[0]; @@ -82,7 +82,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-argv-0.js b/test/parallel/test-process-argv-0.js index fb6df310e14661..3299ec74ea7dd4 100644 --- a/test/parallel/test-process-argv-0.js +++ b/test/parallel/test-process-argv-0.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var path = require('path'); var assert = require('assert'); var spawn = require('child_process').spawn; 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 dad2816d40c185..722e9333aff60a 100644 --- a/test/parallel/test-process-binding.js +++ b/test/parallel/test-process-binding.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); assert.throws( @@ -11,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-chdir.js b/test/parallel/test-process-chdir.js new file mode 100644 index 00000000000000..abf06b3c523cb4 --- /dev/null +++ b/test/parallel/test-process-chdir.js @@ -0,0 +1,36 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); + +assert.notStrictEqual(process.cwd(), __dirname); +process.chdir(__dirname); +assert.strictEqual(process.cwd(), __dirname); + +let dirName; +if (process.versions.icu) { + // ICU is available, use characters that could possibly be decomposed + dirName = 'weird \uc3a4\uc3ab\uc3af characters \u00e1\u00e2\u00e3'; +} else { + // ICU is unavailable, use characters that can't be decomposed + dirName = 'weird \ud83d\udc04 characters \ud83d\udc05'; +} +const dir = path.resolve(common.tmpDir, dirName); + +// Make sure that the tmp directory is clean +common.refreshTmpDir(); + +fs.mkdirSync(dir); +process.chdir(dir); +assert.strictEqual(process.cwd().normalize(), dir.normalize()); + +process.chdir('..'); +assert.strictEqual(process.cwd().normalize(), + path.resolve(common.tmpDir).normalize()); + +assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.'); +assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.'); +assert.throws(function() { process.chdir('x', 'y'); }, + TypeError, 'Bad argument.'); 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-exec-argv.js b/test/parallel/test-process-exec-argv.js index 59c4264ee3c8b7..c2b663ac67eb60 100644 --- a/test/parallel/test-process-exec-argv.js +++ b/test/parallel/test-process-exec-argv.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; 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-recursive.js b/test/parallel/test-process-exit-recursive.js index c1ee13370b26ca..53426a6b1cdaf0 100644 --- a/test/parallel/test-process-exit-recursive.js +++ b/test/parallel/test-process-exit-recursive.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); // recursively calling .exit() should not overflow the call stack 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-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..ad186a3507d1e7 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 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-release.js b/test/parallel/test-process-release.js new file mode 100644 index 00000000000000..aac7009f2e90b8 --- /dev/null +++ b/test/parallel/test-process-release.js @@ -0,0 +1,14 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const versionParts = process.versions.node.split('.'); + +assert.equal(process.release.name, 'node'); + +// it's expected that future LTS release lines will have additional +// branches in here +if (versionParts[0] === '4' && versionParts[1] >= 2) { + assert.equal(process.release.lts, 'Argon'); +} else { + assert.strictEqual(process.release.lts, undefined); +} diff --git a/test/parallel/test-process-versions.js b/test/parallel/test-process-versions.js index 637ada7fa8e349..900143d17ce972 100644 --- a/test/parallel/test-process-versions.js +++ b/test/parallel/test-process-versions.js @@ -9,4 +9,8 @@ if (common.hasCrypto) { expected_keys.push('openssl'); } +if (typeof Intl !== 'undefined') { + expected_keys.push('icu'); +} + assert.deepEqual(Object.keys(process.versions).sort(), expected_keys.sort()); 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-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..b4388852499ed1 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 @@ -148,29 +148,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 +185,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, 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 5880d022502711..5e9842acb00084 100644 --- a/test/parallel/test-readline-interface.js +++ b/test/parallel/test-readline-interface.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var readline = require('readline'); var EventEmitter = require('events').EventEmitter; @@ -258,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(); @@ -295,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 150273f7993963..e026c0b583cd9e 100644 --- a/test/parallel/test-readline-keys.js +++ b/test/parallel/test-readline-keys.js @@ -1,5 +1,5 @@ 'use strict'; -var EventEmitter = require('events').EventEmitter; +require('../common'); var PassThrough = require('stream').PassThrough; var assert = require('assert'); var inherits = require('util').inherits; @@ -15,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-set-raw-mode.js b/test/parallel/test-readline-set-raw-mode.js index f9d5111581fa90..7810dfeda839d5 100644 --- a/test/parallel/test-readline-set-raw-mode.js +++ b/test/parallel/test-readline-set-raw-mode.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var readline = require('readline'); var Stream = require('stream'); diff --git a/test/parallel/test-readline-undefined-columns.js b/test/parallel/test-readline-undefined-columns.js new file mode 100644 index 00000000000000..24f138f46bce11 --- /dev/null +++ b/test/parallel/test-readline-undefined-columns.js @@ -0,0 +1,37 @@ +'use strict'; + +require('../common'); +const assert = require('assert'); +const PassThrough = require('stream').PassThrough; +const readline = require('readline'); + +// Checks that tab completion still works +// when output column size is undefined + +const iStream = new PassThrough(); +const oStream = new PassThrough(); + +readline.createInterface({ + terminal: true, + input: iStream, + output: oStream, + completer: function(line, cb) { + cb(null, [['process.stdout', 'process.stdin', 'process.stderr'], line]); + } +}); + +var output = ''; + +oStream.on('data', function(data) { + output += data; +}); + +oStream.on('end', function() { + const expect = 'process.stdout\r\n' + + 'process.stdin\r\n' + + 'process.stderr'; + assert(new RegExp(expect).test(output)); +}); + +iStream.write('process.std\t'); +oStream.end(); 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/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/parallel/test-regress-GH-4256.js b/test/parallel/test-regress-GH-4256.js index f512e613162522..a312fb277fdad5 100644 --- a/test/parallel/test-regress-GH-4256.js +++ b/test/parallel/test-regress-GH-4256.js @@ -1,5 +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/parallel/test-regress-GH-5927.js b/test/parallel/test-regress-GH-5927.js index 541820c7a214c8..a23c947c320cfc 100644 --- a/test/parallel/test-regress-GH-5927.js +++ b/test/parallel/test-regress-GH-5927.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var readline = require('readline'); 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/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-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-regress-GH-io-1068.js b/test/parallel/test-regress-GH-io-1068.js index cc91fe28df3d3e..a92bb3e75259f0 100644 --- a/test/parallel/test-regress-GH-io-1068.js +++ b/test/parallel/test-regress-GH-io-1068.js @@ -1,2 +1,3 @@ 'use strict'; +require('../common'); process.stdin.emit('end'); diff --git a/test/parallel/test-regress-GH-io-1811.js b/test/parallel/test-regress-GH-io-1811.js index b7c99a17a5cdd5..bfbf99243320d4 100644 --- a/test/parallel/test-regress-GH-io-1811.js +++ b/test/parallel/test-regress-GH-io-1811.js @@ -1,5 +1,6 @@ 'use strict'; +require('../common'); const assert = require('assert'); // Change kMaxLength for zlib to trigger the error without having to allocate diff --git a/test/parallel/test-regress-GH-node-9326.js b/test/parallel/test-regress-GH-node-9326.js index 5dc73e044e560b..bb55050d2ce55e 100644 --- a/test/parallel/test-regress-GH-node-9326.js +++ b/test/parallel/test-regress-GH-node-9326.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var child_process = require('child_process'); diff --git a/test/parallel/test-regression-object-prototype.js b/test/parallel/test-regression-object-prototype.js index 040e718948a581..b1411bf813687a 100644 --- a/test/parallel/test-regression-object-prototype.js +++ b/test/parallel/test-regression-object-prototype.js @@ -1,5 +1,5 @@ +/* eslint-disable required-modules */ 'use strict'; -//console.log('puts before'); Object.prototype.xadsadsdasasdxx = function() { }; 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 4103a19243aec5..15f779d3b12269 100644 --- a/test/parallel/test-repl-autolibs.js +++ b/test/parallel/test-repl-autolibs.js @@ -1,25 +1,14 @@ '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 new file mode 100644 index 00000000000000..759b4e15a12f46 --- /dev/null +++ b/test/parallel/test-repl-envvars.js @@ -0,0 +1,57 @@ +'use strict'; + +// Flags: --expose-internals + +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 } + } +]; + +function run(test) { + const env = test.env; + const expected = test.expected; + const opts = { + terminal: true, + input: new stream.Readable({ read() {} }), + output: new stream.Writable({ write() {} }) + }; + + REPL.createInternalRepl(env, opts, function(err, repl) { + if (err) throw err; + assert.equal(expected.terminal, repl.terminal, + 'Expected ' + inspect(expected) + ' with ' + inspect(env)); + assert.equal(expected.useColors, repl.useColors, + 'Expected ' + inspect(expected) + ' with ' + inspect(env)); + repl.close(); + }); +} + +tests.forEach(run); 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-options.js b/test/parallel/test-repl-options.js index 5bc37d2d7117f3..395cd3e3675635 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({ 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 e6157956d43a65..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({ @@ -45,7 +42,7 @@ function testResetGlobal(cb) { } var timeout = setTimeout(function() { - assert.fail('Timeout, REPL did not emit reset events'); + assert.fail(null, null, 'Timeout, REPL did not emit reset events'); }, 5000); testReset(function() { diff --git a/test/parallel/test-repl-setprompt.js b/test/parallel/test-repl-setprompt.js index b89dd6c928ab0a..2708a3e6af5448 100644 --- a/test/parallel/test-repl-setprompt.js +++ b/test/parallel/test-repl-setprompt.js @@ -1,9 +1,8 @@ 'use strict'; -var common = require('../common'), - assert = require('assert'), - spawn = require('child_process').spawn, - os = require('os'), - util = require('util'); +require('../common'); +const assert = require('assert'); +const spawn = require('child_process').spawn; +const os = require('os'); var args = [ '-e', @@ -19,7 +18,7 @@ child.stdout.setEncoding('utf8'); var data = ''; child.stdout.on('data', function(d) { data += d; }); -child.stdin.end(util.format("e.setPrompt('%s');%s", p, os.EOL)); +child.stdin.end(`e.setPrompt("${p}");${os.EOL}`); child.on('close', function(code, signal) { assert.strictEqual(code, 0); 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 60fb48bb7613a0..86a0444c953d27 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 @@ -265,9 +249,13 @@ var array_elements = [ [ 'ary.valueOf', '', 'ary.concat', + 'ary.copyWithin', 'ary.entries', 'ary.every', + 'ary.fill', 'ary.filter', + 'ary.find', + 'ary.findIndex', 'ary.forEach', 'ary.indexOf', 'ary.join', diff --git a/test/parallel/test-repl-tab.js b/test/parallel/test-repl-tab.js index badab2133b7e7e..6474d8e4088167 100644 --- a/test/parallel/test-repl-tab.js +++ b/test/parallel/test-repl-tab.js @@ -1,6 +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 ac890cf75844db..5a13597e56966e 100644 --- a/test/parallel/test-repl.js +++ b/test/parallel/test-repl.js @@ -3,18 +3,19 @@ var common = require('../common'); 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, timer; // absolute path to test/fixtures/a.js @@ -242,6 +243,45 @@ function error_test() { 'RegExp.$6\nRegExp.$7\nRegExp.$8\nRegExp.$9\n', expect: ['\'1\'\n', '\'2\'\n', '\'3\'\n', '\'4\'\n', '\'5\'\n', '\'6\'\n', '\'7\'\n', '\'8\'\n', '\'9\'\n'].join(`${prompt_unix}`) }, + // regression tests for https://github.com/nodejs/node/issues/2749 + { client: client_unix, send: 'function x() {\nreturn \'\\n\';\n }', + expect: prompt_multiline + prompt_multiline + + 'undefined\n' + prompt_unix }, + { 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'/ }, ]); } @@ -381,5 +421,5 @@ function unix_test() { unix_test(); timer = setTimeout(function() { - assert.fail('Timeout'); + 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-json.js b/test/parallel/test-require-json.js index 4c17fc8d025d73..bcb7f6ab7f3ef8 100644 --- a/test/parallel/test-require-json.js +++ b/test/parallel/test-require-json.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); try { 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/parallel/test-require-process.js b/test/parallel/test-require-process.js index fdd921a61195e5..33634930b4e614 100644 --- a/test/parallel/test-require-process.js +++ b/test/parallel/test-require-process.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var nativeProcess = require('process'); 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/parallel/test-spawn-cmd-named-pipe.js b/test/parallel/test-spawn-cmd-named-pipe.js new file mode 100644 index 00000000000000..5371577e6c458c --- /dev/null +++ b/test/parallel/test-spawn-cmd-named-pipe.js @@ -0,0 +1,58 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); + +// This test is intended for Windows only +if (!common.isWindows) { + console.log('1..0 # Skipped: this test is Windows-specific.'); + return; +} + +if (!process.argv[2]) { + // parent + const net = require('net'); + const spawn = require('child_process').spawn; + const path = require('path'); + + const pipeNamePrefix = path.basename(__filename) + '.' + process.pid; + const stdinPipeName = '\\\\.\\pipe\\' + pipeNamePrefix + '.stdin'; + const stdoutPipeName = '\\\\.\\pipe\\' + pipeNamePrefix + '.stdout'; + + const stdinPipeServer = net.createServer(function(c) { + c.on('end', common.mustCall(function() { + })); + c.end('hello'); + }); + stdinPipeServer.listen(stdinPipeName); + + const output = []; + + const stdoutPipeServer = net.createServer(function(c) { + c.on('data', function(x) { + output.push(x); + }); + c.on('end', common.mustCall(function() { + assert.strictEqual(output.join(''), 'hello'); + })); + }); + stdoutPipeServer.listen(stdoutPipeName); + + const comspec = process.env['comspec']; + if (!comspec || comspec.length === 0) { + assert.fail(null, null, 'Failed to get COMSPEC'); + } + + const args = ['/c', process.execPath, __filename, 'child', + '<', stdinPipeName, '>', stdoutPipeName]; + + const child = spawn(comspec, args); + + child.on('exit', common.mustCall(function(exitCode) { + stdinPipeServer.close(); + stdoutPipeServer.close(); + assert.strictEqual(exitCode, 0); + })); +} else { + // child + process.stdin.pipe(process.stdout); +} 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-pause-resume-sync.js b/test/parallel/test-stdin-pause-resume-sync.js index 4fe4d445a2443e..c0f41e92de5adb 100644 --- a/test/parallel/test-stdin-pause-resume-sync.js +++ b/test/parallel/test-stdin-pause-resume-sync.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); console.error('before opening stdin'); process.stdin.resume(); console.error('stdin opened'); diff --git a/test/parallel/test-stdin-pause-resume.js b/test/parallel/test-stdin-pause-resume.js index 2685deb0e9b33c..a07bf1327d2774 100644 --- a/test/parallel/test-stdin-pause-resume.js +++ b/test/parallel/test-stdin-pause-resume.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); console.error('before opening stdin'); process.stdin.resume(); console.error('stdin opened'); diff --git a/test/parallel/test-stdin-resume-pause.js b/test/parallel/test-stdin-resume-pause.js index 963fd989f085a3..25bd3d7a2eaf51 100644 --- a/test/parallel/test-stdin-resume-pause.js +++ b/test/parallel/test-stdin-resume-pause.js @@ -1,3 +1,4 @@ 'use strict'; +require('../common'); process.stdin.resume(); process.stdin.pause(); 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/parallel/test-stdout-close-unref.js b/test/parallel/test-stdout-close-unref.js index 12a031562bf6f0..37ab4987eebcaa 100644 --- a/test/parallel/test-stdout-close-unref.js +++ b/test/parallel/test-stdout-close-unref.js @@ -1,6 +1,6 @@ 'use strict'; +require('../common'); var assert = require('assert'); -var common = require('../common'); var errs = 0; 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-cleanup-pause.js b/test/parallel/test-stream-pipe-cleanup-pause.js new file mode 100644 index 00000000000000..332930c813a3dd --- /dev/null +++ b/test/parallel/test-stream-pipe-cleanup-pause.js @@ -0,0 +1,37 @@ +'use strict'; +const common = require('../common'); +const stream = require('stream'); + +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/2323 +const buffer = new Buffer(560000); + +reader._read = function(n) {}; + +writer1._write = common.mustCall(function(chunk, encoding, cb) { + this.emit('chunk-received'); + cb(); +}, 1); +writer1.once('chunk-received', function() { + reader.unpipe(writer1); + reader.pipe(writer2); + reader.push(buffer); + setImmediate(function() { + reader.push(buffer); + setImmediate(function() { + reader.push(buffer); + }); + }); +}); + +writer2._write = common.mustCall(function(chunk, encoding, cb) { + cb(); +}, 3); + +reader.pipe(writer1); +reader.push(buffer); 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 new file mode 100644 index 00000000000000..872be6d7be5ce8 --- /dev/null +++ b/test/parallel/test-stream-pipe-without-listenerCount.js @@ -0,0 +1,19 @@ +'use strict'; +const common = require('../common'); +const stream = require('stream'); + +const r = new stream.Stream(); +r.listenerCount = undefined; + +const w = new stream.Stream(); +w.listenerCount = undefined; + +w.on('pipe', function() { + r.emit('error', new Error('Readable Error')); + w.emit('error', new Error('Writable Error')); +}); +r.on('error', common.mustCall(noop)); +w.on('error', common.mustCall(noop)); +r.pipe(w); + +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..2aa992b4a9a785 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); }; @@ -46,24 +44,24 @@ function test(decode, uncork, multi, next) { }; 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' } - ]; + [ + { 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 e50ea5a0cc1370..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) { @@ -33,5 +33,5 @@ src.on('end', function() { src.pipe(dst); timeout = setTimeout(function() { - assert.fail('timed out waiting for _write'); + assert.fail(null, null, 'timed out waiting for _write'); }, 100); diff --git a/test/parallel/test-stream2-compatibility.js b/test/parallel/test-stream2-compatibility.js index 9eab7b713bf167..1ee47c03cf0e01 100644 --- a/test/parallel/test-stream2-compatibility.js +++ b/test/parallel/test-stream2-compatibility.js @@ -1,10 +1,9 @@ 'use strict'; -var common = require('../common'); +require('../common'); var R = require('_stream_readable'); var assert = require('assert'); var util = require('util'); -var EE = require('events').EventEmitter; var ondataCalled = 0; @@ -25,7 +24,7 @@ TestReader.prototype._read = function(n) { this._buffer = new Buffer(0); }; -var reader = new TestReader(); +new TestReader(); setImmediate(function() { assert.equal(ondataCalled, 1); console.log('ok'); 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/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 f931c6abb9864c..a064250dcdd39f 100644 --- a/test/parallel/test-string-decoder-end.js +++ b/test/parallel/test-string-decoder-end.js @@ -3,6 +3,7 @@ // the whole buffer at once, and that both match the .toString(enc) // result of the entire buffer. +require('../common'); var assert = require('assert'); var SD = require('string_decoder').StringDecoder; var encodings = ['base64', 'hex', 'utf8', 'utf16le', 'ucs2']; @@ -42,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 new file mode 100644 index 00000000000000..5467d05a20104a --- /dev/null +++ b/test/parallel/test-stringbytes-external-at-max.js @@ -0,0 +1,32 @@ +'use strict'; +// Flags: --expose-gc + +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; + +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'); + +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.js b/test/parallel/test-stringbytes-external.js index 231ab4f2031ca2..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,9 +39,8 @@ 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++) { - assert.equal(c_bin[i], c_ucs[i], c_bin[i] + ' == ' + c_ucs[i] + - ' : index ' + i); +for (let i = 0; i < c_bin.length; i++) { + assert.equal(c_bin[i], c_ucs[i]); } // check resultant strings assert.equal(c_bin.toString('ucs2'), c_ucs.toString('ucs2')); @@ -63,19 +62,14 @@ var PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; var pumped_string2 = slice2.toString('hex'); var decoded = new Buffer(pumped_string, 'hex'); - var metadata = '\nEXTERN_APEX=1031913 - pumped_string.length='; - metadata += pumped_string.length + '\n'; - // the string are the same? for (var k = 0; k < pumped_string.length; ++k) { - assert.equal(pumped_string[k], pumped_string2[k], - metadata + 'chars should be the same at ' + k); + assert.equal(pumped_string[k], pumped_string2[k]); } // the recoded buffer is the same? for (var i = 0; i < decoded.length; ++i) { - assert.equal(datum[i], decoded[i], - metadata + 'bytes should be the same at ' + i); + assert.equal(datum[i], decoded[i]); } } })(); @@ -89,20 +83,14 @@ var PRE_3OF4_APEX = Math.ceil((EXTERN_APEX / 4) * 3) - RADIOS; var pumped_string2 = slice2.toString('base64'); var decoded = new Buffer(pumped_string, 'base64'); - var metadata = '\nEXTERN_APEX=1031913 - data=" + slice.length'; - metadata += ' pumped_string.length=' + pumped_string.length + '\n'; - // the string are the same? for (var k = 0; k < pumped_string.length - 3; ++k) { - assert.equal(pumped_string[k], pumped_string2[k], - metadata + 'chars should be the same for two slices at ' - + k + ' ' + pumped_string[k] + ' ' + pumped_string2[k]); + assert.equal(pumped_string[k], pumped_string2[k]); } // the recoded buffer is the same? for (var i = 0; i < decoded.length; ++i) { - assert.equal(datum[i], decoded[i], - metadata + 'bytes should be the same at ' + i); + assert.equal(datum[i], decoded[i]); } } })(); diff --git a/test/parallel/test-sync-io-option.js b/test/parallel/test-sync-io-option.js index bb779a0aa66391..d005a3fb69868c 100644 --- a/test/parallel/test-sync-io-option.js +++ b/test/parallel/test-sync-io-option.js @@ -1,5 +1,6 @@ 'use strict'; +require('../common'); const assert = require('assert'); const execFile = require('child_process').execFile; diff --git a/test/parallel/test-sys.js b/test/parallel/test-sys.js index 9367e55c687f2f..add692d7367f8c 100644 --- a/test/parallel/test-sys.js +++ b/test/parallel/test-sys.js @@ -1,109 +1,7 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); +var sys = require('sys'); +var util = require('util'); -assert.equal('0', common.inspect(0)); -assert.equal('1', common.inspect(1)); -assert.equal('false', common.inspect(false)); -assert.equal("''", common.inspect('')); -assert.equal("'hello'", common.inspect('hello')); -assert.equal('[Function]', common.inspect(function() {})); -assert.equal('undefined', common.inspect(undefined)); -assert.equal('null', common.inspect(null)); -assert.equal('/foo(bar\\n)?/gi', common.inspect(/foo(bar\n)?/gi)); -assert.equal(new Date('2010-02-14T12:48:40+01:00').toString(), - common.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT'))); - -assert.equal("'\\n\\u0001'", common.inspect('\n\u0001')); - -assert.equal('[]', common.inspect([])); -assert.equal('Array {}', common.inspect(Object.create([]))); -assert.equal('[ 1, 2 ]', common.inspect([1, 2])); -assert.equal('[ 1, [ 2, 3 ] ]', common.inspect([1, [2, 3]])); - -assert.equal('{}', common.inspect({})); -assert.equal('{ a: 1 }', common.inspect({a: 1})); -assert.equal('{ a: [Function] }', common.inspect({a: function() {}})); -assert.equal('{ a: 1, b: 2 }', common.inspect({a: 1, b: 2})); -assert.equal('{ a: {} }', common.inspect({'a': {}})); -assert.equal('{ a: { b: 2 } }', common.inspect({'a': {'b': 2}})); -assert.equal('{ a: { b: { c: [Object] } } }', - common.inspect({'a': {'b': { 'c': { 'd': 2 }}}})); -assert.equal('{ a: { b: { c: { d: 2 } } } }', - common.inspect({'a': {'b': { 'c': { 'd': 2 }}}}, false, null)); -assert.equal('[ 1, 2, 3, [length]: 3 ]', common.inspect([1, 2, 3], true)); -assert.equal('{ a: [Object] }', - common.inspect({'a': {'b': { 'c': 2}}}, false, 0)); -assert.equal('{ a: { b: [Object] } }', - common.inspect({'a': {'b': { 'c': 2}}}, false, 1)); -assert.equal('{ visible: 1 }', - common.inspect(Object.create({}, - {visible: {value: 1, enumerable: true}, hidden: {value: 2}})) -); - -// Due to the hash seed randomization it's not deterministic the order that -// the following ways this hash is displayed. -// See http://codereview.chromium.org/9124004/ - -var out = common.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 = common.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('{ name: \'Tim\' }', - common.inspect(Object.create(null, - {name: {value: 'Tim', enumerable: true}, - hidden: {value: 'secret'}})) -); - - -// Dynamic properties -assert.equal('{ readonly: [Getter] }', - common.inspect({get readonly() {}})); - -assert.equal('{ readwrite: [Getter/Setter] }', - common.inspect({get readwrite() {}, set readwrite(val) {}})); - -assert.equal('{ writeonly: [Setter] }', - common.inspect({set writeonly(val) {}})); - -var value = {}; -value['a'] = value; -assert.equal('{ a: [Circular] }', common.inspect(value)); - -// Array with dynamic properties -value = [1, 2, 3]; -value.__defineGetter__('growingLength', function() { - this.push(true); return this.length; -}); -assert.equal('[ 1, 2, 3, growingLength: [Getter] ]', common.inspect(value)); - -// Function with properties -value = function() {}; -value.aprop = 42; -assert.equal('{ [Function] aprop: 42 }', common.inspect(value)); - -// Regular expressions with properties -value = /123/ig; -value.aprop = 42; -assert.equal('{ /123/gi aprop: 42 }', common.inspect(value)); - -// Dates with properties -value = new Date('Sun, 14 Feb 2010 11:48:40 GMT'); -value.aprop = 42; -assert.equal('{ Sun, 14 Feb 2010 11:48:40 GMT aprop: 42 }', - common.inspect(value) -); +assert.strictEqual(sys, util); diff --git a/test/parallel/test-tick-processor.js b/test/parallel/test-tick-processor.js index ebcda79d679d55..b22e2ec14a3c6e 100644 --- a/test/parallel/test-tick-processor.js +++ b/test/parallel/test-tick-processor.js @@ -1,45 +1,60 @@ 'use strict'; var fs = require('fs'); var assert = require('assert'); -var path = require('path'); var cp = require('child_process'); var common = require('../common'); -common.refreshTmpDir(); +// 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); -cp.execFileSync(process.execPath, ['-prof', '-pe', - 'function foo(n) {' + - 'require(\'vm\').runInDebugContext(\'Debug\');' + - 'return n < 2 ? n : setImmediate(function() { foo(n-1) + foo(n-2);}); };' + - 'setTimeout(function() { process.exit(0); }, 2000);' + - 'foo(40);']); -var matches = fs.readdirSync(common.tmpDir).filter(function(file) { - return /^isolate-/.test(file); -}); -if (matches.length != 1) { - assert.fail('There should be a single log file.'); -} -var log = matches[0]; -var processor = - path.join(common.testDir, '..', 'tools', 'v8-prof', getScriptName()); -var out = cp.execSync(processor + ' ' + log, {encoding: 'utf8'}); -assert(out.match(/LazyCompile.*foo/)); -if (process.platform === 'win32' || - process.platform === 'sunos' || - process.platform === 'freebsd') { +// 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/, + `function f() { + for (var i = 0; i < 1000000; i++) { + i++; + } + setImmediate(function() { f(); }); + }; + setTimeout(function() { process.exit(0); }, 2000); + f();`); +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; } -assert(out.match(/RunInDebugContext/)); +runTest(/RunInDebugContext/, + `function f() { + require(\'vm\').runInDebugContext(\'Debug\'); + setImmediate(function() { f(); }); + }; + setTimeout(function() { process.exit(0); }, 2000); + f();`); -function getScriptName() { - switch (process.platform) { - case 'darwin': - return 'mac-tick-processor'; - case 'win32': - return 'windows-tick-processor.bat'; - default: - return 'linux-tick-processor'; +function runTest(pattern, code) { + cp.execFileSync(process.execPath, ['-prof', '-pe', code]); + var matches = fs.readdirSync(common.tmpDir).filter(function(file) { + return /^isolate-/.test(file); + }); + if (matches.length != 1) { + assert.fail(null, null, 'There should be a single log file.'); } + var log = matches[0]; + var out = cp.execSync(process.execPath + + ' --prof-process --call-graph-size=10 ' + log, + {encoding: 'utf8'}); + assert(pattern.test(out)); + fs.unlinkSync(log); } diff --git a/test/parallel/test-timer-close.js b/test/parallel/test-timer-close.js index 79f06dffa98731..9eb70041eb4b97 100644 --- a/test/parallel/test-timer-close.js +++ b/test/parallel/test-timer-close.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var t = new (process.binding('timer_wrap').Timer); diff --git a/test/parallel/test-timers-active.js b/test/parallel/test-timers-active.js new file mode 100644 index 00000000000000..d8faa1f5a33483 --- /dev/null +++ b/test/parallel/test-timers-active.js @@ -0,0 +1,34 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const active = require('timers').active; + +// active() should create timers for these +var legitTimers = [ + { _idleTimeout: 0 }, + { _idleTimeout: 1 } +]; + +legitTimers.forEach(function(legit) { + const savedTimeout = legit._idleTimeout; + active(legit); + // active() should mutate these objects + assert(legit._idleTimeout === savedTimeout); + assert(Number.isInteger(legit._idleStart)); + assert(legit._idleNext); + assert(legit._idlePrev); +}); + + +// active() should not create a timer for these +var bogusTimers = [ + { _idleTimeout: -1 }, + { _idleTimeout: undefined }, +]; + +bogusTimers.forEach(function(bogus) { + const savedTimeout = bogus._idleTimeout; + active(bogus); + // active() should not mutate these objects + assert.deepStrictEqual(bogus, {_idleTimeout: savedTimeout}); +}); 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..40e91a099815b6 100644 --- a/test/parallel/test-timers-immediate.js +++ b/test/parallel/test-timers-immediate.js @@ -1,16 +1,16 @@ '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 = []; +let before; setImmediate(function() { try { immediateA = process.hrtime(before); - } catch(e) { + } catch (e) { console.log('failed to get hrtime with offset'); } clearImmediate(immediateB); diff --git a/test/parallel/test-timers-linked-list.js b/test/parallel/test-timers-linked-list.js index 00b2129d126c4a..cc81e8721f13e2 100644 --- a/test/parallel/test-timers-linked-list.js +++ b/test/parallel/test-timers-linked-list.js @@ -1,8 +1,7 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var L = require('_linklist'); - +require('../common'); +const assert = require('assert'); +const L = require('_linklist'); var list = { name: 'list' }; var A = { name: 'A' }; diff --git a/test/parallel/test-timers-non-integer-delay.js b/test/parallel/test-timers-non-integer-delay.js index a3e5420a5e4858..b42053db3b1895 100644 --- a/test/parallel/test-timers-non-integer-delay.js +++ b/test/parallel/test-timers-non-integer-delay.js @@ -15,7 +15,7 @@ * it 100%. */ -var assert = require('assert'); +require('../common'); 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..f72530b5423886 --- /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(); + } + + 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 new file mode 100644 index 00000000000000..a26b548385e5f6 --- /dev/null +++ b/test/parallel/test-timers-socket-timeout-removes-other-socket-unref-timer.js @@ -0,0 +1,49 @@ +'use strict'; + +/* + * This test is a regression test for joyent/node#8897. + */ + +const common = require('../common'); +const net = require('net'); + +const clients = []; + +const server = net.createServer(function onClient(client) { + clients.push(client); + + if (clients.length === 2) { + /* + * Enroll two timers, and make the one supposed to fire first + * unenroll the other one supposed to fire later. This mutates + * the list of unref timers when traversing it, and exposes the + * original issue in joyent/node#8897. + */ + clients[0].setTimeout(1, function onTimeout() { + clients[1].setTimeout(0); + clients[0].end(); + clients[1].end(); + }); + + // Use a delay that is higher than the lowest timer resolution accross all + // supported platforms, so that the two timers don't fire at the same time. + clients[1].setTimeout(50); + } +}); + +server.listen(common.PORT, common.localhostIPv4, function() { + var nbClientsEnded = 0; + + function addEndedClient(client) { + ++nbClientsEnded; + if (nbClientsEnded === 2) { + server.close(); + } + } + + const client1 = net.connect({ port: common.PORT }); + client1.on('end', addEndedClient); + + const client2 = net.connect({ port: common.PORT }); + client2.on('end', addEndedClient); +}); diff --git a/test/parallel/test-timers-this.js b/test/parallel/test-timers-this.js index df710b9cb8d5c9..e21167581e8944 100644 --- a/test/parallel/test-timers-this.js +++ b/test/parallel/test-timers-this.js @@ -1,8 +1,9 @@ 'use strict'; +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 new file mode 100644 index 00000000000000..ac22cd6e6a7144 --- /dev/null +++ b/test/parallel/test-timers-unref-active-unenrolled-disposed.js @@ -0,0 +1,46 @@ +'use strict'; + +// https://github.com/nodejs/node/pull/2540/files#r38231197 + +const common = require('../common'); +const timers = require('timers'); +const assert = require('assert'); +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 keepOpen = setTimeout(function() { + throw new Error('Test timed out. keepOpen was not canceled.'); +}, TEST_DURATION); + +const endTest = makeTimer(2); + +const someTimer = makeTimer(1); +someTimer.domain = domain.create(); +someTimer.domain.dispose(); +someTimer._onTimeout = function() { + throw new Error('someTimer was not supposed to fire!'); +}; + +endTest._onTimeout = common.mustCall(function() { + assert.strictEqual(someTimer._idlePrev, null); + assert.strictEqual(someTimer._idleNext, null); + clearTimeout(keepOpen); +}); + +const cancelsTimer = makeTimer(1); +cancelsTimer._onTimeout = common.mustCall(function() { + someTimer._idleTimeout = 0; +}); + +timers._unrefActive(cancelsTimer); +timers._unrefActive(someTimer); +timers._unrefActive(endTest); + +function makeTimer(msecs) { + const timer = {}; + timers.unenroll(timer); + timers.enroll(timer, msecs); + return timer; +} diff --git a/test/parallel/test-timers-unref-active.js b/test/parallel/test-timers-unref-active.js new file mode 100644 index 00000000000000..ad72ac4047747b --- /dev/null +++ b/test/parallel/test-timers-unref-active.js @@ -0,0 +1,51 @@ +'use strict'; + +/* + * This test is aimed at making sure that unref timers queued with + * timers._unrefActive work correctly. + * + * Basically, it queues one timer in the unref queue, and then queues + * it again each time its timeout callback is fired until the callback + * has been called ten times. + * + * At that point, it unenrolls the unref timer so that its timeout callback + * is not fired ever again. + * + * Finally, a ref timeout is used with a delay large enough to make sure that + * all 10 timeouts had the time to expire. + */ + +require('../common'); +const timers = require('timers'); +const assert = require('assert'); + +var someObject = {}; +var nbTimeouts = 0; + +/* + * libuv 0.10.x uses GetTickCount on Windows to implement timers, which uses + * system's timers whose resolution is between 10 and 16ms. See + * http://msdn.microsoft.com/en-us/library/windows/desktop/ms724408.aspx + * for more information. That's the lowest resolution for timers across all + * supported platforms. We're using it as the lowest common denominator, + * and thus expect 5 timers to be able to fire in under 100 ms. + */ +const N = 5; +const TEST_DURATION = 100; + +timers.unenroll(someObject); +timers.enroll(someObject, 1); + +someObject._onTimeout = function _onTimeout() { + ++nbTimeouts; + + if (nbTimeouts === N) timers.unenroll(someObject); + + timers._unrefActive(someObject); +}; + +timers._unrefActive(someObject); + +setTimeout(function() { + assert.equal(nbTimeouts, N); +}, TEST_DURATION); 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-leak.js b/test/parallel/test-timers-unref-leak.js index 55907d9bc4898d..a1b1265763bf1d 100644 --- a/test/parallel/test-timers-unref-leak.js +++ b/test/parallel/test-timers-unref-leak.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var called = 0; 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 new file mode 100644 index 00000000000000..971c485a4cf986 --- /dev/null +++ b/test/parallel/test-timers-unref-remove-other-unref-timers-only-one-fires.js @@ -0,0 +1,41 @@ +'use strict'; + +/* + * The goal of this test is to make sure that, after the regression introduced + * by 934bfe23a16556d05bfb1844ef4d53e8c9887c3d, the fix preserves the following + * behavior of unref timers: if two timers are scheduled to fire at the same + * time, if one unenrolls the other one in its _onTimeout callback, the other + * one will *not* fire. + * + * This behavior is a private implementation detail and should not be + * considered public interface. + */ +require('../common'); +const timers = require('timers'); +const assert = require('assert'); + +var nbTimersFired = 0; + +const foo = { + _onTimeout: function() { + ++nbTimersFired; + timers.unenroll(bar); + } +}; + +const bar = { + _onTimeout: function() { + ++nbTimersFired; + timers.unenroll(foo); + } +}; + +timers.enroll(bar, 1); +timers._unrefActive(bar); + +timers.enroll(foo, 1); +timers._unrefActive(foo); + +setTimeout(function() { + assert.notEqual(nbTimersFired, 2); +}, 20); diff --git a/test/parallel/test-timers-unref-remove-other-unref-timers.js b/test/parallel/test-timers-unref-remove-other-unref-timers.js new file mode 100644 index 00000000000000..dcc50a5171ad28 --- /dev/null +++ b/test/parallel/test-timers-unref-remove-other-unref-timers.js @@ -0,0 +1,32 @@ +'use strict'; + +/* + * This test is a regression test for joyent/node#8897. + * + * It tests some private implementation details that should not be + * considered public interface. + */ +const common = require('../common'); +const timers = require('timers'); + +const foo = { + _onTimeout: common.fail +}; + +const bar = { + _onTimeout: common.mustCall(function() { + timers.unenroll(foo); + }) +}; + +// We use timers with expiration times that are sufficiently apart to make +// sure that they're not fired at the same time on platforms where the timer +// resolution is a bit coarse (e.g Windows with a default resolution of ~15ms). +timers.enroll(bar, 1); +timers._unrefActive(bar); + +timers.enroll(foo, 50); +timers._unrefActive(foo); + +// Keep the process open. +setTimeout(function() {}, 100); diff --git a/test/parallel/test-timers-unref.js b/test/parallel/test-timers-unref.js index ab2e33acd21019..134b2ffe4c3967 100644 --- a/test/parallel/test-timers-unref.js +++ b/test/parallel/test-timers-unref.js @@ -1,17 +1,25 @@ '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 interval, check_unref, checks = 0; var LONG_TIME = 10 * 1000; var SHORT_TIME = 100; +assert.doesNotThrow(function() { + setTimeout(function() {}, 10).unref().ref().unref(); +}, 'ref and unref are chainable'); + +assert.doesNotThrow(function() { + setInterval(function() {}, 10).unref().ref().unref(); +}, 'ref and unref are chainable'); + setInterval(function() { interval_fired = true; }, LONG_TIME).unref(); diff --git a/test/parallel/test-timers-unrefd-interval-still-fires.js b/test/parallel/test-timers-unrefd-interval-still-fires.js index 50a473b9c8b4b8..172da8bb954fa7 100644 --- a/test/parallel/test-timers-unrefd-interval-still-fires.js +++ b/test/parallel/test-timers-unrefd-interval-still-fires.js @@ -2,18 +2,26 @@ /* * This test is a regression test for joyent/node#8900. */ -var assert = require('assert'); +const common = require('../common'); -var N = 5; +const TEST_DURATION = common.platformTimeout(100); +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-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-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-reject.js b/test/parallel/test-tls-client-reject.js index f2b93393e7d32d..2f9ea230a06828 100644 --- a/test/parallel/test-tls-client-reject.js +++ b/test/parallel/test-tls-client-reject.js @@ -21,7 +21,7 @@ var connectCount = 0; var server = tls.createServer(options, function(socket) { ++connectCount; socket.on('data', function(data) { - common.debug(data.toString()); + console.error(data.toString()); assert.equal(data, 'ok'); }); }).listen(common.PORT, function() { @@ -51,7 +51,7 @@ function rejectUnauthorized() { assert(false); }); socket.on('error', function(err) { - common.debug(err); + console.error(err); authorized(); }); socket.write('ng'); 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-pipe.js b/test/parallel/test-tls-connect-pipe.js index 4d607a88830081..ae8062635c85b5 100644 --- a/test/parallel/test-tls-connect-pipe.js +++ b/test/parallel/test-tls-connect-pipe.js @@ -18,6 +18,8 @@ var options = { cert: fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem') }; +common.refreshTmpDir(); + var server = tls.Server(options, function(socket) { ++serverConnected; server.close(); 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-fast-writing.js b/test/parallel/test-tls-fast-writing.js index 009fa40b631ee5..1f65391480d59d 100644 --- a/test/parallel/test-tls-fast-writing.js +++ b/test/parallel/test-tls-fast-writing.js @@ -20,7 +20,7 @@ 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)); 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-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-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..11128783871fe4 --- /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\nCN=ca1\n' + + 'emailAddress=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-pause.js b/test/parallel/test-tls-pause.js index 3dc3e53d47f336..a19c4aee403d87 100644 --- a/test/parallel/test-tls-pause.js +++ b/test/parallel/test-tls-pause.js @@ -35,7 +35,7 @@ server.listen(common.PORT, function() { }, function() { console.error('connected'); client.pause(); - common.debug('paused'); + console.error('paused'); send(); function send() { console.error('sending'); @@ -48,7 +48,7 @@ server.listen(common.PORT, function() { return process.nextTick(send); } sent += bufSize; - common.debug('sent: ' + sent); + console.error('sent: ' + sent); resumed = true; client.resume(); console.error('resumed', client); @@ -61,7 +61,7 @@ server.listen(common.PORT, function() { console.error('received', received); console.error('sent', sent); if (received >= sent) { - common.debug('received: ' + received); + console.error('received: ' + received); client.end(); server.close(); } diff --git a/test/parallel/test-tls-peer-certificate-encoding.js b/test/parallel/test-tls-peer-certificate-encoding.js index 771c8181c8c3b6..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')), @@ -30,7 +29,7 @@ server.listen(common.PORT, function() { }, function() { var peerCert = socket.getPeerCertificate(); - common.debug(util.inspect(peerCert)); + console.error(util.inspect(peerCert)); assert.equal(peerCert.subject.CN, 'Ádám Lippai'); verified = true; server.close(); diff --git a/test/parallel/test-tls-peer-certificate-multi-keys.js b/test/parallel/test-tls-peer-certificate-multi-keys.js index 3cfd6420cdf507..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')), @@ -28,7 +27,7 @@ server.listen(common.PORT, function() { rejectUnauthorized: false }, function() { var peerCert = socket.getPeerCertificate(); - common.debug(util.inspect(peerCert)); + console.error(util.inspect(peerCert)); assert.deepEqual(peerCert.subject.OU, ['Information Technology', 'Engineering', 'Marketing']); verified = true; diff --git a/test/parallel/test-tls-peer-certificate.js b/test/parallel/test-tls-peer-certificate.js index 3c25af19c87e88..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')), @@ -35,10 +34,12 @@ server.listen(common.PORT, function() { peerCert = socket.getPeerCertificate(true); assert.ok(peerCert.issuerCertificate); - common.debug(util.inspect(peerCert)); + console.error(util.inspect(peerCert)); 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-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 190acae42870a9..a33a2e5ed27209 100644 --- a/test/parallel/test-tty-stdout-end.js +++ b/test/parallel/test-tty-stdout-end.js @@ -1,16 +1,15 @@ 'use strict'; // Can't test this when 'make test' doesn't assign a tty to the stdout. -var common = require('../common'); -var assert = require('assert'); +require('../common'); +const assert = require('assert'); -var exceptionCaught = false; - -try { +const shouldThrow = function() { process.stdout.end(); -} catch (e) { - exceptionCaught = true; - assert.ok(common.isError(e)); - assert.equal('process.stdout cannot be closed.', e.message); -} +}; + +const validateError = function(e) { + return e instanceof Error && + e.message === 'process.stdout cannot be closed.'; +}; -assert.ok(exceptionCaught); +assert.throws(shouldThrow, validateError); 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..9aa2682cbcb523 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/\' <>"`/{}|\\^~`/': { @@ -857,10 +855,10 @@ var parseTests = { }; -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 +869,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 +927,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 +942,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 +1090,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 +1100,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 +1129,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 +1193,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 +1503,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 +1513,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 +1543,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 +1566,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..baa77ea4405484 --- /dev/null +++ b/test/parallel/test-util-inherits.js @@ -0,0 +1,46 @@ +'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); + +// 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 58a4c8a2f2b142..106ebf5cf06eae 100644 --- a/test/parallel/test-util-inspect.js +++ b/test/parallel/test-util-inspect.js @@ -1,8 +1,115 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var util = require('util'); +assert.equal(util.inspect(1), '1'); +assert.equal(util.inspect(false), 'false'); +assert.equal(util.inspect(''), "''"); +assert.equal(util.inspect('hello'), "'hello'"); +assert.equal(util.inspect(function() {}), '[Function]'); +assert.equal(util.inspect(undefined), 'undefined'); +assert.equal(util.inspect(null), 'null'); +assert.equal(util.inspect(/foo(bar\n)?/gi), '/foo(bar\\n)?/gi'); +assert.equal(util.inspect(new Date('Sun, 14 Feb 2010 11:48:40 GMT')), + new Date('2010-02-14T12:48:40+01:00').toString()); + +assert.equal(util.inspect('\n\u0001'), "'\\n\\u0001'"); + +assert.equal(util.inspect([]), '[]'); +assert.equal(util.inspect(Object.create([])), 'Array {}'); +assert.equal(util.inspect([1, 2]), '[ 1, 2 ]'); +assert.equal(util.inspect([1, [2, 3]]), '[ 1, [ 2, 3 ] ]'); + +assert.equal(util.inspect({}), '{}'); +assert.equal(util.inspect({a: 1}), '{ a: 1 }'); +assert.equal(util.inspect({a: function() {}}), '{ a: [Function] }'); +assert.equal(util.inspect({a: 1, b: 2}), '{ a: 1, b: 2 }'); +assert.equal(util.inspect({'a': {}}), '{ a: {} }'); +assert.equal(util.inspect({'a': {'b': 2}}), '{ a: { b: 2 } }'); +assert.equal(util.inspect({'a': {'b': { 'c': { 'd': 2 }}}}), + '{ a: { b: { c: [Object] } } }'); +assert.equal(util.inspect({'a': {'b': { 'c': { 'd': 2 }}}}, false, null), + '{ a: { b: { c: { d: 2 } } } }'); +assert.equal(util.inspect([1, 2, 3], true), '[ 1, 2, 3, [length]: 3 ]'); +assert.equal(util.inspect({'a': {'b': { 'c': 2}}}, false, 0), + '{ a: [Object] }'); +assert.equal(util.inspect({'a': {'b': { 'c': 2}}}, false, 1), + '{ a: { b: [Object] } }'); +assert.equal(util.inspect(Object.create({}, + {visible: {value: 1, enumerable: true}, hidden: {value: 2}})), + '{ visible: 1 }' +); + +// Due to the hash seed randomization it's not deterministic the order that +// the following ways this hash is displayed. +// See http://codereview.chromium.org/9124004/ + +{ + 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 +{ + 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}, + hidden: {value: 'secret'}})), + '{ name: \'Tim\' }' +); + + +// Dynamic properties +assert.equal(util.inspect({get readonly() {}}), + '{ readonly: [Getter] }'); + +assert.equal(util.inspect({get readwrite() {}, set readwrite(val) {}}), + '{ readwrite: [Getter/Setter] }'); + +assert.equal(util.inspect({set writeonly(val) {}}), + '{ writeonly: [Setter] }'); + +var value = {}; +value['a'] = value; +assert.equal(util.inspect(value), '{ a: [Circular] }'); + +// Array with dynamic properties +value = [1, 2, 3]; +value.__defineGetter__('growingLength', function() { + this.push(true); return this.length; +}); +assert.equal(util.inspect(value), '[ 1, 2, 3, growingLength: [Getter] ]'); + +// Function with properties +value = function() {}; +value.aprop = 42; +assert.equal(util.inspect(value), '{ [Function] aprop: 42 }'); + +// Regular expressions with properties +value = /123/ig; +value.aprop = 42; +assert.equal(util.inspect(value), '{ /123/gi aprop: 42 }'); + +// Dates with properties +value = new Date('Sun, 14 Feb 2010 11:48:40 GMT'); +value.aprop = 42; +assert.equal(util.inspect(value), '{ Sun, 14 Feb 2010 11:48:40 GMT aprop: 42 }' +); + // test the internal isDate implementation var Date2 = require('vm').runInNewContext('Date'); var d = new Date2(); @@ -23,6 +130,31 @@ assert.equal(util.inspect(a), '[ \'foo\', , \'baz\' ]'); 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'); + 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 ] ]'); +} + +// 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, { a: { @@ -84,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 = { @@ -133,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) { @@ -225,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; @@ -239,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 @@ -250,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 }'); @@ -274,6 +411,26 @@ global.Promise = function() { this.bar = 42; }; assert.equal(util.inspect(new Promise()), '{ bar: 42 }'); global.Promise = oldPromise; +// Map/Set Iterators +var m = new Map([['foo', 'bar']]); +assert.strictEqual(util.inspect(m.keys()), 'MapIterator { \'foo\' }'); +assert.strictEqual(util.inspect(m.values()), 'MapIterator { \'bar\' }'); +assert.strictEqual(util.inspect(m.entries()), + 'MapIterator { [ \'foo\', \'bar\' ] }'); +// make sure the iterator doesn't get consumed +var keys = m.keys(); +assert.strictEqual(util.inspect(keys), 'MapIterator { \'foo\' }'); +assert.strictEqual(util.inspect(keys), 'MapIterator { \'foo\' }'); + +var s = new Set([1, 3]); +assert.strictEqual(util.inspect(s.keys()), 'SetIterator { 1, 3 }'); +assert.strictEqual(util.inspect(s.values()), 'SetIterator { 1, 3 }'); +assert.strictEqual(util.inspect(s.entries()), + 'SetIterator { [ 1, 1 ], [ 3, 3 ] }'); +// make sure the iterator doesn't get consumed +keys = s.keys(); +assert.strictEqual(util.inspect(keys), 'SetIterator { 1, 3 }'); +assert.strictEqual(util.inspect(keys), 'SetIterator { 1, 3 }'); // Test alignment of items in container // Assumes that the first numeric character is the start of an item. @@ -309,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] }'); +} + +{ + const x = new (function() {}); + assert.equal(util.inspect(x), '{}'); +} -var x = Object.create(null); -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 9285e3e3409e99..b9e3d9ce3505e0 100644 --- a/test/parallel/test-util-log.js +++ b/test/parallel/test-util-log.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var util = require('util'); @@ -27,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..eb5566fe2bc28f 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'); 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-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..94527598ca27b1 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,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-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..81f9b57593ea2f 100644 --- a/test/parallel/test-vm-new-script-new-context.js +++ b/test/parallel/test-vm-new-script-new-context.js @@ -21,7 +21,6 @@ assert.throws(function() { console.error('undefined reference'); -var error; script = new Script('foo.bar = 5;'); assert.throws(function() { script.runInNewContext(); @@ -41,7 +40,9 @@ code = 'foo = 1;' + foo = 2; obj = { foo: 0, baz: 3 }; script = new Script(code); +/* eslint-disable no-unused-vars */ var baz = script.runInNewContext(obj); +/* eslint-enable no-unused-vars */ assert.equal(1, obj.foo); assert.equal(2, obj.bar); assert.equal(2, 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..2b32eccf408ff0 100644 --- a/test/parallel/test-vm-run-in-new-context.js +++ b/test/parallel/test-vm-run-in-new-context.js @@ -29,7 +29,9 @@ code = 'foo = 1;' + 'if (baz !== 3) throw new Error(\'test fail\');'; foo = 2; obj = { foo: 0, baz: 3 }; +/* eslint-disable no-unused-vars */ var baz = vm.runInNewContext(code, obj); +/* eslint-enable no-unused-vars */ assert.equal(1, obj.foo); assert.equal(2, obj.bar); assert.equal(2, foo); diff --git a/test/parallel/test-vm-static-this.js b/test/parallel/test-vm-static-this.js index fb9cb764f8422c..a5f5ad9415a828 100644 --- a/test/parallel/test-vm-static-this.js +++ b/test/parallel/test-vm-static-this.js @@ -25,7 +25,9 @@ code = 'foo = 1;' + 'if (typeof baz !== \'undefined\') throw new Error(\'test fail\');'; foo = 2; obj = { foo: 0, baz: 3 }; +/* eslint-disable no-unused-vars */ var baz = vm.runInThisContext(code); +/* eslint-enable no-unused-vars */ assert.equal(0, obj.foo); assert.equal(2, bar); assert.equal(1, 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/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/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..f8ce5bfbe87df4 100644 --- a/test/parallel/test-zlib-dictionary.js +++ b/test/parallel/test-zlib-dictionary.js @@ -1,10 +1,9 @@ '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([ 'optionsgetheadpostputdeletetraceacceptaccept-charsetaccept-encodingaccept-', 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.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-string.js b/test/parallel/test-zlib-from-string.js index 49f4d139c148d9..14c747fc433692 100644 --- a/test/parallel/test-zlib-from-string.js +++ b/test/parallel/test-zlib-from-string.js @@ -1,7 +1,7 @@ 'use strict'; // test compressing and uncompressing a string with zlib -var common = require('../common'); +require('../common'); var assert = require('assert'); var zlib = require('zlib'); 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..4e02b7bdb9461c 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 = 24 * 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, 0x48, 0x82, 0xb7, 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-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..1256d94a61402d 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 = {}; diff --git a/test/pummel/test-crypto-dh.js b/test/pummel/test-crypto-dh.js index a223e45c866bcd..596d107a287a28 100644 --- a/test/pummel/test-crypto-dh.js +++ b/test/pummel/test-crypto-dh.js @@ -20,27 +20,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..2e5c8670553138 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,7 +12,6 @@ if (os.type() != 'SunOS') { * Some functions to create a recognizable stack. */ var frames = [ 'stalloogle', 'bagnoogle', 'doogle' ]; -var expected; var stalloogle = function(str) { expected = str; @@ -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-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 d396042fde8aaa..46190555b27263 100644 --- a/test/pummel/test-keep-alive.js +++ b/test/pummel/test-keep-alive.js @@ -1,17 +1,17 @@ 'use strict'; -if (common.isWindows) { - console.log('1..0 # Skipped: no `wrk` on windows'); - return; -} // This test requires the program 'wrk' 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) { + console.log('1..0 # Skipped: no `wrk` on windows'); + return; +} + var body = 'hello world\n'; var server = http.createServer(function(req, res) { res.writeHead(200, { diff --git a/test/pummel/test-net-many-clients.js b/test/pummel/test-net-many-clients.js index b70efbda582571..6d9dde1ddbc863 100644 --- a/test/pummel/test-net-many-clients.js +++ b/test/pummel/test-net-many-clients.js @@ -19,7 +19,7 @@ for (var i = 0; i < bytes; i++) { var server = net.createServer(function(c) { console.log('connected'); total_connections++; - common.print('#'); + console.log('#'); c.write(body); c.end(); }); @@ -32,7 +32,7 @@ function runClient(callback) { client.setEncoding('utf8'); client.on('connect', function() { - common.print('c'); + console.log('c'); client.recved = ''; client.connections += 1; }); @@ -51,7 +51,7 @@ function runClient(callback) { }); client.on('close', function(had_error) { - common.print('.'); + console.log('.'); assert.equal(false, had_error); assert.equal(bytes, client.recved.length); diff --git a/test/pummel/test-net-pause.js b/test/pummel/test-net-pause.js index 6386d29835da11..b0c51260436e0c 100644 --- a/test/pummel/test-net-pause.js +++ b/test/pummel/test-net-pause.js @@ -24,7 +24,7 @@ server.on('listening', function() { var client = net.createConnection(common.PORT); client.setEncoding('ascii'); client.on('data', function(d) { - common.print(d); + console.log(d); recv += d; }); @@ -65,5 +65,5 @@ server.listen(common.PORT); process.on('exit', function() { assert.equal(N, recv.length); - common.debug('Exit'); + console.error('Exit'); }); diff --git a/test/pummel/test-net-pingpong-delay.js b/test/pummel/test-net-pingpong-delay.js index e459c71a7185ac..1a25ed3fe2b7ed 100644 --- a/test/pummel/test-net-pingpong-delay.js +++ b/test/pummel/test-net-pingpong-delay.js @@ -27,7 +27,7 @@ function pingPongTest(port, host, on_complete) { }); socket.on('timeout', function() { - common.debug('server-side timeout!!'); + console.error('server-side timeout!!'); assert.equal(false, true); }); @@ -73,7 +73,7 @@ function pingPongTest(port, host, on_complete) { }); client.on('timeout', function() { - common.debug('client-side timeout!!'); + console.error('client-side timeout!!'); assert.equal(false, true); }); 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-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 2d733c87783e99..568040ef59ddd6 100644 --- a/test/sequential/sequential.status +++ b/test/sequential/sequential.status @@ -5,15 +5,22 @@ prefix sequential # sample-test : PASS,FLAKY [true] # This section applies to all platforms -test-child-process-fork-getconnections : 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-chdir.js b/test/sequential/test-chdir.js deleted file mode 100644 index bab421e1e650c4..00000000000000 --- a/test/sequential/test-chdir.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; -var common = require('../common'); -var assert = require('assert'); -var fs = require('fs'); -var path = require('path'); - -assert.equal(true, process.cwd() !== __dirname); - -process.chdir(__dirname); -assert.equal(true, process.cwd() === __dirname); - -var dir = path.resolve(common.fixturesDir, - 'weird \uc3a4\uc3ab\uc3af characters \u00e1\u00e2\u00e3'); - -try { - fs.mkdirSync(dir); -} catch (e) { - if (e.code !== 'EEXIST') { - cleanup(); - throw e; - } -} - -process.chdir(dir); -assert(process.cwd() == dir); - -process.chdir('..'); -assert(process.cwd() == path.resolve(common.fixturesDir)); -cleanup(); - -assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.'); -assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.'); -assert.throws(function() { process.chdir('x', 'y'); }, - TypeError, 'Bad argument.'); - -function cleanup() { - fs.rmdirSync(dir); -} diff --git a/test/sequential/test-child-process-emfile.js b/test/sequential/test-child-process-emfile.js index 08a34a05f25734..2ac0b6c0b23a73 100644 --- a/test/sequential/test-child-process-emfile.js +++ b/test/sequential/test-child-process-emfile.js @@ -1,29 +1,54 @@ '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; } +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 { - fs.openSync(__filename, 'r'); + 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'); })); -// 'exit' should not be emitted, the process was never spawned. -proc.on('exit', assert.fail); +proc.on('exit', function() { + const msg = '"exit" should not be emitted (the process never spawned!)'; + assert.fail(null, null, msg); +}); + +// close one fd for LSan +if (openFds.length >= 1) { + fs.closeSync(openFds.pop()); +} diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index 07b6ba4c341271..6c7df10ffb09a7 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -1,8 +1,6 @@ 'use strict'; var common = require('../common'); var assert = require('assert'); -var util = require('util'); -var os = require('os'); var execSync = require('child_process').execSync; var execFileSync = require('child_process').execFileSync; @@ -13,10 +11,9 @@ var SLEEP = 2000; var start = Date.now(); var err; var caught = false; -try -{ - var cmd = util.format('"%s" -e "setTimeout(function(){}, %d);"', - process.execPath, SLEEP); + +try { + var cmd = `"${process.execPath}" -e "setTimeout(function(){}, ${SLEEP});"`; var ret = execSync(cmd, {timeout: TIMER}); } catch (e) { caught = true; @@ -38,9 +35,10 @@ var msg = 'foobar'; var msgBuf = new Buffer(msg + '\n'); // console.log ends every line with just '\n', even on Windows. -cmd = util.format('"%s" -e "console.log(\'%s\');"', process.execPath, msg); -var ret = execSync(cmd); +cmd = `"${process.execPath}" -e "console.log(\'${msg}\');"`; + +ret = execSync(cmd); assert.strictEqual(ret.length, msgBuf.length); assert.deepEqual(ret, msgBuf, 'execSync result buffer should match'); @@ -51,7 +49,7 @@ assert.strictEqual(ret, msg + '\n', 'execSync encoding result should match'); var args = [ '-e', - util.format('console.log("%s");', msg) + `console.log("${msg}");` ]; ret = execFileSync(process.execPath, args); diff --git a/test/sequential/test-child-process-fork-getconnections.js b/test/sequential/test-child-process-fork-getconnections.js index a587713b6132f2..8928ef6c744ba4 100644 --- a/test/sequential/test-child-process-fork-getconnections.js +++ b/test/sequential/test-child-process-fork-getconnections.js @@ -1,48 +1,52 @@ 'use strict'; -var assert = require('assert'); -var common = require('../common'); -var fork = require('child_process').fork; -var net = require('net'); -var count = 12; +const assert = require('assert'); +const common = require('../common'); +const fork = require('child_process').fork; +const net = require('net'); +const count = 12; if (process.argv[2] === 'child') { - var sockets = []; - var id = process.argv[3]; + const sockets = []; process.on('message', function(m, socket) { + function sendClosed(id) { + process.send({ id: id, status: 'closed'}); + } + if (m.cmd === 'new') { assert(socket); assert(socket instanceof net.Socket, 'should be a net.Socket'); sockets.push(socket); - socket.on('end', function() { - if (!this.closingOnPurpose) - throw new Error('[c] closing by accident!'); - }); } if (m.cmd === 'close') { assert.equal(socket, undefined); - sockets[m.id].once('close', function() { - process.send({ id: m.id, status: 'closed' }); - }); - sockets[m.id].destroy(); + if (sockets[m.id].destroyed) { + // Workaround for https://github.com/nodejs/node/issues/2610 + sendClosed(m.id); + // End of workaround. When bug is fixed, this code can be used instead: + // throw new Error('socket destroyed unexpectedly!'); + } else { + sockets[m.id].once('close', sendClosed.bind(null, m.id)); + sockets[m.id].destroy(); + } } }); } else { - var child = fork(process.argv[1], ['child']); + const child = fork(process.argv[1], ['child']); child.on('exit', function(code, signal) { if (!childKilled) throw new Error('child died unexpectedly!'); }); - var server = net.createServer(); - var sockets = []; - var sent = 0; + const server = net.createServer(); + const sockets = []; + let sent = 0; server.on('connection', function(socket) { - child.send({ cmd: 'new' }, socket, { track: false }); + child.send({ cmd: 'new' }, socket); sockets.push(socket); if (sockets.length === count) { @@ -50,21 +54,18 @@ if (process.argv[2] === 'child') { } }); - var disconnected = 0; - var clients = []; + let disconnected = 0; server.on('listening', function() { - var j = count, client; + let j = count; while (j--) { - client = net.connect(common.PORT, '127.0.0.1'); - client.id = j; + const client = net.connect(common.PORT, '127.0.0.1'); client.on('close', function() { disconnected += 1; }); - clients.push(client); } }); - var childKilled = false; + let childKilled = false; function closeSockets(i) { if (i === count) { childKilled = true; @@ -73,17 +74,17 @@ if (process.argv[2] === 'child') { return; } - sent++; - child.send({ id: i, cmd: 'close' }); child.once('message', function(m) { assert(m.status === 'closed'); server.getConnections(function(err, num) { closeSockets(i + 1); }); }); - }; + sent++; + child.send({ id: i, cmd: 'close' }); + } - var closeEmitted = false; + let closeEmitted = false; server.on('close', function() { closeEmitted = true; }); diff --git a/test/sequential/test-cluster-disconnect-leak.js b/test/sequential/test-cluster-disconnect-leak.js new file mode 100644 index 00000000000000..a4916c95ba4ea7 --- /dev/null +++ b/test/sequential/test-cluster-disconnect-leak.js @@ -0,0 +1,29 @@ +'use strict'; + +// Test fails in Node v5.4.0 and passes in v5.4.1 and newer. + +const common = require('../common'); +const net = require('net'); +const cluster = require('cluster'); + +const noop = () => {}; + +cluster.schedulingPolicy = cluster.SCHED_NONE; + +if (cluster.isMaster) { + const worker = cluster.fork(); + + // This is the important part of the test: Confirm that `disconnect` fires. + worker.on('disconnect', common.mustCall(noop)); + + // These are just some extra stuff we're checking for good measure... + worker.on('exit', common.mustCall(noop)); + cluster.on('exit', common.mustCall(noop)); + + cluster.disconnect(); + return; +} + +const server = net.createServer(); + +server.listen(common.PORT); diff --git a/test/sequential/test-cluster-disconnect-suicide-race.js b/test/sequential/test-cluster-disconnect-suicide-race.js new file mode 100644 index 00000000000000..6f23b23fd2d4ff --- /dev/null +++ b/test/sequential/test-cluster-disconnect-suicide-race.js @@ -0,0 +1,27 @@ +'use strict'; + +// Test should fail in Node.js 5.4.1 and pass in later versions. + +const common = require('../common'); +const assert = require('assert'); +const cluster = require('cluster'); + +if (cluster.isMaster) { + cluster.on('exit', (worker, code) => { + assert.strictEqual(code, 0, 'worker exited with error'); + }); + + return cluster.fork(); +} + +var eventFired = false; + +cluster.worker.disconnect(); + +process.nextTick(common.mustCall(() => { + assert.strictEqual(eventFired, false, 'disconnect event should wait for ack'); +})); + +cluster.worker.on('disconnect', common.mustCall(() => { + eventFired = true; +})); diff --git a/test/sequential/test-cluster-listening-port.js b/test/sequential/test-cluster-listening-port.js index eb8a974d04bbf8..dc048c891c7b8c 100644 --- a/test/sequential/test-cluster-listening-port.js +++ b/test/sequential/test-cluster-listening-port.js @@ -1,4 +1,5 @@ 'use strict'; +var common = require('../common'); var assert = require('assert'); var cluster = require('cluster'); var net = require('net'); @@ -11,7 +12,7 @@ if (cluster.isMaster) { // ensure that the port is not 0 or null assert(port); // ensure that the port is numerical - assert.strictEqual(typeof(port), 'number'); + assert.strictEqual(typeof port, 'number'); worker.kill(); }); process.on('exit', function() { @@ -20,5 +21,5 @@ if (cluster.isMaster) { }); } else { - net.createServer(assert.fail).listen(0); + net.createServer(common.fail).listen(0); } diff --git a/test/sequential/test-debug-args.js b/test/sequential/test-debug-args.js index eb1533d4418a55..cb70c185f5419b 100644 --- a/test/sequential/test-debug-args.js +++ b/test/sequential/test-debug-args.js @@ -1,7 +1,7 @@ 'use strict'; // Flags: --debugger -var common = require('../common'); +require('../common'); var assert = require('assert'); assert.notEqual(process.execArgv.indexOf('--debugger'), -1); diff --git a/test/sequential/test-deprecation-flags.js b/test/sequential/test-deprecation-flags.js index ca325654c55d80..037f40f07e0a25 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'); 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 0a18b94f56bd6d..00000000000000 --- a/test/sequential/test-fs-watch-recursive.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); - -if (process.platform === 'darwin') { - 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); -} diff --git a/test/sequential/test-fs-watch.js b/test/sequential/test-fs-watch.js index 10f4baf591ae0b..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 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..975eb84e769d97 --- /dev/null +++ b/test/sequential/test-http-regr-gh-2928.js @@ -0,0 +1,50 @@ +// 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() { + process.stdout.write('.'); + if (parsers.length === 0) + return; + + const parser = parsers.pop(); + parser.reinitialize(HTTPParser.RESPONSE); + const socket = net.connect(common.PORT); + 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-memory-usage-emfile.js b/test/sequential/test-memory-usage-emfile.js index e4f85488f40d42..92c103669a9a85 100644 --- a/test/sequential/test-memory-usage-emfile.js +++ b/test/sequential/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'); @@ -10,5 +10,4 @@ while (files.length < 256) files.push(fs.openSync(__filename, 'r')); var r = process.memoryUsage(); -console.log(common.inspect(r)); assert.equal(true, r['rss'] > 0); diff --git a/test/sequential/test-mkdir-rmdir.js b/test/sequential/test-mkdir-rmdir.js deleted file mode 100644 index 976dbf6c2aa251..00000000000000 --- a/test/sequential/test-mkdir-rmdir.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); - -common.refreshTmpDir(); - -var dirname = path.dirname(__filename); -var d = path.join(common.tmpDir, 'dir'); - -var mkdir_error = false; -var rmdir_error = false; - -fs.mkdir(d, 0o666, function(err) { - if (err) { - console.log('mkdir error: ' + err.message); - mkdir_error = true; - } else { - fs.mkdir(d, 0o666, function(err) { - console.log('expect EEXIST error: ', err); - assert.ok(err.message.match(/^EEXIST/), 'got EEXIST message'); - assert.equal(err.code, 'EEXIST', 'got EEXIST code'); - assert.equal(err.path, d, 'got proper path for EEXIST'); - - console.log('mkdir okay!'); - fs.rmdir(d, function(err) { - if (err) { - console.log('rmdir error: ' + err.message); - rmdir_error = true; - } else { - console.log('rmdir okay!'); - } - }); - }); - } -}); - -process.on('exit', function() { - assert.equal(false, mkdir_error); - assert.equal(false, rmdir_error); - console.log('exit'); -}); diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index dfca2e420263b6..8e7f641326e7c9 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -1,10 +1,10 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var path = require('path'); var fs = require('fs'); -common.debug('load test-module-loading.js'); +console.error('load test-module-loading.js'); // assert that this is the main module. assert.equal(require.main.id, '.', 'main module should have id of \'.\''); @@ -33,62 +33,62 @@ 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); -common.debug('test index.js modules ids and relative loading'); -var one = require('../fixtures/nested-index/one'), - two = require('../fixtures/nested-index/two'); +console.error('test index.js modules ids and relative loading'); +const one = require('../fixtures/nested-index/one'); +const two = require('../fixtures/nested-index/two'); assert.notEqual(one.hello, two.hello); -common.debug('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'); +console.error('test index.js in a folder with a trailing slash'); +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); -common.debug('test package.json require() loading'); +console.error('test package.json require() loading'); assert.equal(require('../fixtures/packages/main').ok, 'ok', 'Failed loading package'); assert.equal(require('../fixtures/packages/main-index').ok, 'ok', 'Failed loading package with index.js in main subdir'); -common.debug('test cycles containing a .. path'); -var root = require('../fixtures/cycles/root'), - foo = require('../fixtures/cycles/folder/foo'); +console.error('test cycles containing a .. path'); +const root = require('../fixtures/cycles/root'); +const foo = require('../fixtures/cycles/folder/foo'); assert.equal(root.foo, foo); assert.equal(root.sayHello(), root.hello); -common.debug('test node_modules folders'); +console.error('test node_modules folders'); // asserts are in the fixtures files themselves, // since they depend on the folder structure. require('../fixtures/node_modules/foo'); -common.debug('test name clashes'); +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'); }); @@ -102,7 +102,7 @@ try { assert.equal(require('path').dirname(__filename), __dirname); -common.debug('load custom file types with extensions'); +console.error('load custom file types with extensions'); require.extensions['.test'] = function(module, filename) { var content = fs.readFileSync(filename).toString(); assert.equal('this is custom source\n', content); @@ -115,7 +115,7 @@ assert.equal(require('../fixtures/registerExt').test, 'passed'); // unknown extension, load as .js assert.equal(require('../fixtures/registerExt.hello.world').test, 'passed'); -common.debug('load custom file types that return non-strings'); +console.error('load custom file types that return non-strings'); require.extensions['.test'] = function(module, filename) { module.exports = { custom: 'passed' @@ -139,10 +139,10 @@ try { } // Check load order is as expected -common.debug('load order'); +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']; @@ -259,19 +259,19 @@ assert.throws(function() { }, '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); @@ -283,3 +283,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 0478de55d62592..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 @@ -53,12 +52,6 @@ function parent() { var serverExited = false; var clientExited = false; var serverListened = false; - var opt = { - env: { - NODE_DEBUG: 'net', - NODE_COMMON_PORT: process.env.NODE_COMMON_PORT, - } - }; process.on('exit', function() { assert(serverExited); @@ -75,7 +68,11 @@ function parent() { }); }, common.platformTimeout(2000)).unref(); - var s = spawn(node, [__filename, 'server'], opt); + var s = spawn(node, [__filename, 'server'], { + env: Object.assign(process.env, { + NODE_DEBUG: 'net' + }) + }); var c; wrap(s.stderr, process.stderr, 'SERVER 2>'); diff --git a/test/sequential/test-net-listen-exclusive-random-ports.js b/test/sequential/test-net-listen-exclusive-random-ports.js index c32273a59b2a50..f46f9a01d773ce 100644 --- a/test/sequential/test-net-listen-exclusive-random-ports.js +++ b/test/sequential/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/sequential/test-pipe-address.js b/test/sequential/test-pipe-address.js index b9e544e97458b4..36488d80f789af 100644 --- a/test/sequential/test-pipe-address.js +++ b/test/sequential/test-pipe-address.js @@ -9,6 +9,8 @@ var server = net.createServer(function() { assert(false); // should not be called }); +common.refreshTmpDir(); + server.listen(common.PIPE, function() { address = server.address(); server.close(); diff --git a/test/sequential/test-pipe-stream.js b/test/sequential/test-pipe-stream.js index ba4005e9e02fe0..693066c2fb25d0 100644 --- a/test/sequential/test-pipe-stream.js +++ b/test/sequential/test-pipe-stream.js @@ -3,6 +3,8 @@ var common = require('../common'); var assert = require('assert'); var net = require('net'); +common.refreshTmpDir(); + function test(clazz, cb) { var have_ping = false; var have_pong = false; diff --git a/test/sequential/test-pipe-unref.js b/test/sequential/test-pipe-unref.js index 4580f2a66ee4d6..ea6f7c95563928 100644 --- a/test/sequential/test-pipe-unref.js +++ b/test/sequential/test-pipe-unref.js @@ -5,6 +5,8 @@ var assert = require('assert'); var net = require('net'); var closed = false; +common.refreshTmpDir(); + var s = net.Server(); s.listen(common.PIPE); s.unref(); diff --git a/test/sequential/test-pump-file2tcp-noexist.js b/test/sequential/test-pump-file2tcp-noexist.js index 1ffdb5d4615ce3..66d1e1119ff6e2 100644 --- a/test/sequential/test-pump-file2tcp-noexist.js +++ b/test/sequential/test-pump-file2tcp-noexist.js @@ -11,14 +11,12 @@ var got_error = false; var conn_closed = false; var server = net.createServer(function(stream) { - common.error('pump!'); util.pump(fs.createReadStream(fn), stream, function(err) { - common.error('util.pump\'s callback fired'); if (err) { got_error = true; } else { - common.debug('util.pump\'s callback fired with no error'); - common.debug('this shouldn\'t happen as the file doesn\'t exist...'); + // util.pump's callback fired with no error + // this shouldn't happen as the file doesn't exist... assert.equal(true, false); } server.close(); @@ -29,7 +27,6 @@ server.listen(common.PORT, function() { var conn = net.createConnection(common.PORT); conn.setEncoding('utf8'); conn.on('data', function(chunk) { - common.error('recv data! nchars = ' + chunk.length); buffer += chunk; }); @@ -38,7 +35,6 @@ server.listen(common.PORT, function() { }); conn.on('close', function() { - common.error('client connection close'); conn_closed = true; }); }); @@ -48,5 +44,4 @@ var buffer = ''; process.on('exit', function() { assert.equal(true, got_error); assert.equal(true, conn_closed); - console.log('exiting'); }); diff --git a/test/sequential/test-pump-file2tcp.js b/test/sequential/test-pump-file2tcp.js index 86effb7c6c9a28..f99ae1c5d79ea6 100644 --- a/test/sequential/test-pump-file2tcp.js +++ b/test/sequential/test-pump-file2tcp.js @@ -10,10 +10,7 @@ var fn = path.join(common.fixturesDir, 'elipses.txt'); var expected = fs.readFileSync(fn, 'utf8'); var server = net.createServer(function(stream) { - common.error('pump!'); util.pump(fs.createReadStream(fn), stream, function() { - common.error('server stream close'); - common.error('server close'); server.close(); }); }); @@ -22,20 +19,15 @@ server.listen(common.PORT, function() { var conn = net.createConnection(common.PORT); conn.setEncoding('utf8'); conn.on('data', function(chunk) { - common.error('recv data! nchars = ' + chunk.length); buffer += chunk; }); conn.on('end', function() { conn.end(); }); - conn.on('close', function() { - common.error('client connection close'); - }); }); var buffer = ''; -var count = 0; server.on('listening', function() { }); diff --git a/test/sequential/test-readdir.js b/test/sequential/test-readdir.js deleted file mode 100644 index 4987dc1848035d..00000000000000 --- a/test/sequential/test-readdir.js +++ /dev/null @@ -1,71 +0,0 @@ -'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var fs = require('fs'); - -var got_error = false, - readdirDir = path.join(common.fixturesDir, 'readdir'); - -var files = ['are', - 'dir', - 'empty', - 'files', - 'for', - 'just', - 'testing.js', - 'these']; - - -console.log('readdirSync ' + readdirDir); -var f = fs.readdirSync(readdirDir); -console.dir(f); -assert.deepEqual(files, f.sort()); - - -console.log('readdir ' + readdirDir); -fs.readdir(readdirDir, function(err, f) { - if (err) { - console.log('error'); - got_error = true; - } else { - console.dir(f); - assert.deepEqual(files, f.sort()); - } -}); - -process.on('exit', function() { - assert.equal(false, got_error); - console.log('exit'); -}); - - -// readdir() on file should throw ENOTDIR -// https://github.com/joyent/node/issues/1869 -(function() { - var has_caught = false; - - try { - fs.readdirSync(__filename); - } - catch (e) { - has_caught = true; - assert.equal(e.code, 'ENOTDIR'); - } - - assert(has_caught); -})(); - - -(function() { - var readdir_cb_called = false; - - fs.readdir(__filename, function(e) { - readdir_cb_called = true; - assert.equal(e.code, 'ENOTDIR'); - }); - - process.on('exit', function() { - assert(readdir_cb_called); - }); -})(); 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-3542.js b/test/sequential/test-regress-GH-3542.js index 2025645ae75d92..77b8cdd69817ac 100644 --- a/test/sequential/test-regress-GH-3542.js +++ b/test/sequential/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/sequential/test-regress-GH-819.js b/test/sequential/test-regress-GH-819.js index e459587d97cba9..20ca75c793ce24 100644 --- a/test/sequential/test-regress-GH-819.js +++ b/test/sequential/test-regress-GH-819.js @@ -1,7 +1,6 @@ 'use strict'; -var common = require('../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'); 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-setproctitle.js b/test/sequential/test-setproctitle.js index 11395f4fdbc52f..40107f5774962f 100644 --- a/test/sequential/test-setproctitle.js +++ b/test/sequential/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/sequential/test-sigint-infinite-loop.js index 8211aeb69ec5db..1570f9c59dd5d3 100644 --- a/test/sequential/test-sigint-infinite-loop.js +++ b/test/sequential/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; 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-stdin-pipe-resume.js b/test/sequential/test-stdin-pipe-resume.js index dbac78d78c5e12..cd409a1d236f53 100644 --- a/test/sequential/test-stdin-pipe-resume.js +++ b/test/sequential/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') { diff --git a/test/sequential/test-stdin-script-child.js b/test/sequential/test-stdin-script-child.js index 8590df02d8efe9..ad65734364e707 100644 --- a/test/sequential/test-stdin-script-child.js +++ b/test/sequential/test-stdin-script-child.js @@ -1,12 +1,12 @@ 'use strict'; -var common = require('../common'); +require('../common'); var assert = require('assert'); var spawn = require('child_process').spawn; var child = spawn(process.execPath, [], { - env: { + env: Object.assign(process.env, { NODE_DEBUG: process.argv[2] - } + }) }); var wanted = child.pid + '\n'; var found = ''; diff --git a/test/sequential/test-stdout-cannot-be-closed-child-process-pipe.js b/test/sequential/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/sequential/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/sequential/test-stdout-close-catch.js index f0ecf9a7c4b725..470fa9843cb9de 100644 --- a/test/sequential/test-stdout-close-catch.js +++ b/test/sequential/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/sequential/test-stdout-stderr-reading.js b/test/sequential/test-stdout-stderr-reading.js index 82fd51cedda1de..2cc029c501c162 100644 --- a/test/sequential/test-stdout-stderr-reading.js +++ b/test/sequential/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/sequential/test-stdout-to-file.js index 41b61df4d72bd5..bd1d97b3d8d278 100644 --- a/test/sequential/test-stdout-to-file.js +++ b/test/sequential/test-stdout-to-file.js @@ -24,7 +24,7 @@ function test(size, useBuffer, cb) { fs.unlinkSync(tmpFile); } catch (e) {} - common.print(size + ' chars to ' + tmpFile + '...'); + console.log(size + ' chars to ' + tmpFile + '...'); childProcess.exec(cmd, function(err) { if (err) throw err; 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-sync-fileread.js b/test/sequential/test-sync-fileread.js index 24a80d96c2601b..6208e4c619efc7 100644 --- a/test/sequential/test-sync-fileread.js +++ b/test/sequential/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/sequential/test-tcp-wrap-listen.js b/test/sequential/test-tcp-wrap-listen.js index a2c07a7a9ce2a2..aa9d810130fd43 100644 --- a/test/sequential/test-tcp-wrap-listen.js +++ b/test/sequential/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/sequential/test-tls-honorcipherorder.js b/test/sequential/test-tls-honorcipherorder.js index cac697c5b02d91..28c930b07edc28 100644 --- a/test/sequential/test-tls-honorcipherorder.js +++ b/test/sequential/test-tls-honorcipherorder.js @@ -10,9 +10,10 @@ 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'; + +// 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() { @@ -24,7 +25,8 @@ function test(honorCipherOrder, clientCipher, expectedCipher, cb) { 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', + ciphers: 'AES256-SHA256:AES128-GCM-SHA256:AES128-SHA256:' + + 'ECDHE-RSA-AES128-GCM-SHA256', honorCipherOrder: !!honorCipherOrder }; @@ -57,37 +59,40 @@ test1(); function test1() { // Client has the preference of cipher suites by default - test(false, 'AES256-SHA:DES-CBC-SHA:RC4-SHA', 'AES256-SHA', test2); + test(false, 'AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256', + 'AES128-GCM-SHA256', 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); + // 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. RC4-SHA is given - // higher priority over DES-CBC-SHA among client cipher suites. - test(true, 'RC4-SHA:AES256-SHA', 'AES256-SHA', test4); + // 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 in regardless + // As client has only one cipher, server has no choice, irrespective // of honorCipherOrder. - test(true, 'RC4-SHA', 'RC4-SHA', test5); + test(true, 'AES128-SHA256', 'AES128-SHA256', 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); + // 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 - SSL_Method = 'TLSv1_2_method'; - tls.DEFAULT_CIPHERS = 'ECDHE-RSA-AES256-SHA'; - test(true, null, 'ECDHE-RSA-AES256-SHA'); + tls.DEFAULT_CIPHERS = 'ECDHE-RSA-AES128-GCM-SHA256'; + test(true, null, 'ECDHE-RSA-AES128-GCM-SHA256'); } diff --git a/test/sequential/test-util-debug.js b/test/sequential/test-util-debug.js index 834c21ec0e50b4..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') @@ -27,12 +27,7 @@ function test(environ, shouldWrite) { var spawn = require('child_process').spawn; var child = spawn(process.execPath, [__filename, 'child'], { - // Lttng requires the HOME env variable or it prints to stderr, - // This is not really ideal, as it breaks this test, so the HOME - // env variable is passed to the child to make the test pass. - // this is fixed in the next version of lttng (2.7+), so we can - // remove it at sometime in the future. - env: { NODE_DEBUG: environ, HOME: process.env.HOME } + env: Object.assign(process.env, { NODE_DEBUG: environ }) }); expectErr = expectErr.split('%PID%').join(child.pid); diff --git a/test/sequential/test-vm-timeout-rethrow.js b/test/sequential/test-vm-timeout-rethrow.js index 4f3af900ee0ae2..dd513b5a694de0 100644 --- a/test/sequential/test-vm-timeout-rethrow.js +++ b/test/sequential/test-vm-timeout-rethrow.js @@ -1,4 +1,5 @@ 'use strict'; +require('../common'); var assert = require('assert'); var vm = require('vm'); var spawn = require('child_process').spawn; diff --git a/test/testpy/__init__.py b/test/testpy/__init__.py index 5933f8b9b62fc3..b1f1519e91274b 100644 --- a/test/testpy/__init__.py +++ b/test/testpy/__init__.py @@ -40,16 +40,19 @@ class SimpleTestCase(test.TestCase): - def __init__(self, path, file, arch, mode, context, config, additional=[]): + def __init__(self, path, file, arch, mode, context, config, additional=None): super(SimpleTestCase, self).__init__(context, path, arch, mode) self.file = file self.config = config self.arch = arch self.mode = mode self.tmpdir = join(dirname(self.config.root), 'tmp') - self.additional_flags = additional + if additional is not None: + self.additional_flags = additional + else: + self.additional_flags = [] + - def GetLabel(self): return "%s %s" % (self.mode, self.GetName()) @@ -81,10 +84,13 @@ def GetSource(self): class SimpleTestConfiguration(test.TestConfiguration): - def __init__(self, context, root, section, additional=[]): + def __init__(self, context, root, section, additional=None): super(SimpleTestConfiguration, self).__init__(context, root) self.section = section - self.additional_flags = additional + if additional is not None: + self.additional_flags = additional + else: + self.additional_flags = [] def Ls(self, path): def SelectTest(name): @@ -110,7 +116,7 @@ def GetTestStatus(self, sections, defs): test.ReadConfigurationInto(status_file, sections, defs) class ParallelTestConfiguration(SimpleTestConfiguration): - def __init__(self, context, root, section, additional=[]): + def __init__(self, context, root, section, additional=None): super(ParallelTestConfiguration, self).__init__(context, root, section, additional) @@ -122,8 +128,8 @@ def ListTests(self, current_path, path, arch, mode): return result class AddonTestConfiguration(SimpleTestConfiguration): - def __init__(self, context, root, section, additional=[]): - super(AddonTestConfiguration, self).__init__(context, root, section) + def __init__(self, context, root, section, additional=None): + super(AddonTestConfiguration, self).__init__(context, root, section, additional) def Ls(self, path): def SelectTest(name): diff --git a/test/timers/test-timers-reliability.js b/test/timers/test-timers-reliability.js index b4332468bc2ec3..76aa6ea31afe4d 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'); @@ -44,7 +44,7 @@ monoTimer.ontimeout = function() { monoTimer.start(300, 0); -var timer = setTimeout(function() { +setTimeout(function() { timerFired = true; }, 200); diff --git a/tools/cpplint.py b/tools/cpplint.py index 5ab156124a2db6..3019395d62df84 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. @@ -541,6 +545,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 +567,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 +618,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.""" @@ -695,37 +708,10 @@ def RepositoryName(self): locations won't see bogus errors. """ fullname = self.FullName() - - if os.path.exists(fullname): - project_dir = os.path.dirname(fullname) - - if os.path.exists(os.path.join(project_dir, ".svn")): - # If there's a .svn file in the current directory, we recursively look - # up the directory tree for the top of the SVN checkout - root_dir = project_dir - one_up_dir = os.path.dirname(root_dir) - while os.path.exists(os.path.join(one_up_dir, ".svn")): - root_dir = os.path.dirname(root_dir) - one_up_dir = os.path.dirname(one_up_dir) - - prefix = os.path.commonprefix([root_dir, project_dir]) - return fullname[len(prefix) + 1:] - - # Not SVN? Try to find a git or hg top level directory by searching up - # from the current path. - root_dir = os.path.dirname(fullname) - while (root_dir != os.path.dirname(root_dir) and - not os.path.exists(os.path.join(root_dir, ".git")) and - not os.path.exists(os.path.join(root_dir, ".hg"))): - root_dir = os.path.dirname(root_dir) - - if (os.path.exists(os.path.join(root_dir, ".git")) or - os.path.exists(os.path.join(root_dir, ".hg"))): - prefix = os.path.commonprefix([root_dir, project_dir]) - return fullname[len(prefix) + 1:] - - # Don't know what to do; header guard warnings may be wrong... - return fullname + # XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory. + toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) + prefix = os.path.commonprefix([fullname, toplevel]) + return fullname[len(prefix) + 1:] def Split(self): """Splits the file into the directory, basename, and extension. @@ -813,6 +799,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)) @@ -2096,7 +2091,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)): @@ -3029,7 +3024,8 @@ 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) + if not _cpplint_state.output_format == 'tap': + sys.stderr.write('Done processing %s\n' % filename) def PrintUsage(message): @@ -3068,7 +3064,8 @@ def ParseArguments(args): try: (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=', 'counting=', - 'filter=']) + 'filter=', + 'logfile=']) except getopt.GetoptError: PrintUsage('Invalid arguments.') @@ -3076,13 +3073,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) @@ -3094,6 +3092,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.') @@ -3102,6 +3102,8 @@ def ParseArguments(args): _SetVerboseLevel(verbosity) _SetFilters(filters) _SetCountingStyle(counting_style) + if output_filename: + _setOutputFile(output_filename) return filenames @@ -3116,6 +3118,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_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..0e8d48fbcb5544 100644 --- a/tools/doc/README.md +++ b/tools/doc/README.md @@ -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..5ff12d342c78b0 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.markdown'); +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 5dfcc5372fe75e..ff14cbd5e8979b 100644 --- a/tools/doc/generate.js +++ b/tools/doc/generate.js @@ -1,9 +1,7 @@ -// USE OR OTHER DEALINGS IN THE SOFTWARE. +'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. @@ -13,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=/)) { @@ -21,7 +19,7 @@ args.forEach(function (arg) { } else if (arg.match(/^\-\-template=/)) { template = arg.replace(/^\-\-template=/, ''); } -}) +}); if (!inputFile) { @@ -37,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..2565c97128b380 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.markdown' +)); var gtocLoading = null; var gtocData = null; @@ -55,7 +65,10 @@ 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) { @@ -64,6 +77,7 @@ function render(lexed, filename, template, cb) { filename = path.basename(filename, '.markdown'); + parseText(lexed); lexed = parseLists(lexed); // generate the table of contents. @@ -85,13 +99,22 @@ 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.text = linkManPages(tok.text); + } + }); +} // just update the list item text in-place. // lists that come right after a heading are what we're after. @@ -106,7 +129,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'; } @@ -153,12 +177,40 @@ function parseLists(input) { } +// 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 parseListItem(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 +218,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 +236,6 @@ function getSection(lexed) { function buildToc(lexed, filename, cb) { - var indent = 0; var toc = []; var depth = 0; lexed.forEach(function(tok) { @@ -219,4 +271,3 @@ function getId(text) { } return text; } - diff --git a/tools/doc/json.js b/tools/doc/json.js index 4c57aefd797eba..299c8ed9fd84ad 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) { @@ -182,14 +184,13 @@ function processList(section) { var type = tok.type; if (type === 'space') return; if (type === 'list_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]; @@ -273,7 +274,7 @@ function parseSignature(text, sig) { params = params[1]; // the [ is irrelevant. ] indicates optionalness. params = params.replace(/\[/g, ''); - params = params.split(/,/) + params = params.split(/,/); params.forEach(function(p, i, _) { p = p.trim(); if (!p) return; @@ -283,7 +284,7 @@ function parseSignature(text, sig) { // [foo] -> optional if (p.charAt(p.length - 1) === ']') { optional = true; - p = p.substr(0, p.length - 1); + p = p.replace(/\]/g, ''); p = p.trim(); } var eq = p.indexOf('='); @@ -362,7 +363,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 +406,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 +477,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 +503,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..8f802714bcb126 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); @@ -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..4d83e872ec1930 --- /dev/null +++ b/tools/doc/type-parser.js @@ -0,0 +1,59 @@ +'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' +]; +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/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 7a975df58a608f..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 new file mode 100644 index 00000000000000..3e4a8e8aadfc82 --- /dev/null +++ b/tools/eslint-rules/required-modules.js @@ -0,0 +1,99 @@ +/** + * @fileoverview Require usage of specified node modules. + * @author Rich Trott + */ +'use strict'; + +var path = require('path'); + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + // trim required module names + var requiredModules = context.options; + + var foundModules = []; + + // if no modules are required we don't need to check the CallExpressions + if (requiredModules.length === 0) { + return {}; + } + + /** + * Function to check if a node is a string literal. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a string literal. + */ + function isString(node) { + return node && node.type === 'Literal' && typeof node.value === 'string'; + } + + /** + * Function to check if a node is a require call. + * @param {ASTNode} node The node to check. + * @returns {boolean} If the node is a require call. + */ + function isRequireCall(node) { + return node.callee.type === 'Identifier' && node.callee.name === 'require'; + } + + /** + * Function to check if a node has an argument that is a required module and + * return its name. + * @param {ASTNode} node The node to check + * @returns {undefined|String} required module name or undefined + */ + function getRequiredModuleName(node) { + var moduleName; + + // node has arguments and first argument is string + if (node.arguments.length && isString(node.arguments[0])) { + var argValue = path.basename(node.arguments[0].value.trim()); + + // check if value is in required modules array + if (requiredModules.indexOf(argValue) !== -1) { + moduleName = argValue; + } + } + + return moduleName; + } + + return { + 'CallExpression': function(node) { + if (isRequireCall(node)) { + var requiredModuleName = getRequiredModuleName(node); + + if (requiredModuleName) { + foundModules.push(requiredModuleName); + } + } + }, + 'Program:exit': function(node) { + if (foundModules.length < requiredModules.length) { + var missingModules = requiredModules.filter( + function(module) { + return foundModules.indexOf(module === -1); + } + ); + missingModules.forEach(function(moduleName) { + context.report( + node, + 'Mandatory module "{{moduleName}}" must be loaded.', + { moduleName: moduleName } + ); + }); + } + } + }; +}; + +module.exports.schema = { + 'type': 'array', + 'additionalItems': { + 'type': 'string' + }, + 'uniqueItems': true +}; diff --git a/tools/eslint/README.md b/tools/eslint/README.md index bb4cc9c8e5a270..d8c797affdd252 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) 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": [2, "always"], + "quotes": [2, "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: + +* `0` - turn the rule off +* `1` - turn the rule on as a warning (doesn't affect exit code) +* `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,25 @@ 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 * 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 +* Toru Nagashima ([@mysticatea](https://github.com/mysticatea)) - committer +* Burak Yiğit Kaya ([@byk](https://github.com/byk)) - committer +* Alberto Rodríguez ([@alberto](https://github.com/alberto)) - 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) +* [Request a Change](http://eslint.org/docs/developer-guide/contributing/changes) ## Frequently Asked Questions @@ -67,23 +109,6 @@ 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: - -* [Box](https://box.com) -* [CustomInk](https://customink.com) -* [Fitbit](http://www.fitbit.com) -* [HolidayCheck](http://holidaycheck.de) -* [the native web](http://www.thenativeweb.io) - ### 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). @@ -102,10 +127,12 @@ Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](ht [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 index 5e0cc800c8c603..598b568ba4e0d4 100755 --- a/tools/eslint/bin/eslint.js +++ b/tools/eslint/bin/eslint.js @@ -1,11 +1,39 @@ #!/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"); + +//------------------------------------------------------------------------------ +// Execution +//------------------------------------------------------------------------------ if (useStdIn) { process.stdin.pipe(concat({ encoding: "string" }, function(text) { @@ -18,13 +46,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 +60,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..f3daaff9b47ab7 --- /dev/null +++ b/tools/eslint/conf/cli-options.js @@ -0,0 +1,33 @@ +/** + * @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, + cwd: process.cwd() +}; 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..9cd9c008302c4a 100644 --- a/tools/eslint/conf/eslint.json +++ b/tools/eslint/conf/eslint.json @@ -1,186 +1,211 @@ { - "ecmaFeatures": {}, "parser": "espree", - "env": { - "browser": false, - "node": false, - "amd": false, - "mocha": false, - "jasmine": false - }, - + "ecmaFeatures": {}, "rules": { - "no-alert": 2, - "no-array-constructor": 2, + "no-alert": 0, + "no-array-constructor": 0, "no-bitwise": 0, - "no-caller": 2, - "no-catch-shadow": 2, - "no-comma-dangle": 0, + "no-caller": 0, + "no-case-declarations": 2, + "no-catch-shadow": 0, + "no-class-assign": 2, "no-cond-assign": 2, + "no-confusing-arrow": 0, "no-console": 2, + "no-const-assign": 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-class-members": 2, "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-empty-function": 0, + "no-empty-pattern": 2, "no-eq-null": 0, - "no-eval": 2, + "no-eval": 0, "no-ex-assign": 2, - "no-extend-native": 2, - "no-extra-bind": 2, + "no-extend-native": 0, + "no-extra-bind": 0, "no-extra-boolean-cast": 2, + "no-extra-label": 0, "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-implicit-coercion": 0, + "no-implicit-globals": 0, + "no-implied-eval": 0, "no-inline-comments": 0, - "no-inner-declarations": [2, "functions"], + "no-inner-declarations": 2, "no-invalid-regexp": 2, + "no-invalid-this": 0, "no-irregular-whitespace": 2, - "no-iterator": 2, - "no-label-var": 2, - "no-labels": 2, - "no-lone-blocks": 2, + "no-iterator": 0, + "no-label-var": 0, + "no-labels": 0, + "no-lone-blocks": 0, "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-loop-func": 0, + "no-mixed-requires": 0, + "no-mixed-spaces-and-tabs": 2, + "linebreak-style": 0, + "no-multi-spaces": 0, + "no-multi-str": 0, + "no-multiple-empty-lines": 0, + "no-native-reassign": 0, + "no-negated-condition": 0, "no-negated-in-lhs": 2, "no-nested-ternary": 0, - "no-new": 2, - "no-new-func": 2, - "no-new-object": 2, + "no-new": 0, + "no-new-func": 0, + "no-new-object": 0, "no-new-require": 0, - "no-new-wrappers": 2, + "no-new-symbol": 2, + "no-new-wrappers": 0, "no-obj-calls": 2, "no-octal": 2, - "no-octal-escape": 2, + "no-octal-escape": 0, "no-param-reassign": 0, "no-path-concat": 0, "no-plusplus": 0, "no-process-env": 0, - "no-process-exit": 2, - "no-proto": 2, + "no-process-exit": 0, + "no-proto": 0, "no-redeclare": 2, "no-regex-spaces": 2, - "no-reserved-keys": 0, + "no-restricted-imports": 0, "no-restricted-modules": 0, - "no-return-assign": 2, - "no-script-url": 2, + "no-restricted-syntax": 0, + "no-return-assign": 0, + "no-script-url": 0, + "no-self-assign": 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-sequences": 0, + "no-shadow": 0, + "no-shadow-restricted-names": 0, + "no-whitespace-before-property": 0, + "no-spaced-func": 0, "no-sparse-arrays": 2, "no-sync": 0, "no-ternary": 0, - "no-trailing-spaces": 2, - "no-this-before-super": 0, + "no-trailing-spaces": 0, + "no-this-before-super": 2, "no-throw-literal": 0, "no-undef": 2, - "no-undef-init": 2, + "no-undef-init": 0, "no-undefined": 0, - "no-unexpected-multiline": 0, - "no-underscore-dangle": 2, + "no-unexpected-multiline": 2, + "no-underscore-dangle": 0, + "no-unmodified-loop-condition": 0, "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-unused-expressions": 0, + "no-unused-labels": 2, + "no-unused-vars": 2, + "no-use-before-define": 0, + "no-useless-call": 0, + "no-useless-concat": 0, + "no-useless-constructor": 0, "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, + "no-warning-comments": 0, + "no-with": 0, + "no-magic-numbers": 0, - "array-bracket-spacing": [0, "never"], + "array-bracket-spacing": 0, + "array-callback-return": 0, + "arrow-body-style": 0, + "arrow-parens": 0, + "arrow-spacing": 0, "accessor-pairs": 0, "block-scoped-var": 0, - "brace-style": [0, "1tbs"], - "camelcase": 2, - "comma-dangle": [2, "never"], - "comma-spacing": 2, + "block-spacing": 0, + "brace-style": 0, + "callback-return": 0, + "camelcase": 0, + "comma-dangle": 2, + "comma-spacing": 0, "comma-style": 0, "complexity": [0, 11], - "computed-property-spacing": [0, "never"], - "consistent-return": 2, - "consistent-this": [0, "that"], - "constructor-super": 0, - "curly": [2, "all"], + "computed-property-spacing": 0, + "consistent-return": 0, + "consistent-this": 0, + "constructor-super": 2, + "curly": 0, "default-case": 0, "dot-location": 0, - "dot-notation": [2, { "allowKeywords": true }], - "eol-last": 2, - "eqeqeq": 2, + "dot-notation": 0, + "eol-last": 0, + "eqeqeq": 0, "func-names": 0, - "func-style": [0, "declaration"], - "generator-star": 0, + "func-style": 0, "generator-star-spacing": 0, - "global-strict": [2, "never"], + "global-require": 0, "guard-for-in": 0, "handle-callback-err": 0, + "id-length": 0, "indent": 0, - "key-spacing": [2, { "beforeColon": false, "afterColon": true }], + "init-declarations": 0, + "jsx-quotes": 0, + "key-spacing": 0, + "keyword-spacing": 0, "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, + "max-depth": 0, + "max-len": 0, + "max-nested-callbacks": 0, + "max-params": 0, + "max-statements": 0, + "new-cap": 0, + "new-parens": 0, "newline-after-var": 0, + "newline-per-chained-call": 0, "object-curly-spacing": [0, "never"], "object-shorthand": 0, "one-var": 0, - "operator-assignment": [0, "always"], + "one-var-declaration-per-line": 0, + "operator-assignment": 0, "operator-linebreak": 0, "padded-blocks": 0, + "prefer-arrow-callback": 0, + "prefer-const": 0, + "prefer-reflect": 0, + "prefer-rest-params": 0, + "prefer-spread": 0, + "prefer-template": 0, "quote-props": 0, - "quotes": [2, "double"], + "quotes": 0, "radix": 0, - "semi": 2, - "semi-spacing": [2, {"before": false, "after": true}], + "id-match": 0, + "id-blacklist": 0, + "require-jsdoc": 0, + "require-yield": 0, + "semi": 0, + "semi-spacing": 0, "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 }], + "sort-imports": 0, + "space-before-blocks": 0, + "space-before-function-paren": 0, + "space-in-parens": 0, + "space-infix-ops": 0, + "space-unary-ops": 0, "spaced-comment": 0, - "spaced-line-comment": [0, "always"], - "strict": 2, + "strict": 0, + "template-curly-spacing": 0, "use-isnan": 2, "valid-jsdoc": 0, "valid-typeof": 2, "vars-on-top": 0, "wrap-iife": 0, "wrap-regex": 0, - "yoda": [2, "never"] + "yield-star-spacing": 0, + "yoda": 0 } } 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..f9c04ceab37006 --- /dev/null +++ b/tools/eslint/lib/ast-utils.js @@ -0,0 +1,433 @@ +/** + * @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; + + return (identifier && + 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) + ); +} + +/** + * 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); + }); +} + +//------------------------------------------------------------------------------ +// 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, + getUpperFunction: getUpperFunction, + isArrayFromMethod: isArrayFromMethod, + + /** + * 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..e3d72c6bb5e5b5 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,26 @@ var fs = require("fs"), path = require("path"), - assign = require("object-assign"), + lodash = require("lodash"), debug = require("debug"), + glob = require("glob"), + shell = require("shelljs"), 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"), + + crypto = require( "crypto" ), + pkg = require("../package.json"); + //------------------------------------------------------------------------------ // Typedefs @@ -38,8 +49,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 @@ -67,21 +77,7 @@ var fs = require("fs"), // 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); +defaultOptions = lodash.assign({}, defaultOptions, {cwd: process.cwd()}); //------------------------------------------------------------------------------ // Helpers @@ -89,34 +85,6 @@ var defaultOptions = { 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 +127,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(); @@ -172,7 +142,9 @@ function processText(text, configHelper, filename) { messages, stats, fileExtension = path.extname(filename), - processor; + processor, + loadedPlugins, + fixedResult; if (filename) { filePath = path.resolve(filename); @@ -181,7 +153,12 @@ function processText(text, configHelper, 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 +168,48 @@ 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 +217,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"), + result = processText(text, configHelper, filename, options.fix, options.allowInlineConfig); - var text = fs.readFileSync(path.resolve(filename), "utf8"); + return result; - return processText(text, configHelper, filename); } /** @@ -234,12 +238,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 +251,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; +} + +/** + * create a md5Hash of a given string + * @param {string} str the string to calculate the hash for + * @returns {string} the calculated hash + */ +function md5Hash(str) { + return crypto + .createHash("md5") + .update(str, "utf8") + .digest("hex"); +} + +/** + * 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_" + md5Hash(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 +347,33 @@ function createIgnoreResult(filePath) { */ function CLIEngine(options) { + options = lodash.assign(Object.create(null), defaultOptions, 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 not operate on files that haven't changed since last successful + * execution (e.g. file passed 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 +382,79 @@ 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) { + formatterPath = path.resolve(this.options.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 +466,184 @@ 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.extensions); }, /** * 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; + ignoredPaths = new IgnoredPaths(options), + globOptions, + stats, + startTime, + prevConfig; // the previous configuration used - traverse({ - files: files, - extensions: options.extensions, - exclude: options.ignore ? exclude : false - }, function(filename) { + startTime = Date.now(); - debug("Processing " + filename); + globOptions = { + nodir: true + }; - processed.push(filename); - results.push(processFile(filename, configHelper)); - }); + var cwd = options.cwd || process.cwd; + patterns = this.resolveFileGlobPatterns(patterns.map(function(pattern) { + if (pattern.indexOf("/") > 0) { + return path.join(cwd, pattern); + } + return pattern; + })); + + /** + * 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; - // 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)); + var eslintVersion = pkg.version; + + prevConfig.hash = md5Hash(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 (options.ignore !== false) { + + if (ignoredPaths.contains(filename, "custom")) { + if (warnIgnored) { + results.push(createIgnoreResult(filename)); + } + return; } - }); + + if (ignoredPaths.contains(filename, "default")) { + return; + } + + } + + filename = path.resolve(filename); + if (processed[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 || {}; + + 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) + // cause we don't save to cache files that failed + // 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[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); + // 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 error 0 warnings + descriptor.meta.hashOfConfig = hashOfConfig; + descriptor.meta.results = res; + } + } + + results.push(res); } + patterns.forEach(function(pattern) { + + var file = path.resolve(pattern); + + if (shell.test("-f", file)) { + executeOnFile(fs.realpathSync(pattern), !shell.test("-d", file)); + } else { + glob.sync(pattern, globOptions).forEach(function(globMatch) { + executeOnFile(globMatch, false); + }); + } + + }); + 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 +663,12 @@ CLIEngine.prototype = { stats, options = this.options, configHelper = new Config(options), - ignoredPaths = IgnoredPaths.load(options), - exclude = ignoredPaths.contains.bind(ignoredPaths); + ignoredPaths = new IgnoredPaths(options); - if (filename && options.ignore && exclude(filename)) { + if (filename && (options.ignore !== false) && ignoredPaths.contains(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); @@ -387,54 +697,18 @@ 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; if (this.options.ignore) { - ignoredPaths = IgnoredPaths.load(this.options); + ignoredPaths = new IgnoredPaths(this.options); return ignoredPaths.contains(filePath); } 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..979060d3f99760 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,13 @@ function translateOptions(cliOptions) { ignorePattern: cliOptions.ignorePattern, configFile: cliOptions.config, rulePaths: cliOptions.rulesdir, - reset: cliOptions.reset, - useEslintrc: cliOptions.eslintrc + useEslintrc: cliOptions.eslintrc, + parser: cliOptions.parser, + cache: cliOptions.cache, + cacheFile: cliOptions.cacheFile, + cacheLocation: cliOptions.cacheLocation, + fix: cliOptions.fix, + allowInlineConfig: cliOptions.inlineConfig }; } @@ -69,7 +75,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 +86,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 +94,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 +106,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 +126,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 +141,59 @@ 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..aa2a6ff4acb1f1 --- /dev/null +++ b/tools/eslint/lib/code-path-analysis/code-path-analyzer.js @@ -0,0 +1,640 @@ +/** + * @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..94deafbfbb1d0c --- /dev/null +++ b/tools/eslint/lib/code-path-analysis/code-path-segment.js @@ -0,0 +1,208 @@ +/** + * @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 + }}); + + /* istanbul ignore if */ + if (debug.enabled) { + this.internal.nodes = []; + this.internal.exitNodes = []; + } +} + +/** + * 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); + } + } +}; + +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..121df319fa642f --- /dev/null +++ b/tools/eslint/lib/code-path-analysis/code-path-state.js @@ -0,0 +1,1323 @@ +/** + * @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); + + 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..200ff434b8d417 --- /dev/null +++ b/tools/eslint/lib/code-path-analysis/code-path.js @@ -0,0 +1,118 @@ +/** + * @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; + } +}; + +/** + * 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..d8c26ad1b85e67 --- /dev/null +++ b/tools/eslint/lib/code-path-analysis/debug-helpers.js @@ -0,0 +1,197 @@ +/** + * @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..8716ddd6ffa7d1 --- /dev/null +++ b/tools/eslint/lib/code-path-analysis/fork-context.js @@ -0,0 +1,258 @@ +/** + * @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..c37e7d7e5b92ac --- /dev/null +++ b/tools/eslint/lib/code-path-analysis/id-generator.js @@ -0,0 +1,43 @@ +/** + * @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..6f445a44a50aa8 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,152 +35,59 @@ 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_PATH && fs.existsSync(PERSONAL_CONFIG_PATH)) { - debug("Using personal config"); - config = loadConfig(PERSONAL_CONFIG_PATH); + if (PERSONAL_CONFIG_DIR) { + filename = ConfigFile.getFilenameForDirectory(PERSONAL_CONFIG_DIR); + + if (filename) { + debug("Using personal config"); + config = loadConfig(filename); + } } 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,26 +165,18 @@ function Config(options) { this.ignore = options.ignore; this.ignorePath = options.ignorePath; this.cache = {}; + this.parser = options.parser; - 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) { + this.globals = (options.globals || []).reduce(function(globals, def) { // Default "foo" to false and handle "foo:false" and "foo:true" var parts = def.split(":"); globals[parts[0]] = (parts.length > 1 && parts[1] === "true"); @@ -332,7 +188,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 +202,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 +216,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 +226,40 @@ Config.prototype.getConfig = function (filePath) { } // Step 2: Create a copy of the baseConfig - config = util.mergeConfigs({}, this.baseConfig); + config = ConfigOps.merge({parser: this.parser}, this.baseConfig); - // Step 3: Merge in environment-specific globals and rules from .eslintrc files - config = util.mergeConfigs(config, createEnvironmentConfig(userConfig.env, this.options.reset)); + // Step 3: Merge in the user-specified configuration from .eslintrc and package.json + config = ConfigOps.merge(config, userConfig); - // Step 4: Merge in the user-specified configuration from .eslintrc and package.json - config = util.mergeConfigs(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 +272,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..1b7493bf07abe0 --- /dev/null +++ b/tools/eslint/lib/config/autoconfig.js @@ -0,0 +1,336 @@ +/** + * @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"), + 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 either has fewer than the max cominbations allowed, or if it has + // too many configs, we will only use the most basic of them. + 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); + var recRules = Object.keys(recConfig.rules).filter(function(ruleId) { + return (recConfig.rules[ruleId] === 2 || recConfig.rules[ruleId][0] === 2); + }); + + 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..beb97c72a48adf --- /dev/null +++ b/tools/eslint/lib/config/config-file.js @@ -0,0 +1,503 @@ +/** + * @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"), + resolveModule = require("resolve"), + pathIsInside = require("path-is-inside"), + stripComments = require("strip-json-comments"), + stringify = require("json-stable-stringify"), + isAbsolutePath = require("path-is-absolute"); + + +//------------------------------------------------------------------------------ +// 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" +]; + +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 require(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; + + var 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 lookup path for node packages referenced in a config file. + * If the config + * @param {string} configFilePath The config file referencing the file. + * @returns {string} The lookup path for the file path. + * @private + */ +function getLookupPath(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.resolve(configFilePath); + } + + // default to ESLint project path since it's unlikely that plugins will be + // in this directory + return projectPath; +} + +/** + * 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. + * @returns {Object} A new configuration object with all of the "extends" fields + * loaded and merged. + * @private + */ +function applyExtends(config, filePath) { + 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), 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) { + 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 { + 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); + filePath = resolveModule.sync(normalizePackageName(packagePath, "eslint-plugin"), { + basedir: getLookupPath(relativeTo) + }); + return { filePath: filePath, configName: configName }; + } else { + filePath = resolveModule.sync(normalizePackageName(filePath, "eslint-config"), { + basedir: 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. + * @returns {Object} The configuration information. + * @private + */ +function load(filePath, applyEnvironments) { + + var resolvedPath = resolve(filePath), + config = loadConfigFile(resolvedPath); + + if (config) { + + // ensure plugins are properly loaded first + if (config.plugins) { + Plugins.loadAll(config.plugins); + } + + // include full path of parser if present + if (config.parser) { + config.parser = resolveModule.sync(config.parser, { + basedir: getLookupPath(path.dirname(path.resolve(filePath))) + }); + } + + // 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); + } + + if (config.env && applyEnvironments) { + // Merge in environment-specific globals and parserOptions. + config = ConfigOps.applyEnvironments(config); + } + + } + + return config; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + + getLookupPath: getLookupPath, + load: load, + resolve: resolve, + write: write, + applyExtends: applyExtends, + 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..ffa0a406dc6a68 --- /dev/null +++ b/tools/eslint/lib/config/config-initializer.js @@ -0,0 +1,469 @@ +/** + * @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"), + 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 (recConfig.rules[ruleId] === 2 || recConfig.rules[ruleId][0] === 2); + }); + + // 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 totalRules = Object.keys(newConfig.rules).length; + var enabledRules = Object.keys(newConfig.rules).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); + 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 = [2, answers.indent]; + config.rules.quotes = [2, answers.quotes]; + config.rules["linebreak-style"] = [2, answers.linebreak]; + config.rules.semi = [2, answers.semi ? "always" : "never"]; + } + + installModules(config); + + if (answers.source === "auto") { + config = configureRules(answers, config); + config = autoconfig.extendFromRecommended(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 { + if (secondAnswers.jsx) { + log.error("Unfortunately, autoconfig does not yet work for JSX code.\nPlease see https://github.com/eslint/eslint/issues/5007 for current status."); + return; + } + 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: "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: "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..4e36563c1db1f1 --- /dev/null +++ b/tools/eslint/lib/config/config-ops.js @@ -0,0 +1,182 @@ +/** + * @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"); + +//------------------------------------------------------------------------------ +// 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 || []; + if (isRule && 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; + } + + +}; diff --git a/tools/eslint/lib/config/config-rule.js b/tools/eslint/lib/config/config-rule.js new file mode 100644 index 00000000000000..72ad88a73e1c44 --- /dev/null +++ b/tools/eslint/lib/config/config-rule.js @@ -0,0 +1,308 @@ +/** + * @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..852a5dce0ecabf --- /dev/null +++ b/tools/eslint/lib/config/config-validator.js @@ -0,0 +1,172 @@ +/** + * @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"); + +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); + + 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 = warning, 2 = error (you passed \"", severity, "\").\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..7281e48eabfc39 --- /dev/null +++ b/tools/eslint/lib/config/plugins.js @@ -0,0 +1,144 @@ +/** + * @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; + 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..36e0970f74c648 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"), + estraverse = require("./util/estraverse"), 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,9 +38,10 @@ 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, ":"); @@ -48,7 +58,10 @@ function parseBooleanConfig(string) { name = name.substring(0, pos); } - items[name] = (value === "true"); + items[name] = { + value: (value === "true"), + comment: comment + }; }); return items; @@ -66,14 +79,16 @@ function parseJsonConfig(string, location, messages) { 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 }); } @@ -100,25 +115,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 +126,70 @@ 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]; + 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 that their definition 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; + } + return true; }); } @@ -240,11 +265,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 +280,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+|eslint-\w+-\w+|eslint|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": @@ -300,14 +330,15 @@ function modifyConfigsFromComments(filename, ast, config, reportingConfig, messa }); // 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); } /** @@ -343,7 +374,7 @@ function prepareConfig(config) { delete config.global; var copiedRules = {}, - ecmaFeatures = {}, + parserOptions = {}, preparedConfig; if (typeof config.rules === "object") { @@ -360,32 +391,116 @@ 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 six 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 +513,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, reportingConfig = [], - commentLocsEnter = [], - commentLocsExit = [], - currentAST = null; + sourceCode = null; /** * Parses text into an AST. Moved out here because the try-catch prevents @@ -423,14 +533,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 +559,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 +571,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 +593,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,117 +632,165 @@ 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; 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); + } // 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; - + ecmaFeatures = currentConfig.parserOptions.ecmaFeatures || {}; + ecmaVersion = currentConfig.parserOptions.ecmaVersion || 5; // gather 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" }); currentScopes = scopeManager.scopes; @@ -672,7 +799,7 @@ 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 @@ -682,21 +809,6 @@ module.exports = (function() { } }); - /* - * 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,6 +821,10 @@ 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 @@ -716,24 +832,13 @@ module.exports = (function() { */ controller.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,167 +866,100 @@ 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; - - /** - * 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) === "*") { + // copy over methods + Object.keys(externalMethods).forEach(function(methodName) { + var exMethodName = externalMethods[methodName]; - 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. @@ -931,32 +969,6 @@ module.exports = (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; - }; - /** * Gets the scope for the current node. * @returns {Object} An object representing the current node's scope. @@ -968,17 +980,23 @@ module.exports = (function() { // 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 + // if current node introduces a scope, add it to the list var current = controller.current(); - if (["FunctionDeclaration", "FunctionExpression", - "ArrowFunctionExpression", "SwitchStatement"].indexOf(current.type) >= 0) { - parents.push(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 +1020,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; @@ -1067,6 +1086,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..f0ae19a7875cb2 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,55 @@ 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 +97,27 @@ 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 +135,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 +156,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..f1eb83aec35f39 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"; 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..ba6f3e513efa45 --- /dev/null +++ b/tools/eslint/lib/formatters/html.js @@ -0,0 +1,130 @@ +/** + * @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..64357263313322 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"; @@ -40,11 +46,11 @@ 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..cd9ec0e33a227e 100644 --- a/tools/eslint/lib/formatters/tap.js +++ b/tools/eslint/lib/formatters/tap.js @@ -66,7 +66,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..2782b0cd0e3568 --- /dev/null +++ b/tools/eslint/lib/formatters/unix.js @@ -0,0 +1,59 @@ +/** + * @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..2d04aaef55d5f9 --- /dev/null +++ b/tools/eslint/lib/formatters/visualstudio.js @@ -0,0 +1,64 @@ +/** + * @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..01e56bdc7c26c2 100644 --- a/tools/eslint/lib/ignored-paths.js +++ b/tools/eslint/lib/ignored-paths.js @@ -8,10 +8,11 @@ // 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"); debug = debug("eslint:ignored-paths"); @@ -21,50 +22,94 @@ 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] !== "#"; - } - - 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; - } - } + var ignoreFilePath = path.resolve(cwd, ESLINT_IGNORE_FILENAME); + return fs.existsSync(ignoreFilePath) ? ignoreFilePath : ""; +} - return ["node_modules/**"].concat(ignorePatterns); +/** + * Replace Windows with Unix style paths and remove ./ prefix + * @param {string} filepath Path to normalize + * @returns {string} Normalized filepath + */ +function normalizeFilepath(filepath) { + filepath = filepath.replace(/\\/g, "/"); + filepath = filepath.replace(/^\.\//, ""); + return filepath; } -var ignoreFileFinder; +/** + * Remove a prefix from a filepath + * @param {string} filepath Path to remove the prefix from + * @param {string} prefix Prefix to remove from filepath + * @returns {string} Normalized filepath + */ +function removePrefixFromFilepath(filepath, prefix) { + prefix += "/"; + if (filepath.indexOf(prefix) === 0) { + filepath = filepath.substr(prefix.length); + } + return filepath; +} /** - * Find an ignore file in the current directory or a parent directory. - * @returns {string} Path of ignore file or an empty string. + * Resolves a filepath + * @param {string} filepath Path resolve + * @param {string} baseDir Base directory to resolve the filepath from + * @returns {string} Resolved filepath */ -function findIgnoreFile() { - if (!ignoreFileFinder) { - ignoreFileFinder = new FileFinder(ESLINT_IGNORE_FILENAME); +function resolveFilepath(filepath, baseDir) { + if (baseDir) { + var base = normalizeFilepath(path.resolve(baseDir)); + filepath = removePrefixFromFilepath(filepath, base); + filepath = removePrefixFromFilepath(filepath, fs.realpathSync(base)); } + filepath.replace(/^\//, ""); + return filepath; +} - return ignoreFileFinder.findInDirectoryOrParents(); +/** + * Normalize and resolve a filepath relative to a given base directory + * @param {string} filepath Path resolve + * @param {string} baseDir Base directory to resolve the filepath from + * @returns {string} Normalized and resolved filepath + */ +function normalizeAndResolveFilepath(filepath, baseDir) { + filepath = normalizeFilepath(filepath); + return resolveFilepath(filepath, baseDir); } +/** + * Merge options with defaults + * @param {object} options Options to merge with DEFAULT_OPTIONS constant + * @returns {object} Merged options + */ +function mergeDefaultOptions(options) { + options = (options || {}); + return lodash.assign({}, DEFAULT_OPTIONS, options); +} //------------------------------------------------------------------------------ // Public Interface @@ -74,64 +119,116 @@ function findIgnoreFile() { * IgnoredPaths * @constructor * @class IgnoredPaths - * @param {Array} patterns to be matched against file paths - */ -function IgnoredPaths(patterns) { - this.patterns = patterns; -} - -/** - * IgnoredPaths initializer - * @param {Object} options object containing 'ignore' and 'ignorePath' properties - * @returns {IgnoredPaths} object, with patterns loaded from the ignore file + * @param {Object} options object containing 'ignore', 'ignorePath' and 'patterns' properties */ -IgnoredPaths.load = function (options) { - var 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); + } - options = options || {}; + /** + * 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) { + return ig.addIgnoreFile(filepath); + } - if (options.ignore) { - patterns = loadIgnoreFile(options.ignorePath || findIgnoreFile()); - } else { - patterns = []; + this.defaultPatterns = DEFAULT_IGNORE_PATTERNS.concat(options.patterns || []); + this.baseDir = "."; + + this.ig = { + custom: new ignore.Ignore({ + twoGlobstars: true, + ignore: [] + }), + default: new ignore.Ignore({ + twoGlobstars: true, + ignore: [] + }) + }; + + if (options.dotfiles !== true) { + addPattern(this.ig.default, ".*"); } - if (options.ignorePattern) { - patterns.push(options.ignorePattern); + if (options.ignore !== false) { + + addPattern(this.ig.default, this.defaultPatterns); + + var ignorePath; + + if (options.ignorePattern) { + addPattern(this.ig.custom, 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(ignorePath); + addIgnoreFile(this.ig.custom, 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; + filepath = normalizeAndResolveFilepath(filepath, this.baseDir); - if (negated) { - pattern = pattern.slice(1); - } + if ((typeof category === "undefined") || (category === "default")) { + result = result || (this.ig.default.filter([filepath]).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([filepath]).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..8c0fdd75ce0e93 100644 --- a/tools/eslint/lib/load-rules.js +++ b/tools/eslint/lib/load-rules.js @@ -18,14 +18,15 @@ 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); @@ -33,7 +34,7 @@ module.exports = function(rulesDir) { 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..b5e7260519dc72 --- /dev/null +++ b/tools/eslint/lib/logging.js @@ -0,0 +1,25 @@ +/** + * @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..ba3b7fa2037cac 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,202 @@ 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" + }, + { + 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: "Outputs 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..e70ba6686ace5c 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) { + // public. + this.id = ruleId; + this.options = options; + this.settings = settings; + this.parserOptions = parserOptions; + this.parserPath = parserPath; + this.meta = meta; - /** - * The read-only ID of the rule. - */ - Object.defineProperty(this, "id", { - value: ruleId - }); + // private. + this.eslint = eslint; + this.severity = severity; - /** - * The read-only options of the rule - */ - Object.defineProperty(this, "options", { - value: options - }); + Object.freeze(this); +} - /** - * The read-only settings shared between all rules - */ - Object.defineProperty(this, "settings", { - value: settings - }); +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 +PASSTHROUGHS.forEach(function(name) { + // All functions expected to have less arguments than 5. + 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..77fb7749e43145 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,71 @@ 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..4c8032b8e4dd13 100644 --- a/tools/eslint/lib/rules/accessor-pairs.js +++ b/tools/eslint/lib/rules/accessor-pairs.js @@ -6,60 +6,145 @@ "use strict"; +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * 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; + } + + // Object.defineProperties(obj, {foo: {set: ...}}) + // Object.create(proto, {foo: {set: ...}}) + node = node.parent.parent; + return node.type === "ObjectExpression" && ( + isArgumentOfMethodCall(node, 1, "Object", "create") || + isArgumentOfMethodCall(node, 1, "Object", "defineProperties") + ); +} + //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function(context) { - var config = context.options[0] || {}; - var checkGetWithoutSet = config.getWithoutSet === true; - var checkSetWithoutGet = config.setWithoutGet !== false; - - /** - * 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 propLength = node.properties.length; - - for (var i = 0; i < propLength; i++) { - var propToCheck = node.properties[i].kind === "init" ? node.properties[i].key.name : node.properties[i].kind; - - switch (propToCheck) { - case "set": - isSetPresent = 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; - case "get": - isGetPresent = true; - break; + /** + * 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); - default: - // Do nothing - } + for (var i = 0, end = node.properties.length; i < end; i++) { + var property = node.properties[i]; - if (isSetPresent && isGetPresent) { - break; - } - } + var propToCheck = ""; + if (property.kind === "init") { + if (isDescriptor && !property.computed) { + propToCheck = property.key.name; + } + } else { + propToCheck = property.kind; + } - if (checkSetWithoutGet && isSetPresent && !isGetPresent) { - context.report(node, "Getter is not present"); - } else if (checkGetWithoutSet && isGetPresent && !isSetPresent) { - context.report(node, "Setter is not present"); - } - } + 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..5716a1215228b6 100644 --- a/tools/eslint/lib/rules/array-bracket-spacing.js +++ b/tools/eslint/lib/rules/array-bracket-spacing.js @@ -8,173 +8,210 @@ */ "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..9489b810f77e38 --- /dev/null +++ b/tools/eslint/lib/rules/array-callback-return.js @@ -0,0 +1,236 @@ +/** + * @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..e7e6b6bdb47330 --- /dev/null +++ b/tools/eslint/lib/rules/arrow-body-style.js @@ -0,0 +1,58 @@ +/** + * @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..cb71dd400c716d --- /dev/null +++ b/tools/eslint/lib/rules/arrow-spacing.js @@ -0,0 +1,124 @@ +/** + * @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 }; + var 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..28755558f184f8 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,94 @@ //------------------------------------------------------------------------------ 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); + function report(reference) { + var identifier = reference.identifier; + context.report( + identifier, + "'{{name}}' used outside of binding context.", + {name: identifier.name}); } - //-------------------------------------------------------------------------- - // Public API - //-------------------------------------------------------------------------- - /** - * Declares all relevant identifiers for module imports. - * @param {ASTNode} node The AST node representing an import. + * Finds and reports references which are outside of valid scopes. + * @param {ASTNode} node - A node to get variables. * @returns {void} - * @private */ - function declareImports(node) { - declare([node.local.name]); - - if (node.imported && node.imported.name !== node.local.name) { - declare([node.imported.name]); + function checkForVariables(node) { + if (node.kind !== "var") { + return; } - } - - /** - * Declares all relevant identifiers for classes. - * @param {ASTNode} node The AST node representing a class. - * @returns {void} - * @private - */ - function declareClass(node) { - if (node.id) { - declare([node.id.name]); + // Defines a predicate to check whether or not a given reference is outside of valid scope. + var scopeRange = stack[stack.length - 1]; + + /** + * 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; + return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1]; } - pushScope(); - } - - /** - * 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]); - } - - /** - * 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 + // Gets declared variables, and checks its references. + var variables = context.getDeclaredVariables(node); + for (var i = 0; i < variables.length; ++i) { + // Reports. + variables[i] + .references + .filter(isOutsideOfScope) + .forEach(report); } - - declare(declarations); - - } - - /** - * 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); - }); - } 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]); - }, - "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(); + "Program": function(node) { + stack = [node.range]; }, - "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..4df8d59763c287 --- /dev/null +++ b/tools/eslint/lib/rules/block-spacing.js @@ -0,0 +1,119 @@ +/** + * @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..04ef0188dda5e4 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 @@ -57,28 +59,30 @@ module.exports = function(context) { return function(node) { [].forEach.call(blockProperties, function(blockProp) { var block = node[blockProp], previousToken, curlyToken, curlyTokenEnd, curlyTokensOnSameLine; - block = node[blockProp]; - if (isBlock(block)) { + if (!isBlock(block)) { + return; + } - previousToken = context.getTokenBefore(block); - curlyToken = context.getFirstToken(block); - curlyTokenEnd = context.getLastToken(block); - curlyTokensOnSameLine = curlyToken.loc.start.line === curlyTokenEnd.loc.start.line; + previousToken = sourceCode.getTokenBefore(block); + curlyToken = sourceCode.getFirstToken(block); + curlyTokenEnd = sourceCode.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 (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 && !params.allowSingleLine) { + context.report(node, OPEN_MESSAGE_ALLMAN); + } - 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); - } + if (!block.body.length || curlyTokensOnSameLine && params.allowSingleLine) { + return; + } - } else if (block.body.length && curlyToken.loc.start.line === block.body[0].loc.start.line) { - context.report(block.body[0], BODY_MESSAGE); - } + if (curlyToken.loc.start.line === block.body[0].loc.start.line) { + context.report(block.body[0], BODY_MESSAGE); + } else 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 +95,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 +128,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 +146,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 +156,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); } } } @@ -178,15 +173,15 @@ 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 +209,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..49e5da6239aad4 --- /dev/null +++ b/tools/eslint/lib/rules/callback-return.js @@ -0,0 +1,143 @@ +/** + * @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..1294a548d77f4d 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] || {}, @@ -48,7 +54,6 @@ module.exports = function(context) { return { "Identifier": function(node) { - // 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; @@ -78,12 +83,16 @@ module.exports = function(context) { // Properties have their own rules } else if (node.parent.type === "Property") { - // "never" check properties if (properties === "never") { 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..c197b783dc35f9 100644 --- a/tools/eslint/lib/rules/comma-dangle.js +++ b/tools/eslint/lib/rules/comma-dangle.js @@ -1,65 +1,232 @@ /** * @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"; +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Gets the last element of a given array. + * + * @param {*[]} xs - An array to get. + * @returns {*} The last element, or undefined. + */ +function getLast(xs) { + if (xs.length === 0) { + return null; + } + return xs[xs.length - 1]; +} + +/** + * 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 = getLast(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 = getLast(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 = getLast(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..aa89c1414f6163 100644 --- a/tools/eslint/lib/rules/complexity.js +++ b/tools/eslint/lib/rules/complexity.js @@ -12,7 +12,7 @@ module.exports = function(context) { - var THRESHOLD = context.options[0]; + var THRESHOLD = (typeof context.options[0] !== "undefined") ? context.options[0] : 20; //-------------------------------------------------------------------------- // Helpers @@ -21,18 +21,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,12 +51,23 @@ module.exports = function(context) { } } + /** + * Increase the complexity of the function in context + * @returns {void} + * @private + */ function increaseComplexity() { if (fns.length) { 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) { @@ -54,6 +75,12 @@ module.exports = function(context) { } } + /** + * Increase the logical path complexity in context + * @param {ASTNode} node node to evaluate + * @returns {void} + * @private + */ function increaseLogicalComplexity(node) { // Avoiding && if (node.operator === "||") { @@ -89,6 +116,7 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "type": "integer", + "minimum": 0 } ]; 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..2c988bb4221d25 100644 --- a/tools/eslint/lib/rules/consistent-return.js +++ b/tools/eslint/lib/rules/consistent-return.js @@ -5,71 +5,108 @@ "use strict"; //------------------------------------------------------------------------------ -// Rule Definition +// Helpers //------------------------------------------------------------------------------ -module.exports = function(context) { - - var functions = []; +/** + * 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; +} - //-------------------------------------------------------------------------- - // Helpers - //-------------------------------------------------------------------------- +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ - /** - * Marks entrance into a function by pushing a new object onto the functions - * stack. - * @returns {void} - * @private - */ - function enterFunction() { - functions.push({}); - } +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) + ) { + 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..364be712d1561d 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,52 @@ 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 +110,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 +120,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 +129,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..f66540ee0ad634 100644 --- a/tools/eslint/lib/rules/constructor-super.js +++ b/tools/eslint/lib/rules/constructor-super.js @@ -6,101 +6,208 @@ "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) { + // {{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. + var funcInfo = null; - /** - * 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`. - */ - function getClassInAncestor(node) { - while (node != null) { - if (node.type === "ClassDeclaration" || node.type === "ClassExpression") { - return node; - } - node = node.parent; - } - /* istanbul ignore next */ - return 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. + 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) { + return segInfoMap[segment.id].calledInEveryPaths; } - // A stack for checking context. - var stack = []; - return { /** - * Start checking. - * @param {MethodDefinition} node - A target node. + * Stacks a constructor information. + * @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)) { return; } - stack.push({ - superCallings: [], - scope: context.getScope().variableScope - }); + + // Class > ClassBody > MethodDefinition > FunctionExpression + var classNode = node.parent.parent.parent; + funcInfo = { + upper: funcInfo, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + scope: context.getScope(), + codePath: codePath + }; }, /** - * Checks the result, then reports invalid/missing `super()`. - * @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:exit": function(node) { - if (node.kind !== "constructor") { + "onCodePathEnd": function(codePath, node) { + if (!isConstructorFunction(node)) { return; } - var result = stack.pop(); - var classNode = getClassInAncestor(node); - /* istanbul ignore if */ - if (classNode == null) { + // Skip if own class which has a valid `extends` part. + var hasExtends = funcInfo.hasExtends; + funcInfo = funcInfo.upper; + if (!hasExtends) { return; } - if (classNode.superClass === null || isNullLiteral(classNode.superClass)) { - result.superCallings.forEach(function(superCalling) { - context.report(superCalling, "unexpected `super()`."); + // 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 }); - } 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. + * Initialize information of a given code path segment. + * @param {CodePathSegment} segment - A code path segment to initialize. * @returns {void} */ - "CallExpression": function(node) { - var item = stack[stack.length - 1]; - if (isOnConstructor(item) && node.callee.type === "Super") { - item.superCallings.push(node); + "onCodePathSegmentStart": function(segment) { + // Skip if this is not in a constructor of a class which has a valid + // `extends` part. + if (!( + funcInfo && + funcInfo.hasExtends && + funcInfo.scope === context.getScope().variableScope + )) { + return; + } + + // Initialize info. + var info = segInfoMap[segment.id] = { + calledInSomePaths: false, + calledInEveryPaths: false + }; + + // 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); } + }, + + /** + * 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.scope === context.getScope().variableScope)) { + 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 { + // This class does not have a valid `extends` part. + // Disallow `super()`. + context.report({ + message: "Unexpected 'super()'.", + node: node + }); + } + }, + + /** + * Resets state. + * @returns {void} + */ + "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..cad5a831746b3f 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 @@ -30,45 +39,189 @@ module.exports = function(context) { } /** - * 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 +229,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/dot-location.js b/tools/eslint/lib/rules/dot-location.js index 6e83b984887293..403ffe2d5e7767 100644 --- a/tools/eslint/lib/rules/dot-location.js +++ b/tools/eslint/lib/rules/dot-location.js @@ -6,27 +6,18 @@ "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; - /** - * 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; - } - /** * Reports if the dot between object and property is on the correct loccation. * @param {ASTNode} obj The object owning the property. @@ -39,10 +30,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 +52,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..255d08ada67394 100644 --- a/tools/eslint/lib/rules/dot-notation.js +++ b/tools/eslint/lib/rules/dot-notation.js @@ -9,67 +9,7 @@ //------------------------------------------------------------------------------ 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] || {}; diff --git a/tools/eslint/lib/rules/eol-last.js b/tools/eslint/lib/rules/eol-last.js index 2f68b8a7df1e2c..33a09b0573f643 100644 --- a/tools/eslint/lib/rules/eol-last.js +++ b/tools/eslint/lib/rules/eol-last.js @@ -18,16 +18,22 @@ module.exports = function(context) { "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; - } + 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 +41,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..6650740f909157 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"; @@ -71,7 +73,7 @@ module.exports = function(context) { } if (context.options[0] === "smart" && (isTypeOfBinary(node) || - areLiteralsAndSameType(node)) || isNullCheck(node)) { + areLiteralsAndSameType(node) || isNullCheck(node))) { return; } @@ -79,11 +81,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..210638a4ec1adb 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,24 @@ 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]]); } - ); + }); } } 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..70125cf63b3672 --- /dev/null +++ b/tools/eslint/lib/rules/global-require.js @@ -0,0 +1,69 @@ +/** + * @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..600a04fcfa8ef9 100644 --- a/tools/eslint/lib/rules/handle-callback-err.js +++ b/tools/eslint/lib/rules/handle-callback-err.js @@ -44,7 +44,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..0ea42e14ef4bda --- /dev/null +++ b/tools/eslint/lib/rules/id-length.js @@ -0,0 +1,106 @@ +/** + * @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..416689c56835b0 --- /dev/null +++ b/tools/eslint/lib/rules/id-match.js @@ -0,0 +1,129 @@ +/** + * @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..e18fd534c83db0 100644 --- a/tools/eslint/lib/rules/indent.js +++ b/tools/eslint/lib/rules/indent.js @@ -1,463 +1,681 @@ /** * @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 MESSAGE = "Expected indentation of {{needed}} {{type}} {{characters}} but found {{gotten}}."; + var DEFAULT_VARIABLE_INDENT = 1; - var lines = null; - var indentStack = [0]; - var linesToCheck = null; - var breakIndents = null; + 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] + ]; + } - /** - * Sets pushing indent of current node - * @param {ASTNode} node - targeted node - * @param {Number} indents - indents count to push - * @returns {void} - */ - function markPush(node, indents) { - linesToCheck[node.loc.start.line - 1].push.push(indents); + 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() + }); + } } /** - * 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} + * 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 markPop(node, outdents) { - linesToCheck[node.loc.end.line - 1].pop.push(outdents); + 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; } /** - * Set alt push for current node - * @param {ASTNode} node - targeted node - * @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 markPushAlt(node) { - linesToCheck[node.loc.start.line - 1].pushAltLine.push(node.loc.end.line - 1); + 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; } /** - * 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) { + var nodeIndent = getNodeIndent(node, false, excludeCommas); + if ( + node.type !== "ArrayExpression" && node.type !== "ObjectExpression" && + nodeIndent !== indent && isNodeFirstInLine(node) + ) { + report(node, indent, nodeIndent); + } + }); } /** - * 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); + } + + if (calleeNode.parent.type === "CallExpression") { + var calleeParent = calleeNode.parent; - // 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.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 (parentVarNode.loc.start.line === effectiveParent.loc.start.line) { + nodeIndent = nodeIndent + (indentSize * options.VariableDeclarator[parentVarNode.parent.kind]); + } else if (parent.type === "ObjectExpression" || parent.type === "ArrayExpression") { + 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; - if (line.push.length) { - pushExpectedIndentations(line, actualIndentation); + checkFirstNodeLineIndent(node, nodeIndent); + } else { + nodeIndent = getNodeIndent(node); + elementsIndent = nodeIndent + indentSize; + } + + // check if the node is a multiple variable declaration, if yes then make sure indentation takes into account + // variable indentation concept + if (isNodeInVarOnTop(node, parentVarNode)) { + elementsIndent += indentSize * options.VariableDeclarator[parentVarNode.parent.kind]; + } + + // 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.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) { + // Skip inline blocks + if (isSingleLineNode(node)) { + return; + } - if (!Array.isArray(expected)) { - expected = [expected]; + if (node.parent && ( + node.parent.type === "FunctionExpression" || + node.parent.type === "FunctionDeclaration" || + node.parent.type === "ArrowFunctionExpression" + )) { + checkIndentInFunctionBlock(node); + return; } - expected = expected.map(function(value) { - if (line.pop.length) { - value -= outdent; - } + var indent; + var nodesToCheck = []; - 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; - }); + // For this statements we should check indent from statement begin + // (not from block begin) + var statementsWithProperties = [ + "IfStatement", "WhileStatement", "ForStatement", "ForInStatement", "ForOfStatement", "DoWhileStatement" + ]; - indentStack[idx] = expected; + if (node.parent && statementsWithProperties.indexOf(node.parent.type) !== -1 && isNodeBodyBlock(node)) { + indent = getNodeIndent(node.parent); + } else { + indent = getNodeIndent(node); + } - line.pop.forEach(function() { - indentStack.pop(); - }); + 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); + } + + if (node.type === "BlockStatement") { + checkLastNodeLineIndent(node, indent); + } + } + + /** + * 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]; - return expected; + if ((elem.loc.start.line !== node.loc.start.line && !lastElem) || + (lastElem && lastElem.loc.start.line !== elem.loc.start.line)) { + finalCollection.push(elem); + } + + return finalCollection; + }, []); } /** - * Store in stack expected indentations - * @param {Number} line - current line - * @param {Number} actualIndentation - actual indentation at current line + * 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); + } + } + + /** + * 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); + } } - //-------------------------------------------------------------------------- - // Public - //-------------------------------------------------------------------------- + /** + * 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; - return { - "Program": function (node) { - lines = context.getSourceLines(); - linesToCheck = lines.map(function () { - return { - push: [], - pushAltLine: [], - pop: [], - check: false - }; - }); + if (caseIndentStore[switchNode.loc.start.line]) { + return caseIndentStore[switchNode.loc.start.line]; + } else { + if (typeof switchIndent === "undefined") { + switchIndent = getNodeIndent(switchNode); + } - if (!isMultiline(node)) { - return; + if (switchNode.cases.length > 0 && options.SwitchCase === 0) { + caseIndent = switchIndent; + } else { + caseIndent = switchIndent + (indentSize * options.SwitchCase); } - markChildren(node); - }, - "Program:exit": function (node) { - checkIndentations(node); - }, + caseIndentStore[switchNode.loc.start.line] = caseIndent; + return caseIndent; + } + } - "BlockStatement": function (node) { - if (!isMultiline(node)) { - return; + return { + "Program": function(node) { + if (node.body.length > 0) { + // Root nodes should have no indent + checkNodesIndent(node.body, getNodeIndent(node)); } + }, - markChildren(node); - markPop(node, 1); + "ClassBody": blockIndentationCheck, - markPushAndEndCheck(getBlockNodeToMark(node), 1); - }, + "BlockStatement": blockIndentationCheck, - "IfStatement": function (node) { - markAlternateBlockStatement(node, "alternate"); - }, + "WhileStatement": blockLessNodes, - "TryStatement": function (node) { - markAlternateBlockStatement(node, "handler"); - markAlternateBlockStatement(node, "finalizer"); - }, + "ForStatement": blockLessNodes, - "SwitchStatement": function (node) { - if (!isMultiline(node)) { - return; - } + "ForInStatement": blockLessNodes, - var indents = 1; - var children = getChildren(node); + "ForOfStatement": blockLessNodes, - if (children.length && node.loc.start.column === children[0].loc.start.column) { - indents = 0; - } + "DoWhileStatement": blockLessNodes, - markChildren(node); - markPop(node, indents); - markPushAndEndCheck(node, indents); + "IfStatement": function(node) { + if (node.consequent.type !== "BlockStatement" && node.consequent.loc.start.line > node.loc.start.line) { + blockIndentationCheck(node); + } }, - "SwitchCase": function (node) { - if (!options.indentSwitchCase) { - return; + "VariableDeclaration": function(node) { + if (node.declarations[node.declarations.length - 1].loc.start.line > node.declarations[0].loc.start.line) { + checkIndentInVariableDeclarations(node); } + }, - if (!isMultiline(node)) { - return; - } + "ObjectExpression": function(node) { + checkIndentInArrayOrObjectBlock(node); + }, - var children = getChildren(node); + "ArrayExpression": function(node) { + checkIndentInArrayOrObjectBlock(node); + }, - if (children.length === 1 && children[0].type === "BlockStatement") { - return; - } + "SwitchStatement": function(node) { + // Switch is not a 'BlockStatement' + var switchIndent = getNodeIndent(node); + var caseIndent = expectedCaseIndent(node, switchIndent); + checkNodesIndent(node.cases, caseIndent); - markPush(node, 1); - markCheck(node); - markChildren(node); - markCase(node, children); + checkLastNodeLineIndent(node, switchIndent); }, - // 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); - }, - "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 +688,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..79b188728cfbbf --- /dev/null +++ b/tools/eslint/lib/rules/init-declarations.js @@ -0,0 +1,114 @@ +/** + * @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..cfdbf11f326023 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; + var startToken, endToken; - // [computed]: value - if (property.computed) { - startToken = context.getTokenBefore(key); - endToken = context.getTokenAfter(key); - return endToken.range[1] - startToken.range[0]; - } - - // 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,21 @@ 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 +346,7 @@ module.exports = function(context) { var length = properties.length; for (var i = 0; i < length; i++) { - verifySpacing(properties[i]); + verifySpacing(properties[i], singleLineOptions); } } @@ -282,7 +354,7 @@ module.exports = function(context) { // Public API //-------------------------------------------------------------------------- - if (align) { // Verify vertical alignment + if (multiLineOptions.align) { // Verify vertical alignment return { "ObjectExpression": function(node) { @@ -294,11 +366,11 @@ module.exports = function(context) { } }; - } 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) ? singleLineOptions : multiLineOptions); } }; @@ -306,20 +378,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..d532a4ce24ff28 --- /dev/null +++ b/tools/eslint/lib/rules/keyword-spacing.js @@ -0,0 +1,520 @@ +/** + * @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..29a9dfb7f0555a 100644 --- a/tools/eslint/lib/rules/linebreak-style.js +++ b/tools/eslint/lib/rules/linebreak-style.js @@ -12,26 +12,61 @@ // 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..6f0e510007a45b 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. @@ -31,7 +43,7 @@ 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); @@ -55,7 +67,7 @@ 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 +75,139 @@ 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"); + } + + /** + * 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"); + } + + /** + * 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 +233,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 +256,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 +315,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..89cf75f00bb8ff 100644 --- a/tools/eslint/lib/rules/max-depth.js +++ b/tools/eslint/lib/rules/max-depth.js @@ -19,14 +19,30 @@ module.exports = function(context) { var functionStack = [], maxDepth = context.options[0] || 4; + /** + * 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 +52,11 @@ module.exports = function(context) { } } + /** + * Pop the saved block + * @returns {void} + * @private + */ function popBlock() { functionStack[functionStack.length - 1]--; } @@ -84,6 +105,7 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "type": "integer", + "minimum": 0 } ]; diff --git a/tools/eslint/lib/rules/max-len.js b/tools/eslint/lib/rules/max-len.js index 8d0400dcea64c1..3c389588d958f0 100644 --- a/tools/eslint/lib/rules/max-len.js +++ b/tools/eslint/lib/rules/max-len.js @@ -11,44 +11,155 @@ //------------------------------------------------------------------------------ module.exports = function(context) { + // takes some ideas from 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) : {}; + // …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 = context.options[0] || 80, - tabString = stringRepeat(" ", tabWidth); + 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(); + // split (honors line-ending) + var lines = context.getSourceLines(), + // list of comments to ignore + comments = ignoreComments || maxCommentLength ? context.getAllComments() : [], + // we iterate over comments in parallel with the lines + commentsIndex = 0; - // Replace the tabs - // Split (honors line-ending) - // Iterate 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 +175,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..cac15d1e85144d 100644 --- a/tools/eslint/lib/rules/max-nested-callbacks.js +++ b/tools/eslint/lib/rules/max-nested-callbacks.js @@ -16,7 +16,7 @@ module.exports = function(context) { // Constants //-------------------------------------------------------------------------- - var THRESHOLD = context.options[0]; + var THRESHOLD = context.options[0] || 10; //-------------------------------------------------------------------------- // Helpers @@ -68,6 +68,7 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "type": "integer", + "minimum": 0 } ]; diff --git a/tools/eslint/lib/rules/max-params.js b/tools/eslint/lib/rules/max-params.js index c09fba06d06c83..d248bdf2260c84 100644 --- a/tools/eslint/lib/rules/max-params.js +++ b/tools/eslint/lib/rules/max-params.js @@ -40,6 +40,7 @@ module.exports = function(context) { module.exports.schema = [ { - "type": "integer" + "type": "integer", + "minimum": 0 } ]; diff --git a/tools/eslint/lib/rules/max-statements.js b/tools/eslint/lib/rules/max-statements.js index 8c7f4fd31b15f2..78de52ebeb197c 100644 --- a/tools/eslint/lib/rules/max-statements.js +++ b/tools/eslint/lib/rules/max-statements.js @@ -17,21 +17,57 @@ module.exports = function(context) { //-------------------------------------------------------------------------- var functionStack = [], - maxStatements = context.options[0] || 10; + maxStatements = context.options[0] || 10, + ignoreTopLevelFunctions = context.options[1] && context.options[1].ignoreTopLevelFunctions || false, + topLevelFunctions = []; + /** + * 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 +85,35 @@ 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" + "type": "integer", + "minimum": 0 + }, + { + "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..35f5cafa8b339f 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,7 @@ 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 +77,10 @@ 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, {}); @@ -134,15 +146,17 @@ 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"; } /** @@ -217,6 +231,9 @@ module.exports.schema = [ "items": { "type": "string" } + }, + "properties": { + "type": "boolean" } }, "additionalProperties": false diff --git a/tools/eslint/lib/rules/newline-after-var.js b/tools/eslint/lib/rules/newline-after-var.js index e1ade14bdeda97..1b5698c0302bca 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,32 @@ 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 +99,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 +126,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-per-chained-call.js b/tools/eslint/lib/rules/newline-per-chained-call.js new file mode 100644 index 00000000000000..4e17e05ed9cb80 --- /dev/null +++ b/tools/eslint/lib/rules/newline-per-chained-call.js @@ -0,0 +1,113 @@ +/** + * @fileoverview Rule to ensure newline per method call when chaining calls + * @author Rajendra Patil + * @copyright 2016 Rajendra Patil. All rights reserved. + */ + +"use strict"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + var options = context.options[0] || {}, + codeStateMap = {}, + ignoreChainWithDepth = options.ignoreChainWithDepth || 2; + + /** + * Check and Capture State if the chained calls/members + * @param {ASTNode} node The node to check + * @param {object} codeState The state of the code current code to be filled + * @returns {void} + */ + function checkAndCaptureStateRecursively(node, codeState) { + var valid = false, + objectLineNumber, + propertyLineNumber; + if (node.callee) { + node = node.callee; + codeState.hasFunctionCall = true; + } + + if (node.object) { + codeState.depth++; + + objectLineNumber = node.object.loc.end.line; + propertyLineNumber = node.property.loc.end.line; + valid = node.computed || propertyLineNumber > objectLineNumber; + + if (!valid) { + codeState.reports.push({ + node: node, + text: "Expected line break after `{{code}}`.", + depth: codeState.depth + }); + } + // Recurse + checkAndCaptureStateRecursively(node.object, codeState); + } + + } + /** + * Verify and report the captured state report + * @param {object} codeState contains the captured state with `hasFunctionCall, reports and depth` + * @returns {void} + */ + function reportState(codeState) { + var report; + if (codeState.hasFunctionCall && codeState.depth > ignoreChainWithDepth && codeState.reports) { + while (codeState.reports.length) { + report = codeState.reports.shift(); + context.report(report.node, report.text, { + code: context.getSourceCode().getText(report.node.object).replace(/\r\n|\r|\n/g, "\\n") // Not to print newlines in error report + }); + } + } + } + + /** + * Initialize the node state object with default values. + * @returns {void} + */ + function initializeState() { + return { + visited: false, + hasFunctionCall: false, + depth: 1, + reports: [] + }; + } + /** + * Process the said node and recurse internally + * @param {ASTNode} node The node to check + * @returns {void} + */ + function processNode(node) { + var stateKey = [node.loc.start.line, node.loc.start.column].join("@"), + codeState = codeStateMap[stateKey] = (codeStateMap[stateKey] || initializeState()); + if (!codeState.visited) { + codeState.visited = true; + checkAndCaptureStateRecursively(node, codeState); + } + reportState(codeState); + } + + return { + "CallExpression": processNode, + "MemberExpression": processNode + }; +}; + +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..dddefc47733080 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,8 @@ 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; - - if (reference) { - if (reference.resolved || isGloballyShadowed(globalScope, identifierName)) { - return true; - } - } - - return false; + var reference = findReference(scope, node); + return reference && reference.resolved && reference.resolved.defs.length > 0; } /** @@ -120,7 +102,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..443328b89e5b2e --- /dev/null +++ b/tools/eslint/lib/rules/no-case-declarations.js @@ -0,0 +1,47 @@ +/** + * @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..c83afca0afe68c 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,19 @@ 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..9cf2ea7a0c806a --- /dev/null +++ b/tools/eslint/lib/rules/no-confusing-arrow.js @@ -0,0 +1,65 @@ +/** + * @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"; + +//------------------------------------------------------------------------------ +// 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.body && node.body.type === "ConditionalExpression"; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + /** + * Reports if an arrow function contains an ambiguous conditional. + * @param {ASTNode} node - A node to check and report. + * @returns {void} + */ + function checkArrowFunc(node) { + if (isConditional(node)) { + context.report(node, "Arrow function used ambiguously with a conditional expression."); + } + } + + return { + "ArrowFunctionExpression": checkArrowFunc + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-console.js b/tools/eslint/lib/rules/no-console.js index 5de6adadbf4982..9493bc752982a6 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..85e2bd2074d61d 100644 --- a/tools/eslint/lib/rules/no-constant-condition.js +++ b/tools/eslint/lib/rules/no-constant-condition.js @@ -34,7 +34,7 @@ module.exports = function(context) { 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": diff --git a/tools/eslint/lib/rules/no-control-regex.js b/tools/eslint/lib/rules/no-control-regex.js index cd57f73451082c..c5a219f4470feb 100644 --- a/tools/eslint/lib/rules/no-control-regex.js +++ b/tools/eslint/lib/rules/no-control-regex.js @@ -11,36 +11,35 @@ 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 { return new RegExp(node.value); } 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..80b52ca82ad015 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,29 @@ module.exports = function(context) { * @private */ function checkParams(node) { - var params = {}, - dups = {}; + var variables = context.getDeclaredVariables(node); + var keyMap = Object.create(null); + for (var i = 0; i < variables.length; ++i) { + var variable = variables[i]; - /** - * 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; + // TODO(nagashima): Remove this duplication check after https://github.com/estools/escope/pull/79 + var key = "$" + variable.name; // to avoid __proto__. + if (!isParameter(variable.defs[0]) || keyMap[key]) { + continue; } - } - - // loop through and find each duplicate param - node.params.forEach(function(param) { - - switch (param.type) { - case "Identifier": - markParam(param.name); - break; - - case "ObjectPattern": - param.properties.forEach(function(property) { - markParam(property.key.name); - }); - break; - - case "ArrayPattern": - param.elements.forEach(function(element) { - - // Arrays can be sparse (unwanted arguments) - if (element !== null) { - markParam(element.name); - } - }); - break; - - // no default + keyMap[key] = true; + + // Checks and reports duplications. + var defs = variable.defs.filter(isParameter); + 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..12345a7be7019a --- /dev/null +++ b/tools/eslint/lib/rules/no-dupe-class-members.js @@ -0,0 +1,98 @@ +/** + * @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..72677f44d91c24 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,20 @@ 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(); - }, - - "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."); + node.cases.forEach(function(switchCase) { + var key = context.getSource(switchCase.test); + 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-else-return.js b/tools/eslint/lib/rules/no-else-return.js index df674c4753c5b6..29b53842eb2a48 100644 --- a/tools/eslint/lib/rules/no-else-return.js +++ b/tools/eslint/lib/rules/no-else-return.js @@ -80,15 +80,30 @@ 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) { + 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 checkForReturnOrIf(node, alternate) { - if (checkForReturn(node) || checkForIf(node)) { - displayReport(alternate); + function alwaysReturns(node) { + // If we have a BlockStatement, check each consequent body node. + if (node.type === "BlockStatement") { + return node.body.some(checkForReturnOrIf); + // If not a block statement, make sure the consequent isn't a ReturnStatement + // or an IfStatement with returns on both paths + } else { + return checkForReturnOrIf(node); } } @@ -98,23 +113,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..b201da44f45627 100644 --- a/tools/eslint/lib/rules/no-empty-character-class.js +++ b/tools/eslint/lib/rules/no-empty-character-class.js @@ -41,3 +41,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..6f24ee1de08f67 --- /dev/null +++ b/tools/eslint/lib/rules/no-empty-function.js @@ -0,0 +1,149 @@ +/** + * @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..a8b0de16869f6c 100644 --- a/tools/eslint/lib/rules/no-empty.js +++ b/tools/eslint/lib/rules/no-empty.js @@ -10,21 +10,18 @@ // 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) { return; } // 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..bd08bbd117b274 100644 --- a/tools/eslint/lib/rules/no-eval.js +++ b/tools/eslint/lib/rules/no-eval.js @@ -1,26 +1,290 @@ /** * @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..49e139a29b524c 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; }); } @@ -56,22 +54,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..8bfe5e5d181d1f 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,136 @@ //------------------------------------------------------------------------------ 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 + }); + } /** - * Get the topmost scope - * @returns {Object} The topmost scope + * 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 getTopScope() { - return scope[scope.length - 1]; + 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; } /** - * Increment the depth of the top 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 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" + ); + } + + /** + * 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..bd7495b891f6b2 100644 --- a/tools/eslint/lib/rules/no-extra-boolean-cast.js +++ b/tools/eslint/lib/rules/no-extra-boolean-cast.js @@ -11,8 +11,35 @@ 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 +51,24 @@ 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."); - - // 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" && + if (isInBooleanContext(parent, grandparent) || + // 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..763e9235bd7cf6 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"; @@ -12,6 +13,8 @@ module.exports = function(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. @@ -74,6 +77,100 @@ 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) { @@ -149,17 +246,35 @@ module.exports = function(context) { 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" && @@ -182,6 +297,12 @@ 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) { @@ -207,7 +328,7 @@ 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; @@ -233,17 +354,28 @@ module.exports = function(context) { } }, "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); } } @@ -263,7 +395,7 @@ module.exports = function(context) { report(node.init); } - if (node.test && hasExcessParens(node.test)) { + if (node.test && hasExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } @@ -272,7 +404,7 @@ module.exports = function(context) { } }, "IfStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { + if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, @@ -291,6 +423,11 @@ module.exports = function(context) { // 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); @@ -309,7 +446,10 @@ module.exports = function(context) { }); }, "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); @@ -333,7 +473,9 @@ module.exports = function(context) { } }, "ThrowStatement": function(node) { - if (hasExcessParens(node.argument)) { + var throwToken = sourceCode.getFirstToken(node); + + if (hasExcessParensNoLineTerminator(throwToken, node.argument)) { report(node.argument); } }, @@ -348,7 +490,7 @@ module.exports = function(context) { } }, "WhileStatement": function(node) { - if (hasDoubleExcessParens(node.test)) { + if (hasDoubleExcessParens(node.test) && !isCondAssignException(node)) { report(node.test); } }, @@ -356,13 +498,52 @@ module.exports = function(context) { 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..04c1eca9b06b8d 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); + } + }); } /** @@ -40,11 +46,18 @@ 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..58dfcf04413386 100644 --- a/tools/eslint/lib/rules/no-fallthrough.js +++ b/tools/eslint/lib/rules/no-fallthrough.js @@ -4,94 +4,84 @@ */ "use strict"; - -var FALLTHROUGH_COMMENT = /falls\sthrough/; - //------------------------------------------------------------------------------ -// Rule Definition +// Requirements //------------------------------------------------------------------------------ -module.exports = function(context) { - - var switches = []; - - return { +var getLast = require("../util").getLast; - "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. - */ - if (consequent.length === 1 && consequent[0].type === "BlockStatement") { - consequent = consequent[0]; - } +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ - // checking on previous case - if (!switchData.lastCaseClosed) { +var FALLTHROUGH_COMMENT = /falls?\s?through/i; - // 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]; +/** + * 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 = getLast(sourceCode.getComments(node).leading); - // 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]; - } + return Boolean(comment && FALLTHROUGH_COMMENT.test(comment.value)); +} - // check for comment - if (!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; +} - context.report(switchData.lastCase, - "Expected a \"break\" statement before \"{{code}}\".", - { code: node.test ? "case" : "default" }); - } - } +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ - // now dealing with the current case - switchData.lastCaseClosed = false; - switchData.lastCase = node; +module.exports = function(context) { + var currentCodePath = null; - // 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; - } + // We need to use leading comments of the next SwitchCase node because + // trailing comments is wrong if semicolons are omitted. + var fallthroughCase = null; - /* - * 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. - */ + return { + "onCodePathStart": function(codePath) { + currentCodePath = codePath; + }, + "onCodePathEnd": function() { + currentCodePath = currentCodePath.upper; }, - "SwitchStatement": function(node) { - switches.push({ - node: node, - lastCaseClosed: true, - lastCase: null - }); + "SwitchCase": function(node) { + // Checks whether or not there is a fallthrough comment. + // And reports the previous fallthrough node if that does not exist. + if (fallthroughCase && !hasFallthroughComment(node, context)) { + context.report({ + message: "Expected a 'break' statement before '{{type}}'.", + data: {type: node.test ? "case" : "default"}, + node: node + }); + } + fallthroughCase = null; }, - "SwitchStatement:exit": function() { - switches.pop(); + "SwitchCase:exit": function(node) { + // `reachable` meant fall through because statements preceded by + // `break`, `return`, or `throw` are unreachable. + // And allows empty cases and the last case. + if (currentCodePath.currentSegments.some(isReachable) && + node.consequent.length > 0 && + getLast(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..1ed3042cc03241 100644 --- a/tools/eslint/lib/rules/no-func-assign.js +++ b/tools/eslint/lib/rules/no-func-assign.js @@ -6,78 +6,51 @@ "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..d45970020db577 --- /dev/null +++ b/tools/eslint/lib/rules/no-implicit-coercion.js @@ -0,0 +1,241 @@ +/** + * @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..2f4c1fff9ce52f --- /dev/null +++ b/tools/eslint/lib/rules/no-implicit-globals.js @@ -0,0 +1,46 @@ +/** + * @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..971b7b4c765fc2 100644 --- a/tools/eslint/lib/rules/no-implied-eval.js +++ b/tools/eslint/lib/rules/no-implied-eval.js @@ -12,51 +12,86 @@ //------------------------------------------------------------------------------ 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 isImpliedEvalCallee && node.arguments.length; + } - return isSetMethod && hasStringLiteralArgument(node); + /** + * 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 +100,41 @@ 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-invalid-regexp.js b/tools/eslint/lib/rules/no-invalid-regexp.js index 63608c6c47497e..1598bc60203075 100644 --- a/tools/eslint/lib/rules/no-invalid-regexp.js +++ b/tools/eslint/lib/rules/no-invalid-regexp.js @@ -17,24 +17,36 @@ var espree = require("espree"); module.exports = function(context) { + /** + * 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 : ""; 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 + "'"); } 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..0bde480c2ad903 --- /dev/null +++ b/tools/eslint/lib/rules/no-invalid-this.js @@ -0,0 +1,107 @@ +/** + * @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..b49f747b8a08be 100644 --- a/tools/eslint/lib/rules/no-irregular-whitespace.js +++ b/tools/eslint/lib/rules/no-irregular-whitespace.js @@ -28,7 +28,7 @@ module.exports = function(context) { 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)) { @@ -63,7 +63,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; @@ -108,7 +108,7 @@ module.exports = function(context) { } return { - "Program": function (node) { + "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 @@ -122,11 +122,11 @@ module.exports = function(context) { "Identifier": removeInvalidNodeErrors, "Literal": removeInvalidNodeErrors, - "Program:exit": function () { + "Program:exit": function() { // 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); }); } }; 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..7d7ac206c135f3 100644 --- a/tools/eslint/lib/rules/no-labels.js +++ b/tools/eslint/lib/rules/no-labels.js @@ -1,44 +1,134 @@ /** * @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..07f819ec78f7fc 100644 --- a/tools/eslint/lib/rules/no-lone-blocks.js +++ b/tools/eslint/lib/rules/no-lone-blocks.js @@ -66,7 +66,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 +80,7 @@ module.exports = function(context) { } } }; - } - if (context.ecmaFeatures.blockBindings) { ruleDef.VariableDeclaration = function(node) { if (node.kind === "let" || node.kind === "const") { markLoneBlock(node); @@ -94,9 +92,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..d2dd27ba771b6a 100644 --- a/tools/eslint/lib/rules/no-loop-func.js +++ b/tools/eslint/lib/rules/no-loop-func.js @@ -6,44 +6,167 @@ "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..40d885f5f81b46 --- /dev/null +++ b/tools/eslint/lib/rules/no-magic-numbers.js @@ -0,0 +1,149 @@ +/** + * @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 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)) { + 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..c1b921ed5df134 100644 --- a/tools/eslint/lib/rules/no-mixed-requires.js +++ b/tools/eslint/lib/rules/no-mixed-requires.js @@ -11,6 +11,17 @@ 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. * @@ -56,6 +67,12 @@ module.exports = function(context) { ) { // "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); @@ -107,7 +124,7 @@ 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 +144,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 +157,6 @@ module.exports = function(context) { return { "VariableDeclaration": function(node) { - var grouping = !!context.options[0]; if (isMixed(node.declarations)) { context.report( @@ -160,6 +176,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..6ce27dadc74905 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,11 @@ 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,7 +73,24 @@ 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) { /* @@ -54,11 +104,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..c6177e32825c5b 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 { @@ -72,24 +72,44 @@ module.exports = function(context) { allComments = context.getAllComments(), pattern = /[^\n\r\u2028\u2029 ] {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..c41458d9528c0e 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; } //-------------------------------------------------------------------------- @@ -43,22 +47,46 @@ 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 +95,22 @@ 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, location, + "More than " + max + " blank " + (max === 1 ? "line" : "lines") + " not allowed."); + } + } else { + // inside the last blank lines + if (blankCounter > maxEOF) { + context.report(node, location, + "Too many blank lines at the end of file. Max of " + maxEOF + " allowed."); + } } // Finally, reset the blank counter @@ -89,7 +127,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..50175388acd252 100644 --- a/tools/eslint/lib/rules/no-native-reassign.js +++ b/tools/eslint/lib/rules/no-native-reassign.js @@ -10,39 +10,50 @@ //------------------------------------------------------------------------------ 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; - return { + 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 + }); + } + } - "AssignmentExpression": function(node) { - if (modifiedNativeObjects.indexOf(node.left.name) >= 0) { - context.report(node, node.left.name + " is a read-only native object."); - } - }, + /** + * 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); + } + } - "VariableDeclarator": function(node) { - if (modifiedNativeObjects.indexOf(node.id.name) >= 0) { - context.report(node, "Redefinition of '{{nativeObject}}'.", { nativeObject: node.id.name }); - } + return { + "Program": function() { + var globalScope = context.getScope(); + globalScope.variables.forEach(checkVariable); } }; - }; module.exports.schema = [ @@ -51,9 +62,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..aeae5d62f057ae --- /dev/null +++ b/tools/eslint/lib/rules/no-new-symbol.js @@ -0,0 +1,33 @@ +/** + * @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-param-reassign.js b/tools/eslint/lib/rules/no-param-reassign.js index c425246535261c..6bfa681afb46b9 100644 --- a/tools/eslint/lib/rules/no-param-reassign.js +++ b/tools/eslint/lib/rules/no-param-reassign.js @@ -9,79 +9,128 @@ // 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 a reference modifies its variable. + * If the `props` option is `true`, this checks whether or not the reference modifies properties of its variable also. + * @param {Reference} reference - A reference to check. + * @returns {boolean} Whether or not the reference modifies its variable. */ - function findDeclaration(scope, name) { - var variables = scope.variables; + function isModifying(reference) { + if (reference.isWrite()) { + return true; + } + + // Checks whether its property is modified. + if (props) { + 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; + } + + node = parent; + parent = parent.parent; } } - if (scope.upper) { - return findDeclaration(scope.upper, name); - } else { - return null; - } + 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; - for (var i = 0; i < defs.length; i++) { - if (defs[i].type === "Parameter") { - return true; - } + if (identifier && + !reference.init && + isModifying(reference) && + // 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( + identifier, + "Assignment to 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-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..b915ed8cd349d9 100644 --- a/tools/eslint/lib/rules/no-restricted-modules.js +++ b/tools/eslint/lib/rules/no-restricted-modules.js @@ -8,7 +8,7 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { // trim restricted module names var restrictedModules = context.options; @@ -57,7 +57,7 @@ module.exports = function (context) { } return { - "CallExpression": function (node) { + "CallExpression": function(node) { if (isRequireCall(node)) { var restrictedModuleName = getRestrictedModuleName(node); @@ -73,12 +73,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..1f88beda994c21 --- /dev/null +++ b/tools/eslint/lib/rules/no-restricted-syntax.js @@ -0,0 +1,43 @@ +/** + * @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..58d1db4222f27c 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,29 @@ 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..67af024191b455 --- /dev/null +++ b/tools/eslint/lib/rules/no-self-assign.js @@ -0,0 +1,118 @@ +/** + * @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) { + eachSelfAssignment(node.left, node.right, report); + } + }; +}; + +module.exports.schema = []; diff --git a/tools/eslint/lib/rules/no-sequences.js b/tools/eslint/lib/rules/no-sequences.js index 9f7bfe3e7d14a2..538e36a12fc2a6 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]]; } @@ -85,7 +85,8 @@ 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..6414e53e21003d 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. * @@ -49,8 +67,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") && @@ -79,85 +97,53 @@ module.exports = function(context) { 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 +159,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..ade30340c6c64c 100644 --- a/tools/eslint/lib/rules/no-this-before-super.js +++ b/tools/eslint/lib/rules/no-this-before-super.js @@ -6,137 +6,184 @@ "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) { + // {{hasExtends: boolean, scope: Scope}[]} + // 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. + var funcInfo = null; + + // {Map} + // Information for each code path segment. + // The value is a flag which shows `super()` called in all code paths. + var segInfoMap = Object.create(null); /** - * 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`. + * 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 getClassInAncestor(node) { - while (node != null) { - if (node.type === "ClassDeclaration" || node.type === "ClassExpression") { - return node; - } - node = node.parent; - } - /* istanbul ignore next */ - return null; + function isCalled(segment) { + return Boolean(segInfoMap[segment.id]); } /** - * 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. + * Checks whether or not this is in a constructor. + * @returns {boolean} `true` if this is in a constructor. */ - function isNullLiteral(node) { - return node != null && node.type === "Literal" && node.value === null; - } - - /** - * 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. - */ - function isCallee(node) { - return node != null && node.parent.type === "CallExpression" && node.parent.callee === node; + function isInConstructor() { + return Boolean( + funcInfo && + funcInfo.hasExtends && + funcInfo.scope === context.getScope().variableScope + ); } /** - * 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 + isInConstructor(funcInfo) && + !funcInfo.codePath.currentSegments.every(isCalled) ); } - var stack = []; - return { /** - * Start checking. - * @param {MethodDefinition} node - A target node. + * Stacks a constructor information. + * @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)) { return; } - stack.push({ - thisOrSuperBeforeSuperCalled: [], - superCalled: false, - scope: context.getScope().variableScope - }); + + // Class > ClassBody > MethodDefinition > FunctionExpression + var classNode = node.parent.parent.parent; + funcInfo = { + upper: funcInfo, + hasExtends: Boolean( + classNode.superClass && + !astUtils.isNullOrUndefined(classNode.superClass) + ), + scope: context.getScope(), + codePath: codePath + }; }, /** - * Treats the result of checking and reports invalid `this`/`super`. - * @param {MethodDefinition} node - A target node. + * Pops a constructor information. + * @param {CodePath} codePath - A code path which was ended. + * @param {ASTNode} node - The current node. * @returns {void} */ - "MethodDefinition:exit": function(node) { - if (node.kind !== "constructor") { - return; + "onCodePathEnd": function(codePath, node) { + if (isConstructorFunction(node)) { + funcInfo = funcInfo.upper; } - 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 information of a given code path segment. + * @param {CodePathSegment} segment - A code path segment to initialize. + * @returns {void} + */ + "onCodePathSegmentStart": function(segment) { + if (!isInConstructor(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}); - }); + // Initialize info. + segInfoMap[segment.id] = ( + segment.prevSegments.length > 0 && + segment.prevSegments.every(isCalled) + ); }, /** - * 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()) { + context.report({ + message: "'this' is not allowed before 'super()'.", + node: 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()) { + context.report({ + message: "'super' is not allowed before 'super()'.", + node: 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()) { + var segments = funcInfo.codePath.currentSegments; + for (var i = 0; i < segments.length; ++i) { + segInfoMap[segments[i].id] = true; + } } + }, + + /** + * 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..1a0c01ab360690 100644 --- a/tools/eslint/lib/rules/no-throw-literal.js +++ b/tools/eslint/lib/rules/no-throw-literal.js @@ -1,11 +1,49 @@ /** * @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 +53,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..ac3c975d6e3eba 100644 --- a/tools/eslint/lib/rules/no-trailing-spaces.js +++ b/tools/eslint/lib/rules/no-trailing-spaces.js @@ -13,11 +13,32 @@ 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 +54,21 @@ 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 +78,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..e8822c8888a9c6 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. @@ -58,35 +25,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-underscore-dangle.js b/tools/eslint/lib/rules/no-underscore-dangle.js index 38ad52f74fc4c2..73ab054de829d0 100644 --- a/tools/eslint/lib/rules/no-underscore-dangle.js +++ b/tools/eslint/lib/rules/no-underscore-dangle.js @@ -11,50 +11,104 @@ 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 +124,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..f66e7aa7554908 --- /dev/null +++ b/tools/eslint/lib/rules/no-unmodified-loop-condition.js @@ -0,0 +1,337 @@ +/** + * @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"), + estraverse = require("../util/estraverse"), + 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[]} groups - 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 any groups that this condition is belonging 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.groups.length === 0; +} + +/** + * 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; + + estraverse.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 groups = []; + 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, + groups: groups, + 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 that the reference is belonging to. + if (GROUP_PATTERN.test(node.type)) { + if (hasDynamicExpressions(node)) { + // This expression is dynamic, so don't check. + break; + } else { + groups.push(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]; + var inLoop = condition.isInLoop(modifier) || Boolean( + // Checks the function that this modifier is belonging to is used in the loop. + (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 groups that the condition is belonging 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]; + + for (var j = 0; j < condition.groups.length; ++j) { + var be = condition.groups[j]; + var group = groupMap.get(be); + if (!group) { + group = []; + groupMap.set(be, 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..7c9c267ac18a2a 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,81 @@ // 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 - */ - function isUnreachableAllowed(node) { - return node.type === "FunctionDeclaration" || - node.type === "VariableDeclaration" && - node.declarations.every(function(declaration) { - return declaration.type === "VariableDeclarator" && declaration.init === null; - }); - } - - /* - * 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 + * Reports a given node if it's unreachable. + * @param {ASTNode} node - A statement node to report. * @returns {void} - * @private */ - function checkNode(node) { - var parent = context.getAncestors().pop(); - var field, i, sibling; - - switch (parent.type) { - case "SwitchCase": - field = "consequent"; - break; - case "Program": - case "BlockStatement": - field = "body"; - break; - default: - return; - } - - for (i = parent[field].length - 1; i >= 0; i--) { - sibling = parent[field][i]; - if (sibling === node) { - return; // Found the last reachable statement, all done - } - - if (!isUnreachableAllowed(sibling)) { - report(context, sibling, node.type); - } + function reportIfUnreachable(node) { + if (currentCodePath.currentSegments.every(isUnreachable)) { + context.report({message: "Unreachable code.", node: node}); } } return { - "ReturnStatement": checkNode, - "ThrowStatement": checkNode, - "ContinueStatement": checkNode, - "BreakStatement": checkNode - }; + // Manages the current code path. + "onCodePathStart": function(codePath) { + currentCodePath = codePath; + }, + "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, + VariableDeclaration: function(node) { + if (node.kind !== "var" || node.declarations.some(isInitialized)) { + reportIfUnreachable(node); + } + }, + 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..82e21c04e7c306 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,7 +48,7 @@ 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], @@ -55,17 +58,31 @@ module.exports = function(context) { 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 +90,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..258f97c720506f --- /dev/null +++ b/tools/eslint/lib/rules/no-unused-labels.js @@ -0,0 +1,81 @@ +/** + * @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..2d61a7b988efc7 100644 --- a/tools/eslint/lib/rules/no-unused-vars.js +++ b/tools/eslint/lib/rules/no-unused-vars.js @@ -5,25 +5,41 @@ "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" }; - 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; + + if (firstOption.varsIgnorePattern) { + config.varsIgnorePattern = new RegExp(firstOption.varsIgnorePattern); + } + + if (firstOption.argsIgnorePattern) { + config.argsIgnorePattern = new RegExp(firstOption.argsIgnorePattern); + } } } @@ -31,7 +47,6 @@ module.exports = function(context) { // Helpers //-------------------------------------------------------------------------- - /** * Determines if a given variable is being exported from a module. * @param {Variable} variable - EScope variable object. @@ -47,7 +62,7 @@ module.exports = function(context) { 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 +92,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 +109,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,7 +142,7 @@ 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; } @@ -167,7 +153,7 @@ 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 @@ -175,54 +161,115 @@ module.exports = function(context) { continue; } - // skip any setter argument - if (type === "Parameter" && def.node.parent.type === "Property" && def.node.parent.kind === "set") { - 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 +289,14 @@ module.exports.schema = [ "vars": { "enum": ["all", "local"] }, + "varsIgnorePattern": { + "type": "string" + }, "args": { "enum": ["all", "after-used", "none"] + }, + "argsIgnorePattern": { + "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..2590230de98ae2 100644 --- a/tools/eslint/lib/rules/no-use-before-define.js +++ b/tools/eslint/lib/rules/no-use-before-define.js @@ -7,35 +7,136 @@ "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 +146,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. @@ -82,24 +184,52 @@ module.exports = function(context) { 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..6f230a96d3385a --- /dev/null +++ b/tools/eslint/lib/rules/no-useless-concat.js @@ -0,0 +1,89 @@ +/** + * @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..20ca67cbe060db --- /dev/null +++ b/tools/eslint/lib/rules/no-useless-constructor.js @@ -0,0 +1,63 @@ +/** + * @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"; + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + + /** + * 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) { + if (body.length !== 1 || + body[0].type !== "ExpressionStatement" || + body[0].expression.callee.type !== "Super") { + return false; + } + + + return body[0].expression.arguments.every(function(arg, index) { + return (arg.type === "Identifier" && arg.name === ctorParams[index].name) || + ( + arg.type === "SpreadElement" && + ctorParams[index].type === "RestElement" && + arg.argument.name === ctorParams[index].argument.name + ); + }); + } + + /** + * Checks whether a node is a redundant construtor + * @param {ASTNode} node - node to check + * @returns {void} + */ + function checkForConstructor(node) { + if (node.kind !== "constructor") { + return; + } + + var body = node.value.body.body; + + if (!node.parent.parent.superClass && body.length === 0 || + node.parent.parent.superClass && isRedundantSuperCall(body, node.value.params)) { + context.report(node, "Useless constructor."); + } + } + + + return { + "MethodDefinition": checkForConstructor + }; +}; + +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..881c5646f23304 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; /** @@ -54,7 +57,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 +72,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..8c300ee9653070 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,15 @@ 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 +66,15 @@ 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 +84,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 +101,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, " "); + } + }); } /** @@ -113,101 +124,124 @@ module.exports = function(context) { var closingCurlyBraceMustBeSpaced = options.arraysInObjectsException && penultimate.value === "]" || options.objectsInObjectsException && penultimate.value === "}" - ? !options.spaced : options.spaced; + ? !options.spaced : options.spaced, + firstSpaced, lastSpaced; - if (isSameLine(first, second)) { - if (options.spaced && !isSpaced(first, second)) { + 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)) { + 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..e17e48f4cc7039 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 //-------------------------------------------------------------------------- @@ -44,11 +61,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 +87,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..100648b6583124 --- /dev/null +++ b/tools/eslint/lib/rules/one-var-declaration-per-line.js @@ -0,0 +1,74 @@ +/** + * @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..55c81143930337 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 = { }; @@ -217,6 +217,8 @@ module.exports = function(context) { "ArrowFunctionExpression": startFunction, "BlockStatement": startBlock, "ForStatement": startBlock, + "ForInStatement": startBlock, + "ForOfStatement": startBlock, "SwitchStatement": startBlock, "VariableDeclaration": function(node) { @@ -263,6 +265,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-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..d8edfafa121a5a 100644 --- a/tools/eslint/lib/rules/padded-blocks.js +++ b/tools/eslint/lib/rules/padded-blocks.js @@ -10,12 +10,22 @@ // Rule Definition //------------------------------------------------------------------------------ -module.exports = function (context) { +module.exports = function(context) { var requirePadding = context.options[0] !== "never"; var ALWAYS_MESSAGE = "Block must be padded by blank lines.", NEVER_MESSAGE = "Block must not be padded by blank lines."; + /** + * Checks if the location of a node or token is before the location of another node or token + * @param {ASTNode|Token} a The node or token to check if its location is before b. + * @param {ASTNode|Token} b The node or token which will be compared with a. + * @returns {boolean} True if a is located before b. + */ + function isLocatedBefore(a, b) { + return a.range[1] < b.range[0]; + } + /** * 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. @@ -26,10 +36,18 @@ module.exports = function (context) { first = node.body[0], firstLine = first.loc.start.line, expectedFirstLine = blockStart + 2, - leadingComments = context.getComments(first).leading; + leadingComments = (node.body[0].leadingComments || []).slice(), + firstComment; - if (leadingComments.length > 0) { - firstLine = leadingComments[0].loc.start.line; + while (leadingComments.length > 0 && + leadingComments[0].loc.start.line <= node.loc.start.line) { + leadingComments.shift(); + } + + firstComment = leadingComments[0]; + + if (firstComment && isLocatedBefore(firstComment, first)) { + firstLine = firstComment.loc.start.line; } return expectedFirstLine <= firstLine; @@ -43,12 +61,21 @@ module.exports = function (context) { function isBlockBottomPadded(node) { var blockEnd = node.loc.end.line, last = node.body[node.body.length - 1], - lastLine = context.getLastToken(last).loc.end.line, + lastToken = context.getLastToken(last), + lastLine = lastToken.loc.end.line, expectedLastLine = blockEnd - 2, - trailingComments = context.getComments(last).trailing; + trailingComments = (node.body[node.body.length - 1].trailingComments || []).slice(), + lastComment; - if (trailingComments.length > 0) { - lastLine = trailingComments[trailingComments.length - 1].loc.end.line; + while (trailingComments.length > 0 && + trailingComments[trailingComments.length - 1].loc.end.line >= node.loc.end.line) { + trailingComments.pop(); + } + + lastComment = trailingComments[trailingComments.length - 1]; + + if (lastComment && isLocatedBefore(lastToken, lastComment)) { + lastLine = lastComment.loc.end.line; } return lastLine <= expectedLastLine; @@ -69,9 +96,12 @@ module.exports = function (context) { if (!blockHasTopPadding) { context.report(node, ALWAYS_MESSAGE); } - if (!blockHasBottomPadding) { - context.report(node, node.loc.end, ALWAYS_MESSAGE); + context.report({ + node: node, + loc: {line: node.loc.end.line, column: node.loc.end.column - 1 }, + message: ALWAYS_MESSAGE + }); } } else { if (blockHasTopPadding) { @@ -79,7 +109,11 @@ module.exports = function (context) { } if (blockHasBottomPadding) { - context.report(node, node.loc.end, NEVER_MESSAGE); + context.report({ + node: node, + loc: {line: node.loc.end.line, column: node.loc.end.column - 1 }, + message: NEVER_MESSAGE + }); } } } 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..f7f26ca2581b99 --- /dev/null +++ b/tools/eslint/lib/rules/prefer-arrow-callback.js @@ -0,0 +1,206 @@ +/** + * @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..a866a6d20cc193 100644 --- a/tools/eslint/lib/rules/prefer-const.js +++ b/tools/eslint/lib/rules/prefer-const.js @@ -7,29 +7,145 @@ "use strict"; //------------------------------------------------------------------------------ -// Rule Definition +// Helpers //------------------------------------------------------------------------------ -module.exports = function(context) { +var LOOP_TYPES = /^(?:While|DoWhile|For|ForIn|ForOf)Statement$/; +var FOR_IN_OF_TYPES = /^For(?:In|Of)Statement$/; +var SENTINEL_TYPES = /(?:Declaration|Statement)$/; +var END_POSITION_TYPES = /^(?:Assignment|Update)/; - /** - * Checks whether a reference is the initializer. - * @param {Reference} reference - A reference to check. - * @returns {boolean} Whether or not the reference is the initializer. - */ - function isInitializer(reference) { - return reference.init === true; +/** + * Gets a write reference from a given variable if the variable is modified only + * once. + * + * @param {escope.Variable} variable - A variable to get. + * @returns {escope.Reference|null} A write reference or null. + */ +function getWriteReferenceIfOnce(variable) { + var retv = null; + + var references = variable.references; + for (var i = 0; i < references.length; ++i) { + var reference = references[i]; + + if (reference.isWrite()) { + if (retv && !(retv.init && reference.init)) { + // This variable is modified two or more times. + return null; + } + retv = reference; + } } - /** - * 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; + return retv; +} + +/** + * Checks whether or not a given reference is in a loop condition or a + * for-loop's updater. + * + * @param {escope.Reference} reference - A reference to check. + * @returns {boolean} `true` if the reference is in a loop condition or a + * for-loop's updater. + */ +function isInLoopHead(reference) { + var node = reference.identifier; + var parent = node.parent; + var assignment = false; + + while (parent) { + if (LOOP_TYPES.test(parent.type)) { + return true; + } + + // VariableDeclaration can be at ForInStatement.left + // This is catching the code like `for (const {b = ++a} of foo()) { ... }` + if (assignment && + parent.type === "VariableDeclaration" && + FOR_IN_OF_TYPES.test(parent.parent.type) && + parent.parent.left === parent + ) { + return true; + } + if (parent.type === "AssignmentPattern") { + assignment = true; + } + + // If a declaration or a statement was found before a loop, + // it's not in the head of a loop. + if (SENTINEL_TYPES.test(parent.type)) { + break; + } + + node = parent; + parent = parent.parent; + } + + return false; +} + +/** + * Gets the end position of a given reference. + * This position is used to check every ReadReferences exist after the given + * reference. + * + * If the reference is belonging to AssignmentExpression or UpdateExpression, + * this function returns the most rear position of those nodes. + * The range of those nodes are executed before the assignment. + * + * @param {escope.Reference} writer - A reference to get. + * @returns {number} The end position of the reference. + */ +function getEndPosition(writer) { + var node = writer.identifier; + var end = node.range[1]; + + // Detects the end position of the assignment expression the reference is + // belonging to. + while ((node = node.parent)) { + if (END_POSITION_TYPES.test(node.type)) { + end = node.range[1]; + } + if (SENTINEL_TYPES.test(node.type)) { + break; + } } + return end; +} + +/** + * Gets a function which checks a given reference with the following condition: + * + * - The reference is a ReadReference. + * - The reference exists after a specific WriteReference. + * - The reference exists inside of the scope a specific WriteReference is + * belonging to. + * + * @param {escope.Reference} writer - A reference to check. + * @returns {function} A function which checks a given reference. + */ +function isInScope(writer) { + var start = getEndPosition(writer); + var end = writer.from.block.range[1]; + + return function(reference) { + if (!reference.isRead()) { + return true; + } + + var range = reference.identifier.range; + return start <= range[0] && range[1] <= end; + }; +} + +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ + +module.exports = function(context) { + /** * Searches and reports variables that are never modified after declared. * @param {Scope} scope - A scope of the search domain. @@ -42,7 +158,7 @@ module.exports = function(context) { } var variables = scope.variables; - for (var i = 0, end = variables.length; i < end; ++i) { + for (var i = 0; i < variables.length; ++i) { var variable = variables[i]; var def = variable.defs[0]; var declaration = def && def.parent; @@ -50,18 +166,35 @@ module.exports = function(context) { 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) + // Skips excludes `let`. + // And skips if it's at `ForStatement.init`. + if (!declaration || + declaration.type !== "VariableDeclaration" || + declaration.kind !== "let" || + (statement.type === "ForStatement" && statement.init === declaration) + ) { + continue; + } + + // Checks references. + // - One WriteReference exists. + // - Two or more WriteReference don't exist. + // - Every ReadReference exists after the WriteReference. + // - The WriteReference doesn't exist in a loop condition. + // - If `eslintUsed` is true, we cannot know where it was used from. + // In this case, if the scope of the variable would change, it + // skips the variable. + var writer = getWriteReferenceIfOnce(variable); + if (writer && + !(variable.eslintUsed && variable.scope !== writer.from) && + !isInLoopHead(writer) && + references.every(isInScope(writer)) ) { - context.report( - identifier, - "`{{name}}` is never modified, use `const` instead.", - {name: identifier.name}); + context.report({ + node: identifier, + message: "'{{name}}' is never modified, use 'const' instead.", + data: identifier + }); } } } @@ -75,7 +208,7 @@ module.exports = function(context) { var pushAll = Function.apply.bind(Array.prototype.push); return { - "Program:exit": function () { + "Program:exit": function() { var stack = [context.getScope()]; while (stack.length) { var scope = stack.pop(); diff --git a/tools/eslint/lib/rules/prefer-reflect.js b/tools/eslint/lib/rules/prefer-reflect.js new file mode 100644 index 00000000000000..4d320614bb0d2d --- /dev/null +++ b/tools/eslint/lib/rules/prefer-reflect.js @@ -0,0 +1,100 @@ +/** + * @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..8f904d9b6fde9c --- /dev/null +++ b/tools/eslint/lib/rules/prefer-rest-params.js @@ -0,0 +1,71 @@ +/** + * @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..7cb4e03e79c4d8 --- /dev/null +++ b/tools/eslint/lib/rules/prefer-template.js @@ -0,0 +1,96 @@ +/** + * @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..7f3e293f69ab8c 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,53 @@ 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 {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(tokens, skipNumberLiterals) { + return tokens.length === 1 && + (["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 +73,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(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 +98,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(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..10a349da797dfd 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 //------------------------------------------------------------------------------ @@ -26,8 +34,39 @@ var QUOTE_SETTINGS = { description: "backtick" } }; +/** + * 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"; +var AVOID_ESCAPE = "avoid-escape", + FUNCTION_TYPE = /^(?:Arrow)?Function(?:Declaration|Expression)$/; //------------------------------------------------------------------------------ // Rule Definition @@ -35,16 +74,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 +89,125 @@ 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..9ec5231fddad1b 100644 --- a/tools/eslint/lib/rules/radix.js +++ b/tools/eslint/lib/rules/radix.js @@ -11,31 +11,66 @@ module.exports = function(context) { + var MODE_ALWAYS = "always", + MODE_AS_NEEDED = "as-needed"; + + var mode = context.options[0] || MODE_ALWAYS; + return { "CallExpression": function(node) { var radix; - if (node.callee.name === "parseInt") { + if (!(node.callee.name === "parseInt" || ( + node.callee.type === "MemberExpression" && + node.callee.object.name === "Number" && + node.callee.property.name === "parseInt" + ) + )) { + return; + } - if (node.arguments.length < 2) { - context.report(node, "Missing radix parameter."); - } else { + if (node.arguments.length === 0) { + context.report({ + node: node, + message: "Missing parameters." + }); + } else if (node.arguments.length < 2 && mode === MODE_ALWAYS) { + context.report({ + node: node, + message: "Missing radix parameter." + }); + } else if (node.arguments.length > 1 && mode === MODE_AS_NEEDED && + (node.arguments[1] && node.arguments[1].type === "Literal" && + node.arguments[1].value === 10) + ) { + context.report({ + node: node, + message: "Redundant radix parameter." + }); + } else { - radix = node.arguments[1]; + radix = node.arguments[1]; - // 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."); - } + // don't allow non-numeric literals or undefined + if (radix && + ((radix.type === "Literal" && typeof radix.value !== "number") || + (radix.type === "Identifier" && radix.name === "undefined")) + ) { + context.report({ + node: node, + message: "Invalid radix parameter." + }); } - } + } }; }; -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..56d301a4458631 --- /dev/null +++ b/tools/eslint/lib/rules/require-yield.js @@ -0,0 +1,62 @@ +/** + * @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..879e1848b7242f 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,7 @@ 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 +45,7 @@ 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 +55,31 @@ 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 +105,52 @@ 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, " "); + } + }); } } } @@ -139,7 +175,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..c7a7fe3ec377c7 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,22 @@ 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 +118,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 +157,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 +181,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..d74648ddb4a476 --- /dev/null +++ b/tools/eslint/lib/rules/sort-imports.js @@ -0,0 +1,159 @@ +/** + * @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) { + node.specifiers.reduce(function(previousSpecifier, currentSpecifier) { + var currentSpecifierName = currentSpecifier.local.name, + previousSpecifierName = previousSpecifier.local.name; + + if (ignoreCase) { + currentSpecifierName = currentSpecifierName.toLowerCase(); + previousSpecifierName = previousSpecifierName.toLowerCase(); + } + + if (currentSpecifierName < previousSpecifierName) { + context.report({ + node: currentSpecifier, + message: "Member '{{memberName}}' of the import declaration should be sorted alphabetically.", + data: { + memberName: currentSpecifier.local.name + } + }); + } + + return currentSpecifier; + }, node.specifiers[0]); + } + + 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..68e03a1077aa79 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,234 @@ 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 (options.braceException) { + openers.push("{"); + closers.push("}"); } - if (missingSpaceOpeners.length) { - missingSpaceCheck = "\\((" + missingSpaceOpeners.join("|") + ")"; - if (missingSpaceClosers.length) { - missingSpaceCheck += "|"; - } + if (options.bracketException) { + openers.push("["); + closers.push("]"); } - if (missingSpaceClosers.length) { - missingSpaceCheck += "(" + missingSpaceClosers.join("|") + ")\\)"; - } - - // 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 (options.parenException) { + openers.push("("); + closers.push(")"); } - if (opts.parenException) { - missingSpaceOpeners.push("\\("); - missingSpaceClosers.push("\\)"); - rejectedSpaceOpeners.push(" \\("); - rejectedSpaceClosers.push("\\) "); - } - if (opts.empty) { - rejectedSpaceOpeners.push(" \\)"); - rejectedSpaceClosers.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 (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 - //-------------------------------------------------------------------------- - - return { + if (sourceCode.isSpaceBetweenTokens(left, right)) { + return false; + } - "Program:exit": function checkParenSpaces(node) { + if (ALWAYS) { + return !isCloserException(left); + } else { + return isCloserException(left); + } + } - var nextMatch, - nextLine, - column, - line = 1, - source = context.getSource(), - pos = 0; + /** + * 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; + } - function checkMatch(match, message) { - if (source.charAt(match.index) !== "(") { - // Matched a closing paren pattern - match.index += 1; - } + if (!astUtils.isTokenOnSameLine(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 (!sourceCode.isSpaceBetweenTokens(left, right)) { + return false; + } - context.report(node, { line: line, column: column }, message); - } - } + if (ALWAYS) { + return isOpenerException(right); + } else { + return !isOpenerException(right); + } + } - sortSkipRanges(); + /** + * 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; + } - while ((nextMatch = rejectedSpaceRegExp.exec(source)) !== null) { - checkMatch(nextMatch, REJECTED_SPACE_MESSAGE); - } + if (!astUtils.isTokenOnSameLine(left, right)) { + return false; + } - while ((nextMatch = missingSpaceRegExp.exec(source)) !== null) { - checkMatch(nextMatch, MISSING_SPACE_MESSAGE); - } + if (!sourceCode.isSpaceBetweenTokens(left, right)) { + return false; + } - }, + if (ALWAYS) { + return isCloserException(left); + } else { + return !isCloserException(left); + } + } + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- - // These nodes can contain parentheses that this rule doesn't care about + return { + "Program": function checkParenSpaces(node) { + var tokens, prevToken, nextToken; + 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..8d696e65b9f6e5 100644 --- a/tools/eslint/lib/rules/space-infix-ops.js +++ b/tools/eslint/lib/rules/space-infix-ops.js @@ -48,9 +48,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 +88,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 +105,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 +124,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..843f34625af129 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 === "!"; } /** @@ -39,18 +40,33 @@ module.exports = function(context) { * @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) { + function checkUnaryWordOperatorForSpaces(node, firstToken, secondToken, word) { + word = word || firstToken.value; + if (options.words) { if (secondToken.range[0] === firstToken.range[1]) { - context.report(node, "Unary word operator \"" + firstToken.value + "\" must be followed by whitespace."); + context.report({ + node: node, + message: "Unary word operator '" + word + "' must be followed by whitespace.", + fix: function(fixer) { + return fixer.insertTextAfter(firstToken, " "); + } + }); } } if (!options.words && isArgumentObjectExpression(node)) { 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 word operator '" + word + "'.", + fix: function(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); } } } @@ -67,30 +83,54 @@ 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 (isFirstBangInBangBangExpression(node)) { + return; } if (firstToken.range[1] === secondToken.range[0]) { - context.report(node, "Unary operator \"" + firstToken.value + "\" must be followed by whitespace."); + 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, "Space is required before unary expressions \"" + secondToken.value + "\"."); + context.report({ + node: node, + message: "Space is required before unary expressions '" + secondToken.value + "'.", + fix: function(fixer) { + return fixer.insertTextBefore(secondToken, " "); + } + }); } } } else { if (node.prefix) { if (secondToken.range[0] > firstToken.range[1]) { - context.report(node, "Unexpected space after unary 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, "Unexpected space before unary operator \"" + secondToken.value + "\"."); + context.report({ + node: node, + message: "Unexpected space before unary operator '" + secondToken.value + "'.", + fix: function(fixer) { + return fixer.removeRange([firstToken.range[1], secondToken.range[0]]); + } + }); } } } @@ -103,7 +143,17 @@ module.exports = function(context) { return { "UnaryExpression": checkForSpaces, "UpdateExpression": checkForSpaces, - "NewExpression": checkForSpaces + "NewExpression": checkForSpaces, + "YieldExpression": function(node) { + var tokens = context.getFirstTokens(node, 3), + word = "yield"; + + if (!node.argument || node.delegate) { + return; + } + + checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word); + } }; }; diff --git a/tools/eslint/lib/rules/spaced-comment.js b/tools/eslint/lib/rules/spaced-comment.js index a57cd8699d095b..2ee693ed808560 100644 --- a/tools/eslint/lib/rules/spaced-comment.js +++ b/tools/eslint/lib/rules/spaced-comment.js @@ -1,111 +1,215 @@ /** * @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; + s = lodash.escapeRegExp(s); + return isOneChar ? s : "(?:" + s + ")"; +} - // Unless the first option is never, require a space - var requireSpace = context.options[0] !== "never"; +/** + * 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) + "+"; +} - // 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]"); +/** + * 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) : []; - // Fetch the options dict - var hasOptions = context.options.length === 2; - var optionsDict = hasOptions ? context.options[1] : {}; + // `*` is a marker for JSDoc comments. + if (markers.indexOf("*") === -1) { + markers.push("*"); + } - // 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; + return markers; +} - // Now do the same for markers - var hasMarkers = hasOptions && optionsDict.markers && optionsDict.markers.length; - var unescapedMarkers = hasMarkers ? optionsDict.markers : []; - var markers; +/** + * 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 = "^"; - function escaper(s) { - return s.replace(/([.*+?${}()|\^\[\]\/\\])/g, "\\$1"); + // 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) { + // the marker. + pattern += escape(markers[0]); + } else { + // one of markers. + pattern += "(?:"; + pattern += markers.map(escape).join("|"); + pattern += ")"; } + pattern += "?"; // or nothing. - if (hasExceptions) { - exceptions = unescapedExceptions.map(escaper); - exceptionMatcher = new RegExp("(^(" + exceptions.join(")+$)|(^(") + ")+$)"); + // 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) + 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); +} - if (hasMarkers) { - markers = unescapedMarkers.map(escaper); - - // the markerMatcher includes any markers in the list, followed by space/tab - markerMatcher = new RegExp("((^(" + markers.join("))|(^(") + ")))[ \\t\\n]"); - } +/** + * 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]+"; + return new RegExp(pattern); +} - /** - * Check to see if the block comment is jsDoc comment - * @param {ASTNode} node comment node - * @returns {boolean} True if its jsdoc comment - * @private - */ - function isJsdoc(node) { - // make sure comment type is block and it start with /**\n - return node.type === "Block" && jsDocMatcher.test(node.value); - } +//------------------------------------------------------------------------------ +// Rule Definition +//------------------------------------------------------------------------------ +module.exports = function(context) { + // Unless the first option is never, require a space + var requireSpace = context.options[0] !== "never"; - function checkCommentForSpace(node) { - var commentIdentifier = node.type === "Block" ? "/*" : "//"; + // 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 || []; - if (requireSpace) { + // 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("|") + ")") + }; - // If length is zero, ignore it - if (node.value.length === 0) { - return; - } + return rule; + }, {}); - // if comment is jsdoc style then ignore it - if (isJsdoc(node)) { - return; - } + /** + * 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" ? "/*" : "//"; - // Check for markers now, and short-circuit if found - if (hasMarkers && markerMatcher.test(node.value)) { - return; - } + 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" ? "/*" : "//"; - if (node.value.indexOf(" ") === 0 || node.value.indexOf("\t") === 0) { - context.report(node, "Unexpected space or tab after " + commentIdentifier + " in comment."); - } - // 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] : ""; + // Ignores empty comments. + if (node.value.length === 0) { + return; + } - context.report(node, "Unexpected space or tab after marker (" + match + ") in comment."); + // Checks. + if (requireSpace) { + if (!rule.regex.test(node.value)) { + var hasMarker = rule.markers.exec(node.value); + var marker = hasMarker ? commentIdentifier + hasMarker[0] : commentIdentifier; + 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); + } + } + } else { + var matched = rule.regex.exec(node.value); + 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 +240,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..120ad87e64ec13 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,152 @@ 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..972e2daa28f0ec --- /dev/null +++ b/tools/eslint/lib/rules/template-curly-spacing.js @@ -0,0 +1,102 @@ +/** + * @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..d2a1dccde64017 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,102 @@ 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.expression.name; + } else { + currentType = type.name; + } + + expectedType = preferType[currentType]; + + return { + currentType: currentType, + expectedType: expectedType + }; + } + + /** + * Check if return tag type is void or undefined + * @param {Object} tag JSDoc tag + * @param {Object} jsdocNode JSDoc node + * @returns {void} + * @private + */ + function validateTagType(tag, jsdocNode) { + if (!tag.type || !canTypeBeValidated(tag.type.type)) { + return; + } + + var typesToCheck = []; + var elements = []; + + if (tag.type.type === "TypeApplication") { // {Array.} + elements = tag.type.applications; + typesToCheck.push(getCurrentExpectedTypes(tag.type)); + } else if (tag.type.type === "RecordType") { // {{20:String}} + elements = tag.type.fields; + } else if (tag.type.type === "UnionType") { // {String|number|Test} + elements = tag.type.elements; + } else { + typesToCheck.push(getCurrentExpectedTypes(tag.type)); + } + + elements.forEach(function(type) { + type = type.value ? type.value : type; // we have to use type.value for RecordType + if (canTypeBeValidated(type.type)) { + typesToCheck.push(getCurrentExpectedTypes(type)); + } + }); + + typesToCheck.forEach(function(type) { + if (type.expectedType && + type.expectedType !== type.currentType) { + context.report({ + node: jsdocNode, + message: "Use '{{expectedType}}' instead of '{{currentType}}'.", + data: { + currentType: type.currentType, + expectedType: type.expectedType + } + }); + } + }); + } + /** * Validate the JSDoc node and output warnings if anything is wrong. * @param {ASTNode} node The AST node to check. @@ -62,10 +176,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 +207,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 +231,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 +250,68 @@ 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) { + validateTagType(tag, jsdocNode); + } }); // 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; + + // 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] && !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 +325,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 +347,12 @@ module.exports.schema = [ "type": "string" } }, + "preferType": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, "requireReturn": { "type": "boolean" }, @@ -208,6 +361,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..b142e3b56a7106 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 @@ -61,6 +61,8 @@ module.exports = function (context) { return true; } } + + return false; } /** @@ -95,13 +97,13 @@ 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 === "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..87d4d5ed696655 100644 --- a/tools/eslint/lib/rules/wrap-iife.js +++ b/tools/eslint/lib/rules/wrap-iife.js @@ -14,6 +14,12 @@ 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); 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..2ddfe5ce1471aa --- /dev/null +++ b/tools/eslint/lib/rules/yield-star-spacing.js @@ -0,0 +1,101 @@ +/** + * @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..57ac261b95a790 100644 --- a/tools/eslint/lib/rules/yoda.js +++ b/tools/eslint/lib/rules/yoda.js @@ -114,7 +114,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 +197,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 +210,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..3aec32057f3346 --- /dev/null +++ b/tools/eslint/lib/testers/event-generator-tester.js @@ -0,0 +1,63 @@ +/** + * @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..b8e3cbdc1cbfb0 --- /dev/null +++ b/tools/eslint/lib/testers/rule-tester.js @@ -0,0 +1,438 @@ +/** + * @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 object on the left 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. + // To check whether or not AST was not modified in verify. + 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) { + 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..3af3a43c58e9e7 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,6 +46,12 @@ 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) @@ -82,6 +104,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; diff --git a/tools/eslint/lib/util.js b/tools/eslint/lib/util.js index 9fe594a4aed093..44d6a7d0cfdcd2 100644 --- a/tools/eslint/lib/util.js +++ b/tools/eslint/lib/util.js @@ -7,79 +7,16 @@ // 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. + * Gets the last element of a given array. + * @param {any[]} xs - An array to get. + * @returns {any|null} The last element, or `null` if the array is empty. */ -exports.removePluginPrefix = function removePluginPrefix(pluginName) { - return pluginName.indexOf(PLUGIN_NAME_PREFIX) === 0 ? pluginName.substring(PLUGIN_NAME_PREFIX.length) : pluginName; -}; +function getLast(xs) { + var length = xs.length; + return (length === 0 ? null : xs[length - 1]); +} -/** - * @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] : ""; +module.exports = { + getLast: getLast }; - -/** - * 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..fb56ee1c05141a --- /dev/null +++ b/tools/eslint/lib/util/comment-event-generator.js @@ -0,0 +1,116 @@ +/** + * @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/estraverse.js b/tools/eslint/lib/util/estraverse.js new file mode 100644 index 00000000000000..d2e0d9a8f10217 --- /dev/null +++ b/tools/eslint/lib/util/estraverse.js @@ -0,0 +1,55 @@ +/** + * @fileoverview Patch for estraverse + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +var estraverse = require("estraverse"), + jsxKeys = require("estraverse-fb/keys"); + +//------------------------------------------------------------------------------ +// Helers +//------------------------------------------------------------------------------ + +var experimentalKeys = { + ExperimentalRestProperty: ["argument"], + ExperimentalSpreadProperty: ["argument"] +}; + +/** + * Adds a given keys to Syntax and VisitorKeys of estraverse. + * + * @param {object} keys - Key definitions to add. + * This is an object as map. + * Keys are the node type. + * Values are an array of property names to visit. + * @returns {void} + */ +function installKeys(keys) { + for (var key in keys) { + /* istanbul ignore else */ + if (keys.hasOwnProperty(key)) { + estraverse.Syntax[key] = key; + if (keys[key]) { + estraverse.VisitorKeys[key] = keys[key]; + } + } + } +} + +// Add JSX node types. +installKeys(jsxKeys); +// Add Experimental node types. +installKeys(experimentalKeys); + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = estraverse; diff --git a/tools/eslint/lib/util/glob-util.js b/tools/eslint/lib/util/glob-util.js new file mode 100644 index 00000000000000..68e64cba64260d --- /dev/null +++ b/tools/eslint/lib/util/glob-util.js @@ -0,0 +1,151 @@ +/** + * @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"), + glob = require("glob"), + shell = require("shelljs"), + + 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 {string[]} extensions An array of accepted extensions + * @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(extensions) { + 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; + + if (shell.test("-d", pathname)) { + newPath = pathname.replace(/[\/\\]$/, "") + suffix; + } + + return newPath.replace(/\\/g, "/").replace(/^\.\//, ""); + }; +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Resolves the patterns into glob-based patterns for easier handling. + * @param {string[]} patterns File patterns (such as passed on the command line). + * @param {string[]} extensions List of valid file extensions. + * @returns {string[]} The equivalent glob patterns. + */ +function resolveFileGlobPatterns(patterns, extensions) { + extensions = extensions || [".js"]; + + extensions = extensions.map(function(ext) { + return ext.charAt(0) === "." ? ext.substr(1) : ext; + }); + + var processPathExtensions = processPath(extensions); + 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 {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, + ignoredPathsList, + files = [], + added = {}, + globOptions, + rulesKey = "_rules"; + + /** + * 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 + * @returns {void} + */ + function addFile(filename) { + if (ignoredPaths.contains(filename)) { + return; + } + filename = fs.realpathSync(filename); + if (added[filename]) { + return; + } + files.push(filename); + added[filename] = true; + } + + options = options || { ignore: true, dotfiles: true }; + ignoredPaths = new IgnoredPaths(options); + ignoredPathsList = ignoredPaths.ig.custom[rulesKey].map(function(rule) { + return rule.pattern; + }); + globOptions = { + nodir: true, + ignore: ignoredPathsList + }; + + debug("Creating list of files to process."); + globPatterns.forEach(function(pattern) { + if (shell.test("-f", pattern)) { + addFile(pattern); + } else { + glob.sync(pattern, globOptions).forEach(addFile); + } + }); + + return files; +} + +module.exports = { + resolveFileGlobPatterns: resolveFileGlobPatterns, + listFilesToProcess: listFilesToProcess +}; 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/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..fc9d3a6c7006ef --- /dev/null +++ b/tools/eslint/lib/util/npm-util.js @@ -0,0 +1,125 @@ +/** + * @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/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..da7a1f98d05b6d --- /dev/null +++ b/tools/eslint/lib/util/source-code-fixer.js @@ -0,0 +1,140 @@ +/** + * @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..3a5396fdc0e87a --- /dev/null +++ b/tools/eslint/lib/util/source-code-util.js @@ -0,0 +1,108 @@ +/** + * @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.extensions); + filenames = globUtil.listFilesToProcess(patterns, opts); + 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..9dd0a451203a87 --- /dev/null +++ b/tools/eslint/lib/util/source-code.js @@ -0,0 +1,302 @@ +/** + * @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"), + estraverse = require("./estraverse"); + +//------------------------------------------------------------------------------ +// 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; + var resultParent = null; + + estraverse.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/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/.editorconfig b/tools/eslint/node_modules/acorn-jsx/.editorconfig new file mode 100644 index 00000000000000..c14d5c67b407d8 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true diff --git a/tools/eslint/node_modules/acorn-jsx/.gitattributes b/tools/eslint/node_modules/acorn-jsx/.gitattributes new file mode 100644 index 00000000000000..fcadb2cf97913f --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/tools/eslint/node_modules/acorn-jsx/.npmignore b/tools/eslint/node_modules/acorn-jsx/.npmignore new file mode 100644 index 00000000000000..07e6e472cc75fa --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/.npmignore @@ -0,0 +1 @@ +/node_modules diff --git a/tools/eslint/node_modules/acorn-jsx/.travis.yml b/tools/eslint/node_modules/acorn-jsx/.travis.yml new file mode 100644 index 00000000000000..ffb9f710ac283a --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/.travis.yml @@ -0,0 +1,2 @@ +language: node_js +node_js: '0.10' 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/package.json b/tools/eslint/node_modules/acorn-jsx/package.json new file mode 100644 index 00000000000000..5d5856fee0c529 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/package.json @@ -0,0 +1,77 @@ +{ + "_args": [ + [ + "acorn-jsx@^2.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/espree" + ] + ], + "_from": "acorn-jsx@>=2.0.1 <3.0.0", + "_id": "acorn-jsx@2.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/acorn-jsx", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "me@rreverser.com", + "name": "rreverser" + }, + "_npmVersion": "3.2.2", + "_phantomChildren": {}, + "_requested": { + "name": "acorn-jsx", + "raw": "acorn-jsx@^2.0.1", + "rawSpec": "^2.0.1", + "scope": null, + "spec": ">=2.0.1 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint/espree" + ], + "_resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-2.0.1.tgz", + "_shasum": "0edf9878a5866bca625f52955a1ed9e7d8c5117e", + "_shrinkwrap": null, + "_spec": "acorn-jsx@^2.0.1", + "_where": "/Users/trott/test/node_modules/eslint/node_modules/espree", + "bugs": { + "url": "https://github.com/RReverser/acorn-jsx/issues" + }, + "dependencies": { + "acorn": "^2.0.1" + }, + "description": "Alternative, faster React.js JSX parser", + "devDependencies": { + "chai": "^3.0.0", + "mocha": "^2.2.5" + }, + "directories": {}, + "dist": { + "shasum": "0edf9878a5866bca625f52955a1ed9e7d8c5117e", + "tarball": "http://registry.npmjs.org/acorn-jsx/-/acorn-jsx-2.0.1.tgz" + }, + "gitHead": "cdc624d83767518d174a7873054ff9f2984eb83c", + "homepage": "https://github.com/RReverser/acorn-jsx", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.githubusercontent.com/RReverser/acorn-jsx/master/LICENSE" + } + ], + "maintainers": [ + { + "email": "me@rreverser.com", + "name": "rreverser" + } + ], + "name": "acorn-jsx", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/RReverser/acorn-jsx.git" + }, + "scripts": { + "test": "node test/run.js" + }, + "version": "2.0.1" +} diff --git a/tools/eslint/node_modules/acorn-jsx/test/driver.js b/tools/eslint/node_modules/acorn-jsx/test/driver.js new file mode 100644 index 00000000000000..01ec6c619a121b --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/test/driver.js @@ -0,0 +1,107 @@ +var tests = []; + +exports.test = function(code, ast, options) { + tests.push({code: code, ast: ast, options: options}); +}; +exports.testFail = function(code, message, options) { + tests.push({code: code, error: message, options: options}); +}; +exports.testAssert = function(code, assert, options) { + tests.push({code: code, assert: assert, options: options}); +}; + +exports.runTests = function(config, callback) { + var parse = config.parse; + + for (var i = 0; i < tests.length; ++i) { + var test = tests[i]; + if (config.filter && !config.filter(test)) continue; + try { + var testOpts = test.options || {locations: true}; + var expected = {}; + if (expected.onComment = testOpts.onComment) { + testOpts.onComment = [] + } + if (expected.onToken = testOpts.onToken) { + testOpts.onToken = []; + } + testOpts.plugins = { jsx: true }; + var ast = parse(test.code, testOpts); + if (test.error) { + if (config.loose) { + callback("ok", test.code); + } else { + callback("fail", test.code, "Expected error message: " + test.error + "\nBut parsing succeeded."); + } + } + else if (test.assert) { + var error = test.assert(ast); + if (error) callback("fail", test.code, + "\n Assertion failed:\n " + error); + else callback("ok", test.code); + } else { + var mis = misMatch(test.ast, ast); + for (var name in expected) { + if (mis) break; + if (expected[name]) { + mis = misMatch(expected[name], testOpts[name]); + testOpts[name] = expected[name]; + } + } + if (mis) callback("fail", test.code, mis); + else callback("ok", test.code); + } + } catch(e) { + if (!(e instanceof SyntaxError)) { + throw e; + } + if (test.error) { + if (e.message == test.error) callback("ok", test.code); + else callback("fail", test.code, + "Expected error message: " + test.error + "\nGot error message: " + e.message); + } else { + callback("error", test.code, e.stack || e.toString()); + } + } + } +}; + +function ppJSON(v) { return v instanceof RegExp ? v.toString() : JSON.stringify(v, null, 2); } +function addPath(str, pt) { + if (str.charAt(str.length-1) == ")") + return str.slice(0, str.length-1) + "/" + pt + ")"; + return str + " (" + pt + ")"; +} + +var misMatch = exports.misMatch = function(exp, act) { + if (!exp || !act || (typeof exp != "object") || (typeof act != "object")) { + if (exp !== act) return ppJSON(exp) + " !== " + ppJSON(act); + } else if (exp instanceof RegExp || act instanceof RegExp) { + var left = ppJSON(exp), right = ppJSON(act); + if (left !== right) return left + " !== " + right; + } else if (exp.splice) { + if (!act.slice) return ppJSON(exp) + " != " + ppJSON(act); + if (act.length != exp.length) return "array length mismatch " + exp.length + " != " + act.length; + for (var i = 0; i < act.length; ++i) { + var mis = misMatch(exp[i], act[i]); + if (mis) return addPath(mis, i); + } + } else { + for (var prop in exp) { + var mis = misMatch(exp[prop], act[prop]); + if (mis) return addPath(mis, prop); + } + } +}; + +function mangle(ast) { + if (typeof ast != "object" || !ast) return; + if (ast.slice) { + for (var i = 0; i < ast.length; ++i) mangle(ast[i]); + } else { + var loc = ast.start && ast.end && {start: ast.start, end: ast.end}; + if (loc) { delete ast.start; delete ast.end; } + for (var name in ast) if (ast.hasOwnProperty(name)) mangle(ast[name]); + if (loc) ast.loc = loc; + } +} diff --git a/tools/eslint/node_modules/acorn-jsx/test/run.js b/tools/eslint/node_modules/acorn-jsx/test/run.js new file mode 100644 index 00000000000000..eda0a768a7f663 --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/test/run.js @@ -0,0 +1,70 @@ +var driver = require("./driver.js"); +require("./tests-jsx.js"); + +function group(name) { + if (typeof console === "object" && console.group) { + console.group(name); + } +} + +function groupEnd() { + if (typeof console === "object" && console.groupEnd) { + console.groupEnd(name); + } +} + +function log(title, message) { + if (typeof console === "object") console.log(title, message); +} + +var stats, modes = { + Normal: { + config: { + parse: require("..").parse + } + } +}; + +function report(state, code, message) { + if (state != "ok") {++stats.failed; log(code, message);} + ++stats.testsRun; +} + +group("Errors"); + +for (var name in modes) { + group(name); + var mode = modes[name]; + stats = mode.stats = {testsRun: 0, failed: 0}; + var t0 = +new Date; + driver.runTests(mode.config, report); + mode.stats.duration = +new Date - t0; + groupEnd(); +} + +groupEnd(); + +function outputStats(name, stats) { + log(name + ":", stats.testsRun + " tests run in " + stats.duration + "ms; " + + (stats.failed ? stats.failed + " failures." : "all passed.")); +} + +var total = {testsRun: 0, failed: 0, duration: 0}; + +group("Stats"); + +for (var name in modes) { + var stats = modes[name].stats; + outputStats(name + " parser", stats); + for (var key in stats) total[key] += stats[key]; +} + +outputStats("Total", total); + +groupEnd(); + +if (total.failed && typeof process === "object") { + process.stdout.write("", function() { + process.exit(1); + }); +} diff --git a/tools/eslint/node_modules/acorn-jsx/test/tests-jsx.js b/tools/eslint/node_modules/acorn-jsx/test/tests-jsx.js new file mode 100644 index 00000000000000..48e6a1d5460bda --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/test/tests-jsx.js @@ -0,0 +1,3719 @@ +// React JSX tests + +var fbTestFixture = { + // Taken and adapted from esprima-fb/fbtest.js. + 'JSX': { + '': { + type: "ExpressionStatement", + expression: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "a", + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + selfClosing: true, + attributes: [], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + closingElement: null, + children: [], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + + '': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXNamespacedName', + namespace: { + type: 'JSXIdentifier', + name: 'n', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + name: { + type: 'JSXIdentifier', + name: 'a', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }, + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, + selfClosing: true, + attributes: [{ + type: 'JSXAttribute', + name: { + type: 'JSXNamespacedName', + namespace: { + type: 'JSXIdentifier', + name: 'n', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + name: { + type: 'JSXIdentifier', + name: 'v', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + value: null, + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }], + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + closingElement: null, + children: [], + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + ' {value} ': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + selfClosing: false, + attributes: [{ + type: 'JSXAttribute', + name: { + type: 'JSXNamespacedName', + namespace: { + type: 'JSXIdentifier', + name: 'n', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }, + name: { + type: 'JSXIdentifier', + name: 'foo', + range: [5, 8], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 8 } + } + }, + range: [3, 8], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 8 } + } + }, + value: { + type: 'Literal', + value: 'bar', + raw: '"bar"', + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + range: [3, 14], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 14 } + } + }], + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXIdentifier', + name: 'a', + range: [38, 39], + loc: { + start: { line: 1, column: 38 }, + end: { line: 1, column: 39 } + } + }, + range: [36, 40], + loc: { + start: { line: 1, column: 36 }, + end: { line: 1, column: 40 } + } + }, + children: [{ + type: 'Literal', + value: ' ', + raw: ' ', + range: [15, 16], + loc: { + start: { line: 1, column: 15 }, + end: { line: 1, column: 16 } + } + }, { + type: 'JSXExpressionContainer', + expression: { + type: 'Identifier', + name: 'value', + range: [17, 22], + loc: { + start: { line: 1, column: 17 }, + end: { line: 1, column: 22 } + } + }, + range: [16, 23], + loc: { + start: { line: 1, column: 16 }, + end: { line: 1, column: 23 } + } + }, { + type: 'Literal', + value: ' ', + raw: ' ', + range: [23, 24], + loc: { + start: { line: 1, column: 23 }, + end: { line: 1, column: 24 } + } + }, { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'b', + range: [25, 26], + loc: { + start: { line: 1, column: 25 }, + end: { line: 1, column: 26 } + } + }, + selfClosing: false, + attributes: [], + range: [24, 27], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 27 } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXIdentifier', + name: 'b', + range: [34, 35], + loc: { + start: { line: 1, column: 34 }, + end: { line: 1, column: 35 } + } + }, + range: [32, 36], + loc: { + start: { line: 1, column: 32 }, + end: { line: 1, column: 36 } + } + }, + children: [{ + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'c', + range: [28, 29], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 29 } + } + }, + selfClosing: true, + attributes: [], + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }, + closingElement: null, + children: [], + range: [27, 32], + loc: { + start: { line: 1, column: 27 }, + end: { line: 1, column: 32 } + } + }], + range: [24, 36], + loc: { + start: { line: 1, column: 24 }, + end: { line: 1, column: 36 } + } + }], + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 40 } + } + }, + range: [0, 40], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 40 } + } + }, + + '': { + type: "ExpressionStatement", + expression: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "a", + range: [1, 2] + }, + selfClosing: true, + attributes: [ + { + type: "JSXAttribute", + name: { + type: "JSXIdentifier", + name: "b", + range: [3, 4] + }, + value: { + type: "JSXExpressionContainer", + expression: { + type: "Literal", + value: " ", + raw: "\" \"", + range: [6, 9] + }, + range: [5, 10] + }, + range: [3, 10] + }, + { + type: "JSXAttribute", + name: { + type: "JSXIdentifier", + name: "c", + range: [11, 12] + }, + value: { + type: "Literal", + value: " ", + raw: "\" \"", + range: [13, 16] + }, + range: [11, 16] + }, + { + type: "JSXAttribute", + name: { + type: "JSXIdentifier", + name: "d", + range: [17, 18] + }, + value: { + type: "Literal", + value: "&", + raw: "\"&\"", + range: [19, 26] + }, + range: [17, 26] + }, + { + type: "JSXAttribute", + name: { + type: "JSXIdentifier", + name: "e", + range: [27, 28] + }, + value: { + type: "Literal", + value: "&r;", + raw: "\"&r;\"", + range: [29, 37] + }, + range: [27, 37] + } + ], + range: [0, 40] + }, + closingElement: null, + children: [], + range: [0, 40] + }, + range: [0, 40] + }, + + '': { + type: "ExpressionStatement", + expression: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "a", + range: [ + 1, + 2 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 2 + } + } + }, + selfClosing: true, + attributes: [], + range: [ + 0, + 5 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 2, + column: 2 + } + } + }, + closingElement: null, + children: [], + range: [ + 0, + 5 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 2, + column: 2 + } + } + }, + range: [ + 0, + 5 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 2, + column: 2 + } + } + }, + + '<日本語>': { + type: "ExpressionStatement", + expression: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "日本語", + range: [ + 1, + 4 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 4 + } + } + }, + selfClosing: false, + attributes: [], + range: [ + 0, + 5 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 5 + } + } + }, + closingElement: { + type: "JSXClosingElement", + name: { + type: "JSXIdentifier", + name: "日本語", + range: [ + 7, + 10 + ], + loc: { + start: { + line: 1, + column: 7 + }, + end: { + line: 1, + column: 10 + } + } + }, + range: [ + 5, + 11 + ], + loc: { + start: { + line: 1, + column: 5 + }, + end: { + line: 1, + column: 11 + } + } + }, + children: [], + range: [ + 0, + 11 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 11 + } + } + }, + range: [ + 0, + 11 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 11 + } + } + }, + + '\nbar\nbaz\n': { + type: "ExpressionStatement", + expression: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "AbC-def", + range: [ + 1, + 8 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 8 + } + } + }, + selfClosing: false, + attributes: [ + { + type: "JSXAttribute", + name: { + type: "JSXIdentifier", + name: "test", + range: [ + 11, + 15 + ], + loc: { + start: { + line: 2, + column: 2 + }, + end: { + line: 2, + column: 6 + } + } + }, + value: { + type: "Literal", + value: "&&", + raw: "\"&&\"", + range: [ + 16, + 31 + ], + loc: { + start: { + line: 2, + column: 7 + }, + end: { + line: 2, + column: 22 + } + } + }, + range: [ + 11, + 31 + ], + loc: { + start: { + line: 2, + column: 2 + }, + end: { + line: 2, + column: 22 + } + } + } + ], + range: [ + 0, + 32 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 2, + column: 23 + } + } + }, + closingElement: { + type: "JSXClosingElement", + name: { + type: "JSXIdentifier", + name: "AbC-def", + range: [ + 43, + 50 + ], + loc: { + start: { + line: 5, + column: 2 + }, + end: { + line: 5, + column: 9 + } + } + }, + range: [ + 41, + 51 + ], + loc: { + start: { + line: 5, + column: 0 + }, + end: { + line: 5, + column: 10 + } + } + }, + children: [ + { + type: "Literal", + value: "\nbar\nbaz\n", + raw: "\nbar\nbaz\n", + range: [ + 32, + 41 + ], + loc: { + start: { + line: 2, + column: 23 + }, + end: { + line: 5, + column: 0 + } + } + } + ], + range: [ + 0, + 51 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 5, + column: 10 + } + } + }, + range: [ + 0, + 51 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 5, + column: 10 + } + } + }, + + ' : } />': { + type: "ExpressionStatement", + expression: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "a", + range: [ + 1, + 2 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 2 + } + } + }, + selfClosing: true, + attributes: [ + { + type: "JSXAttribute", + name: { + type: "JSXIdentifier", + name: "b", + range: [ + 3, + 4 + ], + loc: { + start: { + line: 1, + column: 3 + }, + end: { + line: 1, + column: 4 + } + } + }, + value: { + type: "JSXExpressionContainer", + expression: { + type: "ConditionalExpression", + test: { + type: "Identifier", + name: "x", + range: [ + 6, + 7 + ], + loc: { + start: { + line: 1, + column: 6 + }, + end: { + line: 1, + column: 7 + } + } + }, + consequent: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "c", + range: [ + 11, + 12 + ], + loc: { + start: { + line: 1, + column: 11 + }, + end: { + line: 1, + column: 12 + } + } + }, + selfClosing: true, + attributes: [], + range: [ + 10, + 15 + ], + loc: { + start: { + line: 1, + column: 10 + }, + end: { + line: 1, + column: 15 + } + } + }, + closingElement: null, + children: [], + range: [ + 10, + 15 + ], + loc: { + start: { + line: 1, + column: 10 + }, + end: { + line: 1, + column: 15 + } + } + }, + alternate: { + type: "JSXElement", + openingElement: { + type: "JSXOpeningElement", + name: { + type: "JSXIdentifier", + name: "d", + range: [ + 19, + 20 + ], + loc: { + start: { + line: 1, + column: 19 + }, + end: { + line: 1, + column: 20 + } + } + }, + selfClosing: true, + attributes: [], + range: [ + 18, + 23 + ], + loc: { + start: { + line: 1, + column: 18 + }, + end: { + line: 1, + column: 23 + } + } + }, + closingElement: null, + children: [], + range: [ + 18, + 23 + ], + loc: { + start: { + line: 1, + column: 18 + }, + end: { + line: 1, + column: 23 + } + } + }, + range: [ + 6, + 23 + ], + loc: { + start: { + line: 1, + column: 6 + }, + end: { + line: 1, + column: 23 + } + } + }, + range: [ + 5, + 24 + ], + loc: { + start: { + line: 1, + column: 5 + }, + end: { + line: 1, + column: 24 + } + } + }, + range: [ + 3, + 24 + ], + loc: { + start: { + line: 1, + column: 3 + }, + end: { + line: 1, + column: 24 + } + } + } + ], + range: [ + 0, + 27 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 27 + } + } + }, + closingElement: null, + children: [], + range: [ + 0, + 27 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 27 + } + } + }, + range: [ + 0, + 27 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 27 + } + } + }, + + '{}': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + selfClosing: false, + attributes: [], + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXIdentifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + range: [5, 9], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 9 } + } + }, + children: [{ + type: 'JSXExpressionContainer', + expression: { + type: 'JSXEmptyExpression', + range: [4, 4], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 4 } + } + }, + range: [3, 5], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 5 } + } + }], + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + range: [0, 9], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 9 } + } + }, + + '{/* this is a comment */}': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + selfClosing: false, + attributes: [], + range: [0, 3], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 3 } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXIdentifier', + name: 'a', + range: [30, 31], + loc: { + start: { line: 1, column: 30 }, + end: { line: 1, column: 31 } + } + }, + range: [28, 32], + loc: { + start: { line: 1, column: 28 }, + end: { line: 1, column: 32 } + } + }, + children: [{ + type: 'JSXExpressionContainer', + expression: { + type: 'JSXEmptyExpression', + range: [4, 27], + loc: { + start: { line: 1, column: 4 }, + end: { line: 1, column: 27 } + } + }, + range: [3, 28], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 28 } + } + }], + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + range: [0, 32], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 32 } + } + }, + + '
      @test content
      ': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'div', + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, + selfClosing: false, + attributes: [], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXIdentifier', + name: 'div', + range: [20, 23], + loc: { + start: { line: 1, column: 20 }, + end: { line: 1, column: 23 } + } + }, + range: [18, 24], + loc: { + start: { line: 1, column: 18 }, + end: { line: 1, column: 24 } + } + }, + children: [{ + type: 'Literal', + value: '@test content', + raw: '@test content', + range: [5, 18], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 18 } + } + }], + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + range: [0, 24], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 24 } + } + }, + + '

      7x invalid-js-identifier
      ': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'div', + range: [ + 1, + 4 + ], + loc: { + start: { + line: 1, + column: 1 + }, + end: { + line: 1, + column: 4 + } + } + }, + selfClosing: false, + attributes: [], + range: [ + 0, + 5 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 5 + } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXIdentifier', + name: 'div', + range: [ + 37, + 40 + ], + loc: { + start: { + line: 1, + column: 37 + }, + end: { + line: 1, + column: 40 + } + } + }, + range: [ + 35, + 41 + ], + loc: { + start: { + line: 1, + column: 35 + }, + end: { + line: 1, + column: 41 + } + } + }, + children: [{ + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'br', + range: [ + 6, + 8 + ], + loc: { + start: { + line: 1, + column: 6 + }, + end: { + line: 1, + column: 8 + } + } + }, + selfClosing: true, + attributes: [], + range: [ + 5, + 11 + ], + loc: { + start: { + line: 1, + column: 5 + }, + end: { + line: 1, + column: 11 + } + } + }, + closingElement: null, + children: [], + range: [ + 5, + 11 + ], + loc: { + start: { + line: 1, + column: 5 + }, + end: { + line: 1, + column: 11 + } + } + }, { + type: 'Literal', + value: '7x invalid-js-identifier', + raw: '7x invalid-js-identifier', + range: [ + 11, + 35 + ], + loc: { + start: { + line: 1, + column: 11 + }, + end: { + line: 1, + column: 35 + } + } + }], + range: [ + 0, + 41 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 41 + } + } + }, + range: [ + 0, + 41 + ], + loc: { + start: { + line: 1, + column: 0 + }, + end: { + line: 1, + column: 41 + } + } + }, + + ' right=monkeys /> gorillas />': { + "type": "ExpressionStatement", + "expression": { + "type": "JSXElement", + "openingElement": { + "type": "JSXOpeningElement", + "name": { + "type": "JSXIdentifier", + "name": "LeftRight", + "range": [ + 1, + 10 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 10 + } + } + }, + "selfClosing": true, + "attributes": [ + { + "type": "JSXAttribute", + "name": { + "type": "JSXIdentifier", + "name": "left", + "range": [ + 11, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + "value": { + "type": "JSXElement", + "openingElement": { + "type": "JSXOpeningElement", + "name": { + "type": "JSXIdentifier", + "name": "a", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "selfClosing": true, + "attributes": [], + "range": [ + 16, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + } + }, + closingElement: null, + "children": [], + "range": [ + 16, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 21 + } + } + }, + "range": [ + 11, + 21 + ], + "loc": { + "start": { + "line": 1, + "column": 11 + }, + "end": { + "line": 1, + "column": 21 + } + } + }, + { + "type": "JSXAttribute", + "name": { + "type": "JSXIdentifier", + "name": "right", + "range": [ + 22, + 27 + ], + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 27 + } + } + }, + "value": { + "type": "JSXElement", + "openingElement": { + "type": "JSXOpeningElement", + "name": { + "type": "JSXIdentifier", + "name": "b", + "range": [ + 29, + 30 + ], + "loc": { + "start": { + "line": 1, + "column": 29 + }, + "end": { + "line": 1, + "column": 30 + } + } + }, + "selfClosing": false, + "attributes": [], + "range": [ + 28, + 31 + ], + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 31 + } + } + }, + "closingElement": { + "type": "JSXClosingElement", + "name": { + "type": "JSXIdentifier", + "name": "b", + "range": [ + 52, + 53 + ], + "loc": { + "start": { + "line": 1, + "column": 52 + }, + "end": { + "line": 1, + "column": 53 + } + } + }, + "range": [ + 50, + 54 + ], + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 54 + } + } + }, + "children": [ + { + "type": "Literal", + "value": "monkeys /> gorillas", + "raw": "monkeys /> gorillas", + "range": [ + 31, + 50 + ], + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 50 + } + } + } + ], + "range": [ + 28, + 54 + ], + "loc": { + "start": { + "line": 1, + "column": 28 + }, + "end": { + "line": 1, + "column": 54 + } + } + }, + "range": [ + 22, + 54 + ], + "loc": { + "start": { + "line": 1, + "column": 22 + }, + "end": { + "line": 1, + "column": 54 + } + } + } + ], + "range": [ + 0, + 57 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + } + }, + closingElement: null, + "children": [], + "range": [ + 0, + 57 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + } + }, + "range": [ + 0, + 57 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 57 + } + } + }, + + '': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXMemberExpression', + object: { + type: 'JSXIdentifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + property: { + type: 'JSXIdentifier', + name: 'b', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }, + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, + selfClosing: false, + attributes: [], + range: [0, 5], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 5 } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXMemberExpression', + object: { + type: 'JSXIdentifier', + name: 'a', + range: [7, 8], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 8 } + } + }, + property: { + type: 'JSXIdentifier', + name: 'b', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + range: [7, 10], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 10 } + } + }, + range: [5, 11], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 11 } + } + }, + children: [], + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + range: [0, 11], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 11 } + } + }, + + '': { + type: 'ExpressionStatement', + expression: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXMemberExpression', + object: { + type: 'JSXMemberExpression', + object: { + type: 'JSXIdentifier', + name: 'a', + range: [1, 2], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 2 } + } + }, + property: { + type: 'JSXIdentifier', + name: 'b', + range: [3, 4], + loc: { + start: { line: 1, column: 3 }, + end: { line: 1, column: 4 } + } + }, + range: [1, 4], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 4 } + } + }, + property: { + type: 'JSXIdentifier', + name: 'c', + range: [5, 6], + loc: { + start: { line: 1, column: 5 }, + end: { line: 1, column: 6 } + } + }, + range: [1, 6], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 6 } + } + }, + selfClosing: false, + attributes: [], + range: [0, 7], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 7 } + } + }, + closingElement: { + type: 'JSXClosingElement', + name: { + type: 'JSXMemberExpression', + object: { + type: 'JSXMemberExpression', + object: { + type: 'JSXIdentifier', + name: 'a', + range: [9, 10], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 10 } + } + }, + property: { + type: 'JSXIdentifier', + name: 'b', + range: [11, 12], + loc: { + start: { line: 1, column: 11 }, + end: { line: 1, column: 12 } + } + }, + range: [9, 12], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 12 } + } + }, + property: { + type: 'JSXIdentifier', + name: 'c', + range: [13, 14], + loc: { + start: { line: 1, column: 13 }, + end: { line: 1, column: 14 } + } + }, + range: [9, 14], + loc: { + start: { line: 1, column: 9 }, + end: { line: 1, column: 14 } + } + }, + range: [7, 15], + loc: { + start: { line: 1, column: 7 }, + end: { line: 1, column: 15 } + } + }, + children: [], + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + range: [0, 15], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 15 } + } + }, + + // In order to more useful parse errors, we disallow following an + // JSXElement by a less-than symbol. In the rare case that the binary + // operator was intended, the tag can be wrapped in parentheses: + '(
      ) < x;': { + type: 'ExpressionStatement', + expression: { + type: 'BinaryExpression', + operator: '<', + left: { + type: 'JSXElement', + openingElement: { + type: 'JSXOpeningElement', + name: { + type: 'JSXIdentifier', + name: 'div', + range: [2, 5], + loc: { + start: { line: 1, column: 2 }, + end: { line: 1, column: 5 } + } + }, + selfClosing: true, + attributes: [], + range: [1, 8], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 8 } + } + }, + closingElement: null, + children: [], + range: [1, 8], + loc: { + start: { line: 1, column: 1 }, + end: { line: 1, column: 8 } + } + }, + right: { + type: 'Identifier', + name: 'x', + range: [12, 13], + loc: { + start: { line: 1, column: 12 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 13], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 13 } + } + }, + range: [0, 14], + loc: { + start: { line: 1, column: 0 }, + end: { line: 1, column: 14 } + } + }, + + '
      ': { + "type": "ExpressionStatement", + "expression": { + "type": "JSXElement", + "openingElement": { + "type": "JSXOpeningElement", + "name": { + "type": "JSXIdentifier", + "name": "div", + "range": [ + 1, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + "selfClosing": true, + "attributes": [ + { + "type": "JSXSpreadAttribute", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 9, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + "range": [ + 5, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + } + } + ], + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + closingElement: null, + "children": [], + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "range": [ + 0, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + + '
      ': { + "type": "ExpressionStatement", + "expression": { + "type": "JSXElement", + "openingElement": { + "type": "JSXOpeningElement", + "name": { + "type": "JSXIdentifier", + "name": "div", + "range": [ + 1, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + "selfClosing": true, + "attributes": [ + { + "type": "JSXSpreadAttribute", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 9, + 14 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 14 + } + } + }, + "range": [ + 5, + 15 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 15 + } + } + }, + { + "type": "JSXAttribute", + "name": { + "type": "JSXIdentifier", + "name": "post", + "range": [ + 16, + 20 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 20 + } + } + }, + "value": { + "type": "Literal", + "value": "attribute", + "raw": "\"attribute\"", + "range": [ + 21, + 32 + ], + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 32 + } + } + }, + "range": [ + 16, + 32 + ], + "loc": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 32 + } + } + } + ], + "range": [ + 0, + 35 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + } + }, + closingElement: null, + "children": [], + "range": [ + 0, + 35 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + } + }, + "range": [ + 0, + 35 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 35 + } + } + }, + + '
      ': { + "type": "ExpressionStatement", + "expression": { + "type": "JSXElement", + "openingElement": { + "type": "JSXOpeningElement", + "name": { + "type": "JSXIdentifier", + "name": "div", + "range": [ + 1, + 4 + ], + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 4 + } + } + }, + "selfClosing": false, + "attributes": [ + { + "type": "JSXAttribute", + "name": { + "type": "JSXIdentifier", + "name": "pre", + "range": [ + 5, + 8 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 8 + } + } + }, + "value": { + "type": "Literal", + "value": "leading", + "raw": "\"leading\"", + "range": [ + 9, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 9 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + "range": [ + 5, + 18 + ], + "loc": { + "start": { + "line": 1, + "column": 5 + }, + "end": { + "line": 1, + "column": 18 + } + } + }, + { + "type": "JSXAttribute", + "name": { + "type": "JSXIdentifier", + "name": "pre2", + "range": [ + 19, + 23 + ], + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 23 + } + } + }, + "value": { + "type": "Literal", + "value": "attribute", + "raw": "\"attribute\"", + "range": [ + 24, + 35 + ], + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 35 + } + } + }, + "range": [ + 19, + 35 + ], + "loc": { + "start": { + "line": 1, + "column": 19 + }, + "end": { + "line": 1, + "column": 35 + } + } + }, + { + "type": "JSXSpreadAttribute", + "argument": { + "type": "Identifier", + "name": "props", + "range": [ + 40, + 45 + ], + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 45 + } + } + }, + "range": [ + 36, + 46 + ], + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 46 + } + } + } + ], + "range": [ + 0, + 47 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 47 + } + } + }, + "closingElement": { + "type": "JSXClosingElement", + "name": { + "type": "JSXIdentifier", + "name": "div", + "range": [ + 49, + 52 + ], + "loc": { + "start": { + "line": 1, + "column": 49 + }, + "end": { + "line": 1, + "column": 52 + } + } + }, + "range": [ + 47, + 53 + ], + "loc": { + "start": { + "line": 1, + "column": 47 + }, + "end": { + "line": 1, + "column": 53 + } + } + }, + "children": [], + "range": [ + 0, + 53 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + } + }, + "range": [ + 0, + 53 + ], + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 53 + } + } + }, + + '
      {aa.b}
      ': { + "type": "ExpressionStatement", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "expression": { + "type": "JSXElement", + "start": 0, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 0, + 52 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 0, + "end": 31, + "loc": { + "start": { + "line": 1, + "column": 0 + }, + "end": { + "line": 1, + "column": 31 + } + }, + "range": [ + 0, + 31 + ], + "attributes": [ + { + "type": "JSXAttribute", + "start": 3, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 3, + 16 + ], + "name": { + "type": "JSXIdentifier", + "start": 3, + "end": 5, + "loc": { + "start": { + "line": 1, + "column": 3 + }, + "end": { + "line": 1, + "column": 5 + } + }, + "range": [ + 3, + 5 + ], + "name": "aa" + }, + "value": { + "type": "JSXExpressionContainer", + "start": 6, + "end": 16, + "loc": { + "start": { + "line": 1, + "column": 6 + }, + "end": { + "line": 1, + "column": 16 + } + }, + "range": [ + 6, + 16 + ], + "expression": { + "type": "MemberExpression", + "start": 7, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 7, + 15 + ], + "object": { + "type": "MemberExpression", + "start": 7, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 7, + 12 + ], + "object": { + "type": "Identifier", + "start": 7, + "end": 9, + "loc": { + "start": { + "line": 1, + "column": 7 + }, + "end": { + "line": 1, + "column": 9 + } + }, + "range": [ + 7, + 9 + ], + "name": "aa" + }, + "property": { + "type": "Identifier", + "start": 10, + "end": 12, + "loc": { + "start": { + "line": 1, + "column": 10 + }, + "end": { + "line": 1, + "column": 12 + } + }, + "range": [ + 10, + 12 + ], + "name": "bb" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 13, + "end": 15, + "loc": { + "start": { + "line": 1, + "column": 13 + }, + "end": { + "line": 1, + "column": 15 + } + }, + "range": [ + 13, + 15 + ], + "name": "cc" + }, + "computed": false + } + } + }, + { + "type": "JSXAttribute", + "start": 17, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 17, + 30 + ], + "name": { + "type": "JSXIdentifier", + "start": 17, + "end": 19, + "loc": { + "start": { + "line": 1, + "column": 17 + }, + "end": { + "line": 1, + "column": 19 + } + }, + "range": [ + 17, + 19 + ], + "name": "bb" + }, + "value": { + "type": "JSXExpressionContainer", + "start": 20, + "end": 30, + "loc": { + "start": { + "line": 1, + "column": 20 + }, + "end": { + "line": 1, + "column": 30 + } + }, + "range": [ + 20, + 30 + ], + "expression": { + "type": "MemberExpression", + "start": 21, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 21, + 29 + ], + "object": { + "type": "MemberExpression", + "start": 21, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 21, + 26 + ], + "object": { + "type": "Identifier", + "start": 21, + "end": 23, + "loc": { + "start": { + "line": 1, + "column": 21 + }, + "end": { + "line": 1, + "column": 23 + } + }, + "range": [ + 21, + 23 + ], + "name": "bb" + }, + "property": { + "type": "Identifier", + "start": 24, + "end": 26, + "loc": { + "start": { + "line": 1, + "column": 24 + }, + "end": { + "line": 1, + "column": 26 + } + }, + "range": [ + 24, + 26 + ], + "name": "cc" + }, + "computed": false + }, + "property": { + "type": "Identifier", + "start": 27, + "end": 29, + "loc": { + "start": { + "line": 1, + "column": 27 + }, + "end": { + "line": 1, + "column": 29 + } + }, + "range": [ + 27, + 29 + ], + "name": "dd" + }, + "computed": false + } + } + } + ], + "name": { + "type": "JSXIdentifier", + "start": 1, + "end": 2, + "loc": { + "start": { + "line": 1, + "column": 1 + }, + "end": { + "line": 1, + "column": 2 + } + }, + "range": [ + 1, + 2 + ], + "name": "A" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 48, + "end": 52, + "loc": { + "start": { + "line": 1, + "column": 48 + }, + "end": { + "line": 1, + "column": 52 + } + }, + "range": [ + 48, + 52 + ], + "name": { + "type": "JSXIdentifier", + "start": 50, + "end": 51, + "loc": { + "start": { + "line": 1, + "column": 50 + }, + "end": { + "line": 1, + "column": 51 + } + }, + "range": [ + 50, + 51 + ], + "name": "A" + } + }, + "children": [ + { + "type": "JSXElement", + "start": 31, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 31, + 48 + ], + "openingElement": { + "type": "JSXOpeningElement", + "start": 31, + "end": 36, + "loc": { + "start": { + "line": 1, + "column": 31 + }, + "end": { + "line": 1, + "column": 36 + } + }, + "range": [ + 31, + 36 + ], + "attributes": [], + "name": { + "type": "JSXIdentifier", + "start": 32, + "end": 35, + "loc": { + "start": { + "line": 1, + "column": 32 + }, + "end": { + "line": 1, + "column": 35 + } + }, + "range": [ + 32, + 35 + ], + "name": "div" + }, + "selfClosing": false + }, + "closingElement": { + "type": "JSXClosingElement", + "start": 42, + "end": 48, + "loc": { + "start": { + "line": 1, + "column": 42 + }, + "end": { + "line": 1, + "column": 48 + } + }, + "range": [ + 42, + 48 + ], + "name": { + "type": "JSXIdentifier", + "start": 44, + "end": 47, + "loc": { + "start": { + "line": 1, + "column": 44 + }, + "end": { + "line": 1, + "column": 47 + } + }, + "range": [ + 44, + 47 + ], + "name": "div" + } + }, + "children": [ + { + "type": "JSXExpressionContainer", + "start": 36, + "end": 42, + "loc": { + "start": { + "line": 1, + "column": 36 + }, + "end": { + "line": 1, + "column": 42 + } + }, + "range": [ + 36, + 42 + ], + "expression": { + "type": "MemberExpression", + "start": 37, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 37, + 41 + ], + "object": { + "type": "Identifier", + "start": 37, + "end": 39, + "loc": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 1, + "column": 39 + } + }, + "range": [ + 37, + 39 + ], + "name": "aa" + }, + "property": { + "type": "Identifier", + "start": 40, + "end": 41, + "loc": { + "start": { + "line": 1, + "column": 40 + }, + "end": { + "line": 1, + "column": 41 + } + }, + "range": [ + 40, + 41 + ], + "name": "b" + }, + "computed": false + } + } + ] + } + ] + } + } + }, + 'Regression': { + '

      foo bar baz

      ;': { + type: "ExpressionStatement", + start: 0, + end: 40, + expression: { + type: "JSXElement", + start: 0, + end: 38, + openingElement: { + type: "JSXOpeningElement", + start: 0, + end: 3, + attributes: [], + name: { + type: "JSXIdentifier", + start: 1, + end: 2, + name: "p" + }, + selfClosing: false + }, + closingElement: { + type: "JSXClosingElement", + start: 34, + end: 38, + name: { + type: "JSXIdentifier", + start: 36, + end: 37, + name: "p" + } + }, + children: [ + { + type: "Literal", + start: 3, + end: 7, + value: "foo ", + raw: "foo " + }, + { + type: "JSXElement", + start: 7, + end: 30, + openingElement: { + type: "JSXOpeningElement", + start: 7, + end: 22, + attributes: [{ + type: "JSXAttribute", + start: 10, + end: 21, + name: { + type: "JSXIdentifier", + start: 10, + end: 14, + name: "href" + }, + value: { + type: "Literal", + start: 15, + end: 21, + value: "test", + raw: "\"test\"" + } + }], + name: { + type: "JSXIdentifier", + start: 8, + end: 9, + name: "a" + }, + selfClosing: false + }, + closingElement: { + type: "JSXClosingElement", + start: 26, + end: 30, + name: { + type: "JSXIdentifier", + start: 28, + end: 29, + name: "a" + } + }, + children: [{ + type: "Literal", + start: 22, + end: 26, + value: " bar", + raw: " bar" + }] + }, + { + type: "Literal", + start: 30, + end: 34, + value: " baz", + raw: " baz" + } + ] + } + }, + + '
      {
      }
      ': { + type: 'ExpressionStatement', + start: 0, + end: 30, + expression: { + type: 'JSXElement', + start: 0, + end: 30, + openingElement: { + type: 'JSXOpeningElement', + start: 0, + end: 5, + attributes: [], + name: { + type: 'JSXIdentifier', + start: 1, + end: 4, + name: 'div' + }, + selfClosing: false + }, + closingElement: { + type: 'JSXClosingElement', + start: 24, + end: 30, + name: { + type: 'JSXIdentifier', + start: 26, + end: 29, + name: 'div' + } + }, + children: [{ + type: 'JSXExpressionContainer', + start: 5, + end: 24, + expression: { + type: 'JSXElement', + start: 6, + end: 23, + openingElement: { + type: 'JSXOpeningElement', + start: 6, + end: 23, + attributes: [ + { + type: 'JSXSpreadAttribute', + start: 11, + end: 20, + argument: { + type: 'Identifier', + start: 15, + end: 19, + name: 'test' + } + } + ], + name: { + type: 'JSXIdentifier', + start: 7, + end: 10, + name: 'div' + }, + selfClosing: true + }, + closingElement: null, + children: [] + } + }] + } + }, + + '
      { {a} }
      ': { + type: "ExpressionStatement", + start: 0, + end: 18, + expression: { + type: "JSXElement", + start: 0, + end: 18, + openingElement: { + type: "JSXOpeningElement", + start: 0, + end: 5, + attributes: [], + name: { + type: "JSXIdentifier", + start: 1, + end: 4, + name: "div" + }, + selfClosing: false + }, + closingElement: { + type: "JSXClosingElement", + start: 12, + end: 18, + name: { + type: "JSXIdentifier", + start: 14, + end: 17, + name: "div" + } + }, + children: [{ + type: "JSXExpressionContainer", + start: 5, + end: 12, + expression: { + type: "ObjectExpression", + start: 7, + end: 10, + properties: [{ + type: "Property", + start: 8, + end: 9, + method: false, + shorthand: true, + computed: false, + key: { + type: "Identifier", + start: 8, + end: 9, + name: "a" + }, + kind: "init", + value: { + type: "Identifier", + start: 8, + end: 9, + name: "a" + } + }] + } + }] + } + }, + + '
      /text
      ': { + type: "ExpressionStatement", + start: 0, + end: 16, + expression: { + type: "JSXElement", + start: 0, + end: 16, + openingElement: { + type: "JSXOpeningElement", + start: 0, + end: 5, + attributes: [], + name: { + type: "JSXIdentifier", + start: 1, + end: 4, + name: "div" + }, + selfClosing: false + }, + closingElement: { + type: "JSXClosingElement", + start: 10, + end: 16, + name: { + type: "JSXIdentifier", + start: 12, + end: 15, + name: "div" + } + }, + children: [{ + type: "Literal", + start: 5, + end: 10, + value: "/text", + raw: "/text" + }] + } + }, + + '
      {a}{b}
      ': { + type: "ExpressionStatement", + start: 0, + end: 17, + expression: { + type: "JSXElement", + start: 0, + end: 17, + openingElement: { + type: "JSXOpeningElement", + start: 0, + end: 5, + attributes: [], + name: { + type: "JSXIdentifier", + start: 1, + end: 4, + name: "div" + }, + selfClosing: false + }, + closingElement: { + type: "JSXClosingElement", + start: 11, + end: 17, + name: { + type: "JSXIdentifier", + start: 13, + end: 16, + name: "div" + } + }, + children: [{ + type: 'JSXExpressionContainer', + expression: { + type: 'Identifier', + name: 'a', + range: [6, 7], + loc: { + start: { + line: 1, + column: 6 + }, + end: { + line: 1, + column: 7 + } + } + }, + range: [5, 8], + loc: { + start: { + line: 1, + column: 5 + }, + end: { + line: 1, + column: 8 + } + } + }, { + type: 'JSXExpressionContainer', + expression: { + type: 'Identifier', + name: 'b', + range: [9, 10], + loc: { + start: { + line: 1, + column: 9 + }, + end: { + line: 1, + column: 10 + } + } + }, + range: [8, 11], + loc: { + start: { + line: 1, + column: 8 + }, + end: { + line: 1, + column: 11 + } + } + } + ] + } + }, + + '
      ': { + type: "ExpressionStatement", + range: [0, 32], + expression: { + type: "JSXElement", + range: [0, 32], + openingElement: { + type: "JSXOpeningElement", + range: [0, 32], + attributes: [ + { + type: "JSXAttribute", + range: [5, 18], + name: { + type: "JSXIdentifier", + range: [5, 8], + name: "pre" + }, + value: { + type: "Literal", + range: [9, 18], + value: "leading" + } + }, + { + type: "JSXSpreadAttribute", + range: [19, 29], + argument: { + type: "Identifier", + range: [23, 28], + name: "props" + } + } + ], + name: { + type: "JSXIdentifier", + range: [1, 4], + name: "div" + }, + selfClosing: true + }, + closingElement: null, + children: [] + } + }, + '': { + type: "ExpressionStatement", + expression: { + type: "JSXElement", + range: [0, 64], + openingElement: { + type: "JSXOpeningElement", + range: [0, 64], + attributes: [ + { + type: "JSXAttribute", + range: [6, 62], + name: { + type: "JSXIdentifier", + range: [6, 7], + name: "d" + }, + value: { + type: "Literal", + loc: { + start: { line: 1, column: 8 }, + end: { line: 3, column: 15 } + }, + range: [8, 62], + value: "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125 \r\n L 275 80 Z", + raw: "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125 \r\n L 275 80 Z\"" + } + } + ], + name: { + type: "JSXIdentifier", + range: [1, 5], + name: "path" + }, + selfClosing: true + }, + closingElement: null, + children: [] + } + } + } +}; + +if (typeof exports !== "undefined") { + var test = require("./driver.js").test; + var testFail = require("./driver.js").testFail; + var tokTypes = require("../").tokTypes; +} + +testFail("var x =
      one
      two
      ;", "Adjacent JSX elements must be wrapped in an enclosing tag (1:22)"); + +test('{/* foo */}', {}, { + onToken: [ + { + type: tokTypes.jsxTagStart, + value: undefined, + start: 0, + end: 1 + }, + { + type: tokTypes.jsxName, + value: 'a', + start: 1, + end: 2 + }, + { + type: tokTypes.jsxTagEnd, + value: undefined, + start: 2, + end: 3 + }, + { + type: tokTypes.braceL, + value: undefined, + start: 3, + end: 4 + }, + { + type: tokTypes.braceR, + value: undefined, + start: 13, + end: 14 + }, + { + type: tokTypes.jsxTagStart, + value: undefined, + start: 14, + end: 15 + }, + { + type: tokTypes.slash, + value: '/', + start: 15, + end: 16 + }, + { + type: tokTypes.jsxName, + value: 'a', + start: 16, + end: 17 + }, + { + type: tokTypes.jsxTagEnd, + value: undefined, + start: 17, + end: 18 + }, + { + type: tokTypes.eof, + value: undefined, + start: 18, + end: 18 + } + ] +}); + +for (var ns in fbTestFixture) { + ns = fbTestFixture[ns]; + for (var code in ns) { + test(code, { + type: 'Program', + body: [ns[code]] + }, { + ecmaVersion: 6, + locations: true, + ranges: true + }); + } +} diff --git a/tools/eslint/node_modules/acorn-jsx/xhtml.js b/tools/eslint/node_modules/acorn-jsx/xhtml.js new file mode 100644 index 00000000000000..c1520092f8e31e --- /dev/null +++ b/tools/eslint/node_modules/acorn-jsx/xhtml.js @@ -0,0 +1,255 @@ +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/acorn/.editorconfig b/tools/eslint/node_modules/acorn/.editorconfig new file mode 100644 index 00000000000000..c14d5c67b407d8 --- /dev/null +++ b/tools/eslint/node_modules/acorn/.editorconfig @@ -0,0 +1,7 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true diff --git a/tools/eslint/node_modules/acorn/.gitattributes b/tools/eslint/node_modules/acorn/.gitattributes new file mode 100644 index 00000000000000..fcadb2cf97913f --- /dev/null +++ b/tools/eslint/node_modules/acorn/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/tools/eslint/node_modules/acorn/.npmignore b/tools/eslint/node_modules/acorn/.npmignore new file mode 100644 index 00000000000000..ecba2911d26e11 --- /dev/null +++ b/tools/eslint/node_modules/acorn/.npmignore @@ -0,0 +1,3 @@ +/.tern-port +/test +/local diff --git a/tools/eslint/node_modules/acorn/.tern-project b/tools/eslint/node_modules/acorn/.tern-project new file mode 100644 index 00000000000000..6718ce07e1c8a0 --- /dev/null +++ b/tools/eslint/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/.travis.yml b/tools/eslint/node_modules/acorn/.travis.yml new file mode 100644 index 00000000000000..f50c379b624d45 --- /dev/null +++ b/tools/eslint/node_modules/acorn/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +sudo: false +node_js: + - '0.10' + - '0.12' + - '4' diff --git a/tools/eslint/node_modules/acorn/AUTHORS b/tools/eslint/node_modules/acorn/AUTHORS new file mode 100644 index 00000000000000..0e8f48b695eaa7 --- /dev/null +++ b/tools/eslint/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/LICENSE b/tools/eslint/node_modules/acorn/LICENSE new file mode 100644 index 00000000000000..d4c7fc583804df --- /dev/null +++ b/tools/eslint/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/README.md b/tools/eslint/node_modules/acorn/README.md new file mode 100644 index 00000000000000..12680abf6b3cc7 --- /dev/null +++ b/tools/eslint/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/bin/acorn b/tools/eslint/node_modules/acorn/bin/acorn new file mode 100755 index 00000000000000..db079096d3749a --- /dev/null +++ b/tools/eslint/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/bin/build-acorn.js b/tools/eslint/node_modules/acorn/bin/build-acorn.js new file mode 100644 index 00000000000000..71f2cf941f5b4d --- /dev/null +++ b/tools/eslint/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/bin/generate-identifier-regex.js b/tools/eslint/node_modules/acorn/bin/generate-identifier-regex.js new file mode 100644 index 00000000000000..0d7c50fc384ee5 --- /dev/null +++ b/tools/eslint/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/bin/update_authors.sh b/tools/eslint/node_modules/acorn/bin/update_authors.sh new file mode 100755 index 00000000000000..466c8db5867cba --- /dev/null +++ b/tools/eslint/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/test/fixtures/readdir/empty b/tools/eslint/node_modules/acorn/dist/.keep similarity index 100% rename from test/fixtures/readdir/empty rename to tools/eslint/node_modules/acorn/dist/.keep diff --git a/tools/eslint/node_modules/acorn/dist/acorn.js b/tools/eslint/node_modules/acorn/dist/acorn.js new file mode 100644 index 00000000000000..9419f862ae779e --- /dev/null +++ b/tools/eslint/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() + // ` - -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/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_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/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/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/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/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/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/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/package.json b/tools/eslint/node_modules/concat-stream/package.json index caa06817b0e47a..19b51af5e0718d 100644 --- a/tools/eslint/node_modules/concat-stream/package.json +++ b/tools/eslint/node_modules/concat-stream/package.json @@ -1,45 +1,92 @@ { - "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/trott/test/node_modules/eslint" + ] ], - "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": "/eslint/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": [ + "/eslint" + ], + "_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/trott/test/node_modules/eslint", + "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": "http://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": [ + { + "email": "max@maxogden.com", + "name": "maxogden" + } + ], + "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": [ + "stream", + "simple", + "util", + "utility" + ], "testling": { - "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/17..latest", @@ -52,30 +99,8 @@ "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" + ], + "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/tools/eslint/node_modules/core-util-is/README.md b/tools/eslint/node_modules/core-util-is/README.md new file mode 100644 index 00000000000000..5a76b4149c5eb5 --- /dev/null +++ b/tools/eslint/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/tools/eslint/node_modules/core-util-is/float.patch b/tools/eslint/node_modules/core-util-is/float.patch new file mode 100644 index 00000000000000..a06d5c05f75fd5 --- /dev/null +++ b/tools/eslint/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +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/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..403fe40270acd1 --- /dev/null +++ b/tools/eslint/node_modules/core-util-is/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + "core-util-is@~1.0.0", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "license": "MIT", + "main": "lib/util.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "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/core-util-is/test.js b/tools/eslint/node_modules/core-util-is/test.js new file mode 100644 index 00000000000000..1a490c65ac8b5d --- /dev/null +++ b/tools/eslint/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/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/es6-iterator/.npmignore b/tools/eslint/node_modules/d/.npmignore similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/.npmignore rename to tools/eslint/node_modules/d/.npmignore diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.travis.yml b/tools/eslint/node_modules/d/.travis.yml similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.travis.yml rename to tools/eslint/node_modules/d/.travis.yml diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/CHANGES b/tools/eslint/node_modules/d/CHANGES similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/CHANGES rename to tools/eslint/node_modules/d/CHANGES 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..c24ec5439461d9 --- /dev/null +++ b/tools/eslint/node_modules/d/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + "d@~0.1.1", + "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + ] + ], + "_from": "d@>=0.1.1 <0.2.0", + "_id": "d@0.1.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/es6-iterator", + "/eslint/es6-map", + "/eslint/es6-set", + "/eslint/es6-symbol", + "/eslint/es6-weak-map", + "/eslint/event-emitter" + ], + "_resolved": "https://registry.npmjs.org/d/-/d-0.1.1.tgz", + "_shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", + "_shrinkwrap": null, + "_spec": "d@~0.1.1", + "_where": "/Users/trott/test/node_modules/eslint/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", + "es", + "ecmascript", + "ecma", + "property", + "descriptors", + "meta", + "properties" + ], + "license": "MIT", + "maintainers": [ + { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + } + ], + "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-weak-map/node_modules/d/test/auto-bind.js b/tools/eslint/node_modules/d/test/auto-bind.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/auto-bind.js rename to tools/eslint/node_modules/d/test/auto-bind.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/index.js b/tools/eslint/node_modules/d/test/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/index.js rename to tools/eslint/node_modules/d/test/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/lazy.js b/tools/eslint/node_modules/d/test/lazy.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/test/lazy.js rename to tools/eslint/node_modules/d/test/lazy.js 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..6b4bce3216031d 100644 --- a/tools/eslint/node_modules/debug/package.json +++ b/tools/eslint/node_modules/debug/package.json @@ -1,73 +1,98 @@ { - "name": "debug", - "version": "2.2.0", - "repository": { - "type": "git", - "url": "git://github.com/visionmedia/debug.git" + "_args": [ + [ + "debug@^2.1.1", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "debug@>=2.1.1 <3.0.0", + "_id": "debug@2.2.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" ], + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "_shrinkwrap": null, + "_spec": "debug@^2.1.1", + "_where": "/Users/trott/test/node_modules/eslint", "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": [ { - "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", + "name": "Nathan Rajlich", "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@>=2.1.1 <3.0.0", - "_npmVersion": "2.7.4", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, + "keywords": [ + "debug", + "log", + "debugger" + ], + "license": "MIT", + "main": "./node.js", "maintainers": [ { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" + "email": "tj@vision-media.ca", + "name": "tjholowaychuk" }, { - "name": "tootallnate", - "email": "nathan@tootallnate.net" + "email": "nathan@tootallnate.net", + "name": "tootallnate" } ], - "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/is-my-json-valid/node_modules/xtend/.npmignore b/tools/eslint/node_modules/deep-is/.npmignore similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/xtend/.npmignore rename to tools/eslint/node_modules/deep-is/.npmignore diff --git a/tools/eslint/node_modules/optionator/node_modules/deep-is/.travis.yml b/tools/eslint/node_modules/deep-is/.travis.yml similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/.travis.yml rename to tools/eslint/node_modules/deep-is/.travis.yml 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/example/cmp.js b/tools/eslint/node_modules/deep-is/example/cmp.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/example/cmp.js rename to tools/eslint/node_modules/deep-is/example/cmp.js 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..33f265b877516c --- /dev/null +++ b/tools/eslint/node_modules/deep-is/package.json @@ -0,0 +1,112 @@ +{ + "_args": [ + [ + "deep-is@~0.1.3", + "/Users/trott/test/node_modules/eslint/node_modules/optionator" + ] + ], + "_from": "deep-is@>=0.1.3 <0.2.0", + "_id": "deep-is@0.1.3", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "equality", + "equal", + "compare" + ], + "license": { + "type": "MIT", + "url": "https://github.com/thlorenz/deep-is/blob/master/LICENSE" + }, + "main": "index.js", + "maintainers": [ + { + "email": "thlorenz@gmx.de", + "name": "thlorenz" + } + ], + "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": [ + 3.5, + 10, + 15 + ], + "ie": [ + 6, + 7, + 8, + 9 + ], + "opera": [ + 12 + ], + "safari": [ + 5.1 + ] + }, + "files": "test/*.js" + }, + "version": "0.1.3" +} diff --git a/tools/eslint/node_modules/optionator/node_modules/deep-is/test/NaN.js b/tools/eslint/node_modules/deep-is/test/NaN.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/test/NaN.js rename to tools/eslint/node_modules/deep-is/test/NaN.js diff --git a/tools/eslint/node_modules/optionator/node_modules/deep-is/test/cmp.js b/tools/eslint/node_modules/deep-is/test/cmp.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/test/cmp.js rename to tools/eslint/node_modules/deep-is/test/cmp.js diff --git a/tools/eslint/node_modules/optionator/node_modules/deep-is/test/neg-vs-pos-0.js b/tools/eslint/node_modules/deep-is/test/neg-vs-pos-0.js similarity index 99% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/test/neg-vs-pos-0.js rename to tools/eslint/node_modules/deep-is/test/neg-vs-pos-0.js index ac26130e6a7757..73f1d71fb204f2 100644 --- a/tools/eslint/node_modules/optionator/node_modules/deep-is/test/neg-vs-pos-0.js +++ b/tools/eslint/node_modules/deep-is/test/neg-vs-pos-0.js @@ -12,4 +12,3 @@ test('0 values', function (t) { t.end(); }); - 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/del/license b/tools/eslint/node_modules/del/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/tools/eslint/node_modules/del/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/del/package.json b/tools/eslint/node_modules/del/package.json new file mode 100644 index 00000000000000..296da4b986b3f4 --- /dev/null +++ b/tools/eslint/node_modules/del/package.json @@ -0,0 +1,121 @@ +{ + "_args": [ + [ + "del@^2.0.2", + "/Users/trott/test/node_modules/eslint/node_modules/flat-cache" + ] + ], + "_from": "del@>=2.0.2 <3.0.0", + "_id": "del@2.2.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/flat-cache" + ], + "_resolved": "https://registry.npmjs.org/del/-/del-2.2.0.tgz", + "_shasum": "9a50f04bf37325e283b4f44e985336c252456bd5", + "_shrinkwrap": null, + "_spec": "del@^2.0.2", + "_where": "/Users/trott/test/node_modules/eslint/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": "http://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": [ + "delete", + "del", + "remove", + "destroy", + "trash", + "unlink", + "clean", + "cleaning", + "cleanup", + "rm", + "rmrf", + "rimraf", + "rmdir", + "glob", + "gulpfriendly", + "file", + "files", + "folder", + "dir", + "directory", + "fs", + "filesystem" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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": [ + "node", + "mocha" + ] + } +} 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..14e3dfe68cf1e5 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`. +* `lineNumberes` - 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/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/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..029a63fc963df5 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,6 +327,10 @@ 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) === 0x23 /* '#' */ || source.charCodeAt(index) === 0x7E /* '~' */) { @@ -333,13 +340,21 @@ } if (useBrackets) { + + // do we have a default value for this? if (source.charCodeAt(index) === 0x3D /* '=' */) { - // consume the '='' symbol name += advance(); + var bracketDepth = 1; // scan in the default value - while (index < last && source.charCodeAt(index) !== 0x5D /* ']' */) { + while (index < last) { + if (source.charCodeAt(index) === 0x5B /* '[' */) { + bracketDepth++; + } else if (source.charCodeAt(index) === 0x5D /* ']' */ && + --bracketDepth === 0) { + break; + } name += advance(); } } @@ -409,7 +424,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 +529,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 +582,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 +629,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 +656,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 +705,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 +743,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 +759,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 +791,8 @@ description += advance(); } - return trim(description); + + return preserveWhitespace ? description : trim(description); } function parse(comment, options) { @@ -772,7 +831,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..eab92737967040 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/trott/test/node_modules/eslint/node_modules/doctrine" + ] + ], + "_from": "esutils@>=1.1.6 <2.0.0", + "_id": "esutils@1.1.6", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/doctrine" + ], + "_resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", + "_shasum": "c01ccaa9ae4b897c6d0c3e210ae52f3c7a844375", + "_shrinkwrap": null, + "_spec": "esutils@^1.1.6", + "_where": "/Users/trott/test/node_modules/eslint/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" + "email": "utatane.tea@gmail.com", + "name": "constellation" } ], + "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/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/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..833edf51083967 100644 --- a/tools/eslint/node_modules/doctrine/package.json +++ b/tools/eslint/node_modules/doctrine/package.json @@ -1,71 +1,104 @@ { - "name": "doctrine", - "description": "JSDoc parser", - "homepage": "http://github.com/Constellation/doctrine.html", - "main": "lib/doctrine.js", - "version": "0.6.4", - "engines": { - "node": ">=0.10.0" + "_args": [ + [ + "doctrine@^1.1.0", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "doctrine@>=1.1.0 <2.0.0", + "_id": "doctrine@1.1.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/doctrine", + "_npmUser": { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" }, - "directories": { - "lib": "./lib" + "_npmVersion": "1.4.29", + "_phantomChildren": {}, + "_requested": { + "name": "doctrine", + "raw": "doctrine@^1.1.0", + "rawSpec": "^1.1.0", + "scope": null, + "spec": ">=1.1.0 <2.0.0", + "type": "range" }, - "maintainers": [ - { - "name": "constellation", - "email": "utatane.tea@gmail.com" - } + "_requiredBy": [ + "/eslint" ], - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/Constellation/doctrine.git" + "_resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.1.0.tgz", + "_shasum": "1c36612937cf7d1596b983e9c5d0c6233eeaa3cf", + "_shrinkwrap": null, + "_spec": "doctrine@^1.1.0", + "_where": "/Users/trott/test/node_modules/eslint", + "bugs": { + "url": "https://github.com/eslint/doctrine/issues" + }, + "dependencies": { + "esutils": "^1.1.6", + "isarray": "0.0.1" }, + "description": "JSDoc parser", "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", + "dateformat": "^1.0.11", + "eslint": "^1.10.3", + "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": "1c36612937cf7d1596b983e9c5d0c6233eeaa3cf", + "tarball": "http://registry.npmjs.org/doctrine/-/doctrine-1.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "lib", + "LICENSE.BSD", + "LICENSE.closure-compiler", + "LICENSE.esprima", + "README.md" + ], + "gitHead": "165fc189b184b0daa72a2ee2f696e8cf7312d288", + "homepage": "https://github.com/eslint/doctrine", "licenses": [ { "type": "BSD", - "url": "http://github.com/Constellation/doctrine/raw/master/LICENSE.BSD" + "url": "http://github.com/eslint/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" + "main": "lib/doctrine.js", + "maintainers": [ + { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + { + "email": "nicholas@nczconsulting.com", + "name": "nzakas" + } + ], + "name": "doctrine", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/eslint/doctrine.git" }, - "dist": { - "shasum": "81428491a942ef18b0492056eda3800eee57d61d", - "tarball": "http://registry.npmjs.org/doctrine/-/doctrine-0.6.4.tgz" + "scripts": { + "lint": "node Makefile.js lint", + "test": "node Makefile.js test" }, - "_resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.6.4.tgz", - "readme": "ERROR: No README data found!" + "version": "1.1.0" } 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/.npmignore b/tools/eslint/node_modules/es5-ext/.npmignore
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/.npmignore
      rename to tools/eslint/node_modules/es5-ext/.npmignore
      diff --git a/tools/eslint/node_modules/es5-ext/.travis.yml b/tools/eslint/node_modules/es5-ext/.travis.yml
      new file mode 100644
      index 00000000000000..e8e18ee77d88ed
      --- /dev/null
      +++ b/tools/eslint/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/tools/eslint/node_modules/es5-ext/CHANGES b/tools/eslint/node_modules/es5-ext/CHANGES
      new file mode 100644
      index 00000000000000..92ee5f6ef64ca9
      --- /dev/null
      +++ b/tools/eslint/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-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..0b5063bd5b3dfc
      --- /dev/null
      +++ b/tools/eslint/node_modules/es5-ext/package.json
      @@ -0,0 +1,105 @@
      +{
      +  "_args": [
      +    [
      +      "es5-ext@~0.10.8",
      +      "/Users/trott/test/node_modules/eslint/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es5-ext@>=0.10.8 <0.11.0",
      +  "_id": "es5-ext@0.10.11",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/eslint/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": [
      +    "/eslint/d",
      +    "/eslint/es6-iterator",
      +    "/eslint/es6-map",
      +    "/eslint/es6-set",
      +    "/eslint/es6-symbol",
      +    "/eslint/es6-weak-map",
      +    "/eslint/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/trott/test/node_modules/eslint/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": [
      +    "ecmascript",
      +    "ecmascript5",
      +    "ecmascript6",
      +    "es5",
      +    "es6",
      +    "extensions",
      +    "ext",
      +    "addons",
      +    "extras",
      +    "harmony",
      +    "javascript",
      +    "polyfill",
      +    "shim",
      +    "util",
      +    "utils",
      +    "utilities"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "email": "medikoo+npm@medikoo.com",
      +      "name": "medikoo"
      +    }
      +  ],
      +  "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/es5-ext/test/__tad.js b/tools/eslint/node_modules/es5-ext/test/__tad.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/__tad.js
      rename to tools/eslint/node_modules/es5-ext/test/__tad.js
      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/es5-ext/test/array/#/@@iterator/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/implement.js
      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/es5-ext/test/array/#/@@iterator/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/index.js
      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/es5-ext/test/array/#/@@iterator/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/is-implemented.js
      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/es5-ext/test/array/#/@@iterator/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/@@iterator/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/@@iterator/shim.js
      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/es5-ext/test/array/#/_compare-by-length.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/_compare-by-length.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/_compare-by-length.js
      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/es5-ext/test/array/#/binary-search.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/binary-search.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/binary-search.js
      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/es5-ext/test/array/#/clear.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/clear.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/clear.js
      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/es5-ext/test/array/#/compact.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/compact.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/compact.js
      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/es5-ext/test/array/#/concat/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/concat/implement.js
      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/es5-ext/test/array/#/concat/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/concat/index.js
      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/es5-ext/test/array/#/concat/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/concat/is-implemented.js
      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/es5-ext/test/array/#/concat/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/concat/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/concat/shim.js
      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/es5-ext/test/array/#/contains.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/contains.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/contains.js
      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/es5-ext/test/array/#/copy-within/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/copy-within/implement.js
      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/es5-ext/test/array/#/copy-within/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/copy-within/index.js
      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/es5-ext/test/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/test/array/#/copy-within/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/copy-within/is-implemented.js
      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/es5-ext/test/array/#/copy-within/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/copy-within/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/copy-within/shim.js
      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/es5-ext/test/array/#/diff.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/diff.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/diff.js
      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/es5-ext/test/array/#/e-index-of.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/e-index-of.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/e-index-of.js
      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/es5-ext/test/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/test/array/#/e-last-index-of.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/e-last-index-of.js
      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/es5-ext/test/array/#/entries/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/entries/implement.js
      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/es5-ext/test/array/#/entries/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/entries/index.js
      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/es5-ext/test/array/#/entries/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/entries/is-implemented.js
      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/es5-ext/test/array/#/entries/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/entries/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/entries/shim.js
      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/es5-ext/test/array/#/exclusion.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/exclusion.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/exclusion.js
      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/es5-ext/test/array/#/fill/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/fill/implement.js
      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/es5-ext/test/array/#/fill/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/fill/index.js
      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/es5-ext/test/array/#/fill/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/fill/is-implemented.js
      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/es5-ext/test/array/#/fill/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/fill/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/fill/shim.js
      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/es5-ext/test/array/#/filter/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/filter/implement.js
      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/es5-ext/test/array/#/filter/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/filter/index.js
      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/es5-ext/test/array/#/filter/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/filter/is-implemented.js
      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/es5-ext/test/array/#/filter/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/filter/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/filter/shim.js
      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/es5-ext/test/array/#/find-index/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find-index/implement.js
      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/es5-ext/test/array/#/find-index/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find-index/index.js
      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/es5-ext/test/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/test/array/#/find-index/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find-index/is-implemented.js
      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/es5-ext/test/array/#/find-index/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find-index/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find-index/shim.js
      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/es5-ext/test/array/#/find/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find/implement.js
      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/es5-ext/test/array/#/find/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find/index.js
      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/es5-ext/test/array/#/find/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find/is-implemented.js
      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/es5-ext/test/array/#/find/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/find/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/find/shim.js
      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/es5-ext/test/array/#/first-index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first-index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/first-index.js
      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/es5-ext/test/array/#/first.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/first.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/first.js
      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/es5-ext/test/array/#/flatten.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/flatten.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/flatten.js
      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/es5-ext/test/array/#/for-each-right.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/for-each-right.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/for-each-right.js
      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/es5-ext/test/array/#/group.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/group.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/group.js
      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/es5-ext/test/array/#/indexes-of.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/indexes-of.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/indexes-of.js
      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/es5-ext/test/array/#/intersection.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/intersection.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/intersection.js
      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/es5-ext/test/array/#/is-copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-copy.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/is-copy.js
      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/es5-ext/test/array/#/is-uniq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/is-uniq.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/is-uniq.js
      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/es5-ext/test/array/#/keys/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/keys/implement.js
      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/es5-ext/test/array/#/keys/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/keys/index.js
      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/es5-ext/test/array/#/keys/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/keys/is-implemented.js
      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/es5-ext/test/array/#/keys/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/keys/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/keys/shim.js
      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/es5-ext/test/array/#/last-index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last-index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/last-index.js
      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/es5-ext/test/array/#/last.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/last.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/last.js
      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/es5-ext/test/array/#/map/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/map/implement.js
      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/es5-ext/test/array/#/map/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/map/index.js
      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/es5-ext/test/array/#/map/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/map/is-implemented.js
      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/es5-ext/test/array/#/map/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/map/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/map/shim.js
      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/es5-ext/test/array/#/remove.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/remove.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/remove.js
      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/es5-ext/test/array/#/separate.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/separate.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/separate.js
      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/es5-ext/test/array/#/slice/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/slice/implement.js
      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/es5-ext/test/array/#/slice/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/slice/index.js
      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/es5-ext/test/array/#/slice/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/slice/is-implemented.js
      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/es5-ext/test/array/#/slice/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/slice/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/slice/shim.js
      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/es5-ext/test/array/#/some-right.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/some-right.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/some-right.js
      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/es5-ext/test/array/#/splice/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/splice/implement.js
      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/es5-ext/test/array/#/splice/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/splice/index.js
      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/es5-ext/test/array/#/splice/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/splice/is-implemented.js
      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/es5-ext/test/array/#/splice/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/splice/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/splice/shim.js
      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/es5-ext/test/array/#/uniq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/uniq.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/uniq.js
      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/es5-ext/test/array/#/values/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/values/implement.js
      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/es5-ext/test/array/#/values/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/values/index.js
      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/es5-ext/test/array/#/values/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/values/is-implemented.js
      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/es5-ext/test/array/#/values/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/#/values/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/#/values/shim.js
      diff --git a/tools/eslint/node_modules/es5-ext/test/array/__scopes.js b/tools/eslint/node_modules/es5-ext/test/array/__scopes.js
      new file mode 100644
      index 00000000000000..6bfdcbc9494a87
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es5-ext/test/array/_is-extensible.js b/tools/eslint/node_modules/es5-ext/test/array/_is-extensible.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_is-extensible.js
      rename to tools/eslint/node_modules/es5-ext/test/array/_is-extensible.js
      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/es5-ext/test/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/test/array/_sub-array-dummy-safe.js
      rename to tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy-safe.js
      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/es5-ext/test/array/_sub-array-dummy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/_sub-array-dummy.js
      rename to tools/eslint/node_modules/es5-ext/test/array/_sub-array-dummy.js
      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/es5-ext/test/array/from/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/from/implement.js
      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/es5-ext/test/array/from/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/from/index.js
      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/es5-ext/test/array/from/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/from/is-implemented.js
      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/es5-ext/test/array/from/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/from/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/from/shim.js
      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/es5-ext/test/array/generate.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/generate.js
      rename to tools/eslint/node_modules/es5-ext/test/array/generate.js
      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/es5-ext/test/array/is-plain-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/is-plain-array.js
      rename to tools/eslint/node_modules/es5-ext/test/array/is-plain-array.js
      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/es5-ext/test/array/of/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/array/of/implement.js
      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/es5-ext/test/array/of/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/index.js
      rename to tools/eslint/node_modules/es5-ext/test/array/of/index.js
      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/es5-ext/test/array/of/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/array/of/is-implemented.js
      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/es5-ext/test/array/of/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/of/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/array/of/shim.js
      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/es5-ext/test/array/to-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/to-array.js
      rename to tools/eslint/node_modules/es5-ext/test/array/to-array.js
      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/es5-ext/test/array/valid-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/array/valid-array.js
      rename to tools/eslint/node_modules/es5-ext/test/array/valid-array.js
      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/es5-ext/test/boolean/is-boolean.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/boolean/is-boolean.js
      rename to tools/eslint/node_modules/es5-ext/test/boolean/is-boolean.js
      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/es5-ext/test/date/#/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/copy.js
      rename to tools/eslint/node_modules/es5-ext/test/date/#/copy.js
      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/es5-ext/test/date/#/days-in-month.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/days-in-month.js
      rename to tools/eslint/node_modules/es5-ext/test/date/#/days-in-month.js
      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/es5-ext/test/date/#/floor-day.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-day.js
      rename to tools/eslint/node_modules/es5-ext/test/date/#/floor-day.js
      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/es5-ext/test/date/#/floor-month.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-month.js
      rename to tools/eslint/node_modules/es5-ext/test/date/#/floor-month.js
      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/es5-ext/test/date/#/floor-year.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/floor-year.js
      rename to tools/eslint/node_modules/es5-ext/test/date/#/floor-year.js
      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/es5-ext/test/date/#/format.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/#/format.js
      rename to tools/eslint/node_modules/es5-ext/test/date/#/format.js
      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/es5-ext/test/date/is-date.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/is-date.js
      rename to tools/eslint/node_modules/es5-ext/test/date/is-date.js
      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/es5-ext/test/date/valid-date.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/date/valid-date.js
      rename to tools/eslint/node_modules/es5-ext/test/date/valid-date.js
      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/es5-ext/test/error/#/throw.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/#/throw.js
      rename to tools/eslint/node_modules/es5-ext/test/error/#/throw.js
      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/es5-ext/test/error/custom.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/custom.js
      rename to tools/eslint/node_modules/es5-ext/test/error/custom.js
      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/es5-ext/test/error/is-error.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/is-error.js
      rename to tools/eslint/node_modules/es5-ext/test/error/is-error.js
      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/es5-ext/test/error/valid-error.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/error/valid-error.js
      rename to tools/eslint/node_modules/es5-ext/test/error/valid-error.js
      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/es5-ext/test/function/#/compose.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/compose.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/compose.js
      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/es5-ext/test/function/#/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/copy.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/copy.js
      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/es5-ext/test/function/#/curry.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/curry.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/curry.js
      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/es5-ext/test/function/#/lock.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/lock.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/lock.js
      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/es5-ext/test/function/#/not.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/not.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/not.js
      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/es5-ext/test/function/#/partial.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/partial.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/partial.js
      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/es5-ext/test/function/#/spread.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/spread.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/spread.js
      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/es5-ext/test/function/#/to-string-tokens.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/#/to-string-tokens.js
      rename to tools/eslint/node_modules/es5-ext/test/function/#/to-string-tokens.js
      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/es5-ext/test/function/_define-length.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/_define-length.js
      rename to tools/eslint/node_modules/es5-ext/test/function/_define-length.js
      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/es5-ext/test/function/constant.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/constant.js
      rename to tools/eslint/node_modules/es5-ext/test/function/constant.js
      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/es5-ext/test/function/identity.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/identity.js
      rename to tools/eslint/node_modules/es5-ext/test/function/identity.js
      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/es5-ext/test/function/invoke.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/invoke.js
      rename to tools/eslint/node_modules/es5-ext/test/function/invoke.js
      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/es5-ext/test/function/is-arguments.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-arguments.js
      rename to tools/eslint/node_modules/es5-ext/test/function/is-arguments.js
      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/es5-ext/test/function/is-function.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/is-function.js
      rename to tools/eslint/node_modules/es5-ext/test/function/is-function.js
      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/es5-ext/test/function/noop.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/noop.js
      rename to tools/eslint/node_modules/es5-ext/test/function/noop.js
      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/es5-ext/test/function/pluck.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/pluck.js
      rename to tools/eslint/node_modules/es5-ext/test/function/pluck.js
      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/es5-ext/test/function/valid-function.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/function/valid-function.js
      rename to tools/eslint/node_modules/es5-ext/test/function/valid-function.js
      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/es5-ext/test/global.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/global.js
      rename to tools/eslint/node_modules/es5-ext/test/global.js
      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/es5-ext/test/iterable/for-each.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/for-each.js
      rename to tools/eslint/node_modules/es5-ext/test/iterable/for-each.js
      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/es5-ext/test/iterable/is.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/is.js
      rename to tools/eslint/node_modules/es5-ext/test/iterable/is.js
      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/es5-ext/test/iterable/validate-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate-object.js
      rename to tools/eslint/node_modules/es5-ext/test/iterable/validate-object.js
      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/es5-ext/test/iterable/validate.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/iterable/validate.js
      rename to tools/eslint/node_modules/es5-ext/test/iterable/validate.js
      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/es5-ext/test/math/_pack-ieee754.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_pack-ieee754.js
      rename to tools/eslint/node_modules/es5-ext/test/math/_pack-ieee754.js
      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/es5-ext/test/math/_unpack-ieee754.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/_unpack-ieee754.js
      rename to tools/eslint/node_modules/es5-ext/test/math/_unpack-ieee754.js
      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/es5-ext/test/math/acosh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/acosh/implement.js
      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/es5-ext/test/math/acosh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/acosh/index.js
      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/es5-ext/test/math/acosh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/acosh/is-implemented.js
      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/es5-ext/test/math/acosh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/acosh/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/acosh/shim.js
      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/es5-ext/test/math/asinh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/asinh/implement.js
      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/es5-ext/test/math/asinh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/asinh/index.js
      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/es5-ext/test/math/asinh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/asinh/is-implemented.js
      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/es5-ext/test/math/asinh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/asinh/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/asinh/shim.js
      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/es5-ext/test/math/atanh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/atanh/implement.js
      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/es5-ext/test/math/atanh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/atanh/index.js
      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/es5-ext/test/math/atanh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/atanh/is-implemented.js
      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/es5-ext/test/math/atanh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/atanh/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/atanh/shim.js
      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/es5-ext/test/math/cbrt/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cbrt/implement.js
      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/es5-ext/test/math/cbrt/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cbrt/index.js
      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/es5-ext/test/math/cbrt/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cbrt/is-implemented.js
      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/es5-ext/test/math/cbrt/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cbrt/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cbrt/shim.js
      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/es5-ext/test/math/clz32/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/clz32/implement.js
      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/es5-ext/test/math/clz32/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/clz32/index.js
      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/es5-ext/test/math/clz32/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/clz32/is-implemented.js
      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/es5-ext/test/math/clz32/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/clz32/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/clz32/shim.js
      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/es5-ext/test/math/cosh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cosh/implement.js
      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/es5-ext/test/math/cosh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cosh/index.js
      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/es5-ext/test/math/cosh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cosh/is-implemented.js
      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/es5-ext/test/math/cosh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/cosh/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/cosh/shim.js
      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/es5-ext/test/math/expm1/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/expm1/implement.js
      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/es5-ext/test/math/expm1/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/expm1/index.js
      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/es5-ext/test/math/expm1/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/expm1/is-implemented.js
      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/es5-ext/test/math/expm1/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/expm1/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/expm1/shim.js
      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/es5-ext/test/math/fround/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/fround/implement.js
      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/es5-ext/test/math/fround/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/fround/index.js
      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/es5-ext/test/math/fround/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/fround/is-implemented.js
      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/es5-ext/test/math/fround/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/fround/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/fround/shim.js
      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/es5-ext/test/math/hypot/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/hypot/implement.js
      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/es5-ext/test/math/hypot/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/hypot/index.js
      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/es5-ext/test/math/hypot/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/hypot/is-implemented.js
      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/es5-ext/test/math/hypot/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/hypot/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/hypot/shim.js
      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/es5-ext/test/math/imul/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/imul/implement.js
      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/es5-ext/test/math/imul/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/imul/index.js
      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/es5-ext/test/math/imul/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/imul/is-implemented.js
      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/es5-ext/test/math/imul/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/imul/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/imul/shim.js
      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/es5-ext/test/math/log10/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log10/implement.js
      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/es5-ext/test/math/log10/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log10/index.js
      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/es5-ext/test/math/log10/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log10/is-implemented.js
      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/es5-ext/test/math/log10/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log10/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log10/shim.js
      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/es5-ext/test/math/log1p/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log1p/implement.js
      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/es5-ext/test/math/log1p/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log1p/index.js
      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/es5-ext/test/math/log1p/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log1p/is-implemented.js
      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/es5-ext/test/math/log1p/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log1p/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log1p/shim.js
      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/es5-ext/test/math/log2/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log2/implement.js
      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/es5-ext/test/math/log2/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log2/index.js
      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/es5-ext/test/math/log2/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log2/is-implemented.js
      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/es5-ext/test/math/log2/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/log2/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/log2/shim.js
      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/es5-ext/test/math/sign/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sign/implement.js
      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/es5-ext/test/math/sign/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sign/index.js
      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/es5-ext/test/math/sign/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sign/is-implemented.js
      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/es5-ext/test/math/sign/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sign/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sign/shim.js
      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/es5-ext/test/math/sinh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sinh/implement.js
      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/es5-ext/test/math/sinh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sinh/index.js
      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/es5-ext/test/math/sinh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sinh/is-implemented.js
      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/es5-ext/test/math/sinh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/sinh/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/sinh/shim.js
      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/es5-ext/test/math/tanh/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/tanh/implement.js
      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/es5-ext/test/math/tanh/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/tanh/index.js
      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/es5-ext/test/math/tanh/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/tanh/is-implemented.js
      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/es5-ext/test/math/tanh/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/tanh/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/tanh/shim.js
      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/es5-ext/test/math/trunc/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/math/trunc/implement.js
      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/es5-ext/test/math/trunc/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/index.js
      rename to tools/eslint/node_modules/es5-ext/test/math/trunc/index.js
      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/es5-ext/test/math/trunc/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/math/trunc/is-implemented.js
      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/es5-ext/test/math/trunc/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/math/trunc/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/math/trunc/shim.js
      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/es5-ext/test/number/#/pad.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/#/pad.js
      rename to tools/eslint/node_modules/es5-ext/test/number/#/pad.js
      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/es5-ext/test/number/epsilon/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/number/epsilon/implement.js
      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/es5-ext/test/number/epsilon/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/index.js
      rename to tools/eslint/node_modules/es5-ext/test/number/epsilon/index.js
      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/es5-ext/test/number/epsilon/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/epsilon/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/number/epsilon/is-implemented.js
      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/es5-ext/test/number/is-finite/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-finite/implement.js
      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/es5-ext/test/number/is-finite/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/index.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-finite/index.js
      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/es5-ext/test/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/test/number/is-finite/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-finite/is-implemented.js
      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/es5-ext/test/number/is-finite/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-finite/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-finite/shim.js
      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/es5-ext/test/number/is-integer/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-integer/implement.js
      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/es5-ext/test/number/is-integer/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-integer/index.js
      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/es5-ext/test/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/test/number/is-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-integer/is-implemented.js
      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/es5-ext/test/number/is-integer/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-integer/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-integer/shim.js
      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/es5-ext/test/number/is-nan/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-nan/implement.js
      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/es5-ext/test/number/is-nan/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/index.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-nan/index.js
      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/es5-ext/test/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/test/number/is-nan/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-nan/is-implemented.js
      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/es5-ext/test/number/is-nan/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-nan/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-nan/shim.js
      diff --git a/tools/eslint/node_modules/es5-ext/test/number/is-natural.js b/tools/eslint/node_modules/es5-ext/test/number/is-natural.js
      new file mode 100644
      index 00000000000000..d56f12042b48f3
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es5-ext/test/number/is-number.js b/tools/eslint/node_modules/es5-ext/test/number/is-number.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/is-number.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-number.js
      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/es5-ext/test/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/test/number/is-safe-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/implement.js
      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/es5-ext/test/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/test/number/is-safe-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/index.js
      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/es5-ext/test/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/test/number/is-safe-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/is-implemented.js
      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/es5-ext/test/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/test/number/is-safe-integer/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/number/is-safe-integer/shim.js
      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/es5-ext/test/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/test/number/max-safe-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/implement.js
      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/es5-ext/test/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/test/number/max-safe-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/index.js
      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/es5-ext/test/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/test/number/max-safe-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/number/max-safe-integer/is-implemented.js
      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/es5-ext/test/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/test/number/min-safe-integer/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/implement.js
      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/es5-ext/test/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/test/number/min-safe-integer/index.js
      rename to tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/index.js
      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/es5-ext/test/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/test/number/min-safe-integer/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/number/min-safe-integer/is-implemented.js
      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/es5-ext/test/number/to-integer.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-integer.js
      rename to tools/eslint/node_modules/es5-ext/test/number/to-integer.js
      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/es5-ext/test/number/to-pos-integer.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-pos-integer.js
      rename to tools/eslint/node_modules/es5-ext/test/number/to-pos-integer.js
      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/es5-ext/test/number/to-uint32.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/number/to-uint32.js
      rename to tools/eslint/node_modules/es5-ext/test/number/to-uint32.js
      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/es5-ext/test/object/_iterate.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/_iterate.js
      rename to tools/eslint/node_modules/es5-ext/test/object/_iterate.js
      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/es5-ext/test/object/assign/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/object/assign/implement.js
      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/es5-ext/test/object/assign/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/index.js
      rename to tools/eslint/node_modules/es5-ext/test/object/assign/index.js
      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/es5-ext/test/object/assign/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/object/assign/is-implemented.js
      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/es5-ext/test/object/assign/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/assign/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/object/assign/shim.js
      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/es5-ext/test/object/clear.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/clear.js
      rename to tools/eslint/node_modules/es5-ext/test/object/clear.js
      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/es5-ext/test/object/compact.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compact.js
      rename to tools/eslint/node_modules/es5-ext/test/object/compact.js
      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/es5-ext/test/object/compare.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/compare.js
      rename to tools/eslint/node_modules/es5-ext/test/object/compare.js
      diff --git a/tools/eslint/node_modules/es5-ext/test/object/copy-deep.js b/tools/eslint/node_modules/es5-ext/test/object/copy-deep.js
      new file mode 100644
      index 00000000000000..79e02be49e3c11
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es5-ext/test/object/copy.js b/tools/eslint/node_modules/es5-ext/test/object/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/copy.js
      rename to tools/eslint/node_modules/es5-ext/test/object/copy.js
      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/es5-ext/test/object/count.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/count.js
      rename to tools/eslint/node_modules/es5-ext/test/object/count.js
      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/es5-ext/test/object/create.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/create.js
      rename to tools/eslint/node_modules/es5-ext/test/object/create.js
      diff --git a/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number-value.js b/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number-value.js
      new file mode 100644
      index 00000000000000..dde23986babe18
      --- /dev/null
      +++ b/tools/eslint/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/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number.js b/tools/eslint/node_modules/es5-ext/test/object/ensure-natural-number.js
      new file mode 100644
      index 00000000000000..5ebed1e524fcef
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es5-ext/test/object/eq.js b/tools/eslint/node_modules/es5-ext/test/object/eq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/eq.js
      rename to tools/eslint/node_modules/es5-ext/test/object/eq.js
      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/es5-ext/test/object/every.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/every.js
      rename to tools/eslint/node_modules/es5-ext/test/object/every.js
      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/es5-ext/test/object/filter.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/filter.js
      rename to tools/eslint/node_modules/es5-ext/test/object/filter.js
      diff --git a/tools/eslint/node_modules/es5-ext/test/object/find-key.js b/tools/eslint/node_modules/es5-ext/test/object/find-key.js
      new file mode 100644
      index 00000000000000..cca834d9362a29
      --- /dev/null
      +++ b/tools/eslint/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/tools/eslint/node_modules/es5-ext/test/object/find.js b/tools/eslint/node_modules/es5-ext/test/object/find.js
      new file mode 100644
      index 00000000000000..b6ad60a542b741
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es5-ext/test/object/first-key.js b/tools/eslint/node_modules/es5-ext/test/object/first-key.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/first-key.js
      rename to tools/eslint/node_modules/es5-ext/test/object/first-key.js
      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/es5-ext/test/object/flatten.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/flatten.js
      rename to tools/eslint/node_modules/es5-ext/test/object/flatten.js
      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/es5-ext/test/object/for-each.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/for-each.js
      rename to tools/eslint/node_modules/es5-ext/test/object/for-each.js
      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/es5-ext/test/object/get-property-names.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/get-property-names.js
      rename to tools/eslint/node_modules/es5-ext/test/object/get-property-names.js
      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/es5-ext/test/object/is-array-like.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-array-like.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is-array-like.js
      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/es5-ext/test/object/is-callable.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-callable.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is-callable.js
      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/es5-ext/test/object/is-copy-deep.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy-deep.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is-copy-deep.js
      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/es5-ext/test/object/is-copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-copy.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is-copy.js
      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/es5-ext/test/object/is-empty.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-empty.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is-empty.js
      diff --git a/tools/eslint/node_modules/es5-ext/test/object/is-number-value.js b/tools/eslint/node_modules/es5-ext/test/object/is-number-value.js
      new file mode 100644
      index 00000000000000..21b6b620323b63
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es5-ext/test/object/is-object.js b/tools/eslint/node_modules/es5-ext/test/object/is-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-object.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is-object.js
      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/es5-ext/test/object/is-plain-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is-plain-object.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is-plain-object.js
      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/es5-ext/test/object/is.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/is.js
      rename to tools/eslint/node_modules/es5-ext/test/object/is.js
      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/es5-ext/test/object/key-of.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/key-of.js
      rename to tools/eslint/node_modules/es5-ext/test/object/key-of.js
      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/es5-ext/test/object/keys/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/object/keys/implement.js
      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/es5-ext/test/object/keys/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/index.js
      rename to tools/eslint/node_modules/es5-ext/test/object/keys/index.js
      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/es5-ext/test/object/keys/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/object/keys/is-implemented.js
      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/es5-ext/test/object/keys/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/keys/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/object/keys/shim.js
      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/es5-ext/test/object/map-keys.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map-keys.js
      rename to tools/eslint/node_modules/es5-ext/test/object/map-keys.js
      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/es5-ext/test/object/map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/map.js
      rename to tools/eslint/node_modules/es5-ext/test/object/map.js
      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/es5-ext/test/object/mixin-prototypes.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin-prototypes.js
      rename to tools/eslint/node_modules/es5-ext/test/object/mixin-prototypes.js
      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/es5-ext/test/object/mixin.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/mixin.js
      rename to tools/eslint/node_modules/es5-ext/test/object/mixin.js
      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/es5-ext/test/object/normalize-options.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/normalize-options.js
      rename to tools/eslint/node_modules/es5-ext/test/object/normalize-options.js
      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/es5-ext/test/object/primitive-set.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/primitive-set.js
      rename to tools/eslint/node_modules/es5-ext/test/object/primitive-set.js
      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/es5-ext/test/object/safe-traverse.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/safe-traverse.js
      rename to tools/eslint/node_modules/es5-ext/test/object/safe-traverse.js
      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/es5-ext/test/object/serialize.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/serialize.js
      rename to tools/eslint/node_modules/es5-ext/test/object/serialize.js
      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/es5-ext/test/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/test/object/set-prototype-of/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/implement.js
      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/es5-ext/test/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/test/object/set-prototype-of/index.js
      rename to tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/index.js
      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/es5-ext/test/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/test/object/set-prototype-of/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/is-implemented.js
      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/es5-ext/test/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/test/object/set-prototype-of/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/object/set-prototype-of/shim.js
      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/es5-ext/test/object/some.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/some.js
      rename to tools/eslint/node_modules/es5-ext/test/object/some.js
      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/es5-ext/test/object/to-array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/to-array.js
      rename to tools/eslint/node_modules/es5-ext/test/object/to-array.js
      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/es5-ext/test/object/unserialize.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/unserialize.js
      rename to tools/eslint/node_modules/es5-ext/test/object/unserialize.js
      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/es5-ext/test/object/valid-callable.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-callable.js
      rename to tools/eslint/node_modules/es5-ext/test/object/valid-callable.js
      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/es5-ext/test/object/valid-object.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-object.js
      rename to tools/eslint/node_modules/es5-ext/test/object/valid-object.js
      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/es5-ext/test/object/valid-value.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/valid-value.js
      rename to tools/eslint/node_modules/es5-ext/test/object/valid-value.js
      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/es5-ext/test/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/test/object/validate-array-like-object.js
      rename to tools/eslint/node_modules/es5-ext/test/object/validate-array-like-object.js
      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/es5-ext/test/object/validate-array-like.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-array-like.js
      rename to tools/eslint/node_modules/es5-ext/test/object/validate-array-like.js
      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/es5-ext/test/object/validate-stringifiable-value.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable-value.js
      rename to tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable-value.js
      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/es5-ext/test/object/validate-stringifiable.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/object/validate-stringifiable.js
      rename to tools/eslint/node_modules/es5-ext/test/object/validate-stringifiable.js
      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/es5-ext/test/reg-exp/#/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/index.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/index.js
      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/es5-ext/test/reg-exp/#/is-sticky.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-sticky.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-sticky.js
      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/es5-ext/test/reg-exp/#/is-unicode.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/is-unicode.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/is-unicode.js
      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/es5-ext/test/reg-exp/#/match/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/implement.js
      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/es5-ext/test/reg-exp/#/match/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/index.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/index.js
      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/es5-ext/test/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/test/reg-exp/#/match/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/is-implemented.js
      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/es5-ext/test/reg-exp/#/match/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/match/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/match/shim.js
      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/es5-ext/test/reg-exp/#/replace/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/implement.js
      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/es5-ext/test/reg-exp/#/replace/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/index.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/index.js
      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/es5-ext/test/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/test/reg-exp/#/replace/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/is-implemented.js
      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/es5-ext/test/reg-exp/#/replace/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/replace/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/replace/shim.js
      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/es5-ext/test/reg-exp/#/search/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/implement.js
      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/es5-ext/test/reg-exp/#/search/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/index.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/index.js
      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/es5-ext/test/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/test/reg-exp/#/search/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/is-implemented.js
      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/es5-ext/test/reg-exp/#/search/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/search/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/search/shim.js
      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/es5-ext/test/reg-exp/#/split/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/implement.js
      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/es5-ext/test/reg-exp/#/split/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/index.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/index.js
      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/es5-ext/test/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/test/reg-exp/#/split/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/is-implemented.js
      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/es5-ext/test/reg-exp/#/split/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/split/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/split/shim.js
      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/es5-ext/test/reg-exp/#/sticky/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/implement.js
      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/es5-ext/test/reg-exp/#/sticky/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/sticky/is-implemented.js
      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/es5-ext/test/reg-exp/#/unicode/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/implement.js
      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/es5-ext/test/reg-exp/#/unicode/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/#/unicode/is-implemented.js
      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/es5-ext/test/reg-exp/escape.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/reg-exp/escape.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/escape.js
      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/es5-ext/test/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/test/reg-exp/is-reg-exp.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/is-reg-exp.js
      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/es5-ext/test/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/test/reg-exp/valid-reg-exp.js
      rename to tools/eslint/node_modules/es5-ext/test/reg-exp/valid-reg-exp.js
      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/es5-ext/test/string/#/@@iterator/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/implement.js
      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/es5-ext/test/string/#/@@iterator/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/index.js
      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/es5-ext/test/string/#/@@iterator/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/is-implemented.js
      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/es5-ext/test/string/#/@@iterator/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/@@iterator/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/@@iterator/shim.js
      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/es5-ext/test/string/#/at.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/at.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/at.js
      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/es5-ext/test/string/#/camel-to-hyphen.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/camel-to-hyphen.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/camel-to-hyphen.js
      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/es5-ext/test/string/#/capitalize.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/capitalize.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/capitalize.js
      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/es5-ext/test/string/#/case-insensitive-compare.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/case-insensitive-compare.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/case-insensitive-compare.js
      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/es5-ext/test/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/test/string/#/code-point-at/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/implement.js
      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/es5-ext/test/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/test/string/#/code-point-at/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/index.js
      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/es5-ext/test/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/test/string/#/code-point-at/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/is-implemented.js
      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/es5-ext/test/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/test/string/#/code-point-at/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/code-point-at/shim.js
      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/es5-ext/test/string/#/contains/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/contains/implement.js
      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/es5-ext/test/string/#/contains/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/contains/index.js
      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/es5-ext/test/string/#/contains/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/contains/is-implemented.js
      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/es5-ext/test/string/#/contains/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/contains/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/contains/shim.js
      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/es5-ext/test/string/#/ends-with/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/ends-with/implement.js
      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/es5-ext/test/string/#/ends-with/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/ends-with/index.js
      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/es5-ext/test/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/test/string/#/ends-with/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/ends-with/is-implemented.js
      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/es5-ext/test/string/#/ends-with/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/ends-with/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/ends-with/shim.js
      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/es5-ext/test/string/#/hyphen-to-camel.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/hyphen-to-camel.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/hyphen-to-camel.js
      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/es5-ext/test/string/#/indent.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/indent.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/indent.js
      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/es5-ext/test/string/#/last.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/last.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/last.js
      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/es5-ext/test/string/#/normalize/_data.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/_data.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/normalize/_data.js
      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/es5-ext/test/string/#/normalize/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/normalize/implement.js
      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/es5-ext/test/string/#/normalize/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/normalize/index.js
      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/es5-ext/test/string/#/normalize/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/normalize/is-implemented.js
      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/es5-ext/test/string/#/normalize/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/normalize/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/normalize/shim.js
      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/es5-ext/test/string/#/pad.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/pad.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/pad.js
      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/es5-ext/test/string/#/plain-replace-all.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace-all.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/plain-replace-all.js
      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/es5-ext/test/string/#/plain-replace.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/plain-replace.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/plain-replace.js
      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/es5-ext/test/string/#/repeat/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/repeat/implement.js
      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/es5-ext/test/string/#/repeat/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/repeat/index.js
      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/es5-ext/test/string/#/repeat/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/repeat/is-implemented.js
      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/es5-ext/test/string/#/repeat/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/repeat/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/repeat/shim.js
      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/es5-ext/test/string/#/starts-with/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/starts-with/implement.js
      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/es5-ext/test/string/#/starts-with/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/starts-with/index.js
      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/es5-ext/test/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/test/string/#/starts-with/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/starts-with/is-implemented.js
      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/es5-ext/test/string/#/starts-with/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/#/starts-with/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/#/starts-with/shim.js
      diff --git a/tools/eslint/node_modules/es5-ext/test/string/#/uncapitalize.js b/tools/eslint/node_modules/es5-ext/test/string/#/uncapitalize.js
      new file mode 100644
      index 00000000000000..50f35f1fe40a91
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es5-ext/test/string/format-method.js b/tools/eslint/node_modules/es5-ext/test/string/format-method.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/format-method.js
      rename to tools/eslint/node_modules/es5-ext/test/string/format-method.js
      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/es5-ext/test/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/test/string/from-code-point/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/from-code-point/implement.js
      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/es5-ext/test/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/test/string/from-code-point/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/from-code-point/index.js
      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/es5-ext/test/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/test/string/from-code-point/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/from-code-point/is-implemented.js
      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/es5-ext/test/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/test/string/from-code-point/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/string/from-code-point/shim.js
      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/es5-ext/test/string/is-string.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/is-string.js
      rename to tools/eslint/node_modules/es5-ext/test/string/is-string.js
      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/es5-ext/test/string/random-uniq.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/random-uniq.js
      rename to tools/eslint/node_modules/es5-ext/test/string/random-uniq.js
      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/es5-ext/test/string/raw/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/implement.js
      rename to tools/eslint/node_modules/es5-ext/test/string/raw/implement.js
      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/es5-ext/test/string/raw/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/index.js
      rename to tools/eslint/node_modules/es5-ext/test/string/raw/index.js
      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/es5-ext/test/string/raw/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/is-implemented.js
      rename to tools/eslint/node_modules/es5-ext/test/string/raw/is-implemented.js
      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/es5-ext/test/string/raw/shim.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es5-ext/test/string/raw/shim.js
      rename to tools/eslint/node_modules/es5-ext/test/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/.npmignore b/tools/eslint/node_modules/es6-iterator/.npmignore
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/.npmignore
      rename to tools/eslint/node_modules/es6-iterator/.npmignore
      diff --git a/tools/eslint/node_modules/es6-iterator/.travis.yml b/tools/eslint/node_modules/es6-iterator/.travis.yml
      new file mode 100644
      index 00000000000000..fc254110608e62
      --- /dev/null
      +++ b/tools/eslint/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/tools/eslint/node_modules/es6-iterator/CHANGES b/tools/eslint/node_modules/es6-iterator/CHANGES
      new file mode 100644
      index 00000000000000..ce33180939c05f
      --- /dev/null
      +++ b/tools/eslint/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/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..8c0029c98869d8
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-iterator/package.json
      @@ -0,0 +1,94 @@
      +{
      +  "_args": [
      +    [
      +      "es6-iterator@2",
      +      "/Users/trott/test/node_modules/eslint/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es6-iterator@>=2.0.0 <3.0.0",
      +  "_id": "es6-iterator@2.0.0",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/eslint/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": [
      +    "/eslint/es5-ext",
      +    "/eslint/es6-map",
      +    "/eslint/es6-set",
      +    "/eslint/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/trott/test/node_modules/eslint/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": [
      +    "iterator",
      +    "array",
      +    "list",
      +    "set",
      +    "map",
      +    "generator"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "email": "medikoo+npm@medikoo.com",
      +      "name": "medikoo"
      +    }
      +  ],
      +  "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/test/#/chain.js b/tools/eslint/node_modules/es6-iterator/test/#/chain.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/#/chain.js
      rename to tools/eslint/node_modules/es6-iterator/test/#/chain.js
      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/es6-iterator/test/array.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/array.js
      rename to tools/eslint/node_modules/es6-iterator/test/array.js
      diff --git a/tools/eslint/node_modules/es6-iterator/test/for-of.js b/tools/eslint/node_modules/es6-iterator/test/for-of.js
      new file mode 100644
      index 00000000000000..108df7d97a3c39
      --- /dev/null
      +++ b/tools/eslint/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/tools/eslint/node_modules/es6-iterator/test/get.js b/tools/eslint/node_modules/es6-iterator/test/get.js
      new file mode 100644
      index 00000000000000..81ce6e6ae48b79
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es6-iterator/test/index.js b/tools/eslint/node_modules/es6-iterator/test/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/index.js
      rename to tools/eslint/node_modules/es6-iterator/test/index.js
      diff --git a/tools/eslint/node_modules/es6-iterator/test/is-iterable.js b/tools/eslint/node_modules/es6-iterator/test/is-iterable.js
      new file mode 100644
      index 00000000000000..438ad349ca3d48
      --- /dev/null
      +++ b/tools/eslint/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-weak-map/node_modules/es6-iterator/test/string.js b/tools/eslint/node_modules/es6-iterator/test/string.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/es6-iterator/test/string.js
      rename to tools/eslint/node_modules/es6-iterator/test/string.js
      diff --git a/tools/eslint/node_modules/es6-iterator/test/valid-iterable.js b/tools/eslint/node_modules/es6-iterator/test/valid-iterable.js
      new file mode 100644
      index 00000000000000..a407f1a0c46923
      --- /dev/null
      +++ b/tools/eslint/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-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/.npmignore b/tools/eslint/node_modules/es6-map/.npmignore
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/.npmignore
      rename to tools/eslint/node_modules/es6-map/.npmignore
      diff --git a/tools/eslint/node_modules/es6-map/.travis.yml b/tools/eslint/node_modules/es6-map/.travis.yml
      new file mode 100644
      index 00000000000000..83625d8c3e44a9
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/.travis.yml
      @@ -0,0 +1,12 @@
      +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
      +language: node_js
      +node_js:
      +  - 0.12
      +  - 4
      +  - 5
      +
      +notifications:
      +  email:
      +    - medikoo+es6-map@medikoo.com
      +
      +script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/es6-map/CHANGES b/tools/eslint/node_modules/es6-map/CHANGES
      new file mode 100644
      index 00000000000000..97f484a5c03f0b
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/CHANGES
      @@ -0,0 +1,26 @@
      +v0.1.3  --  2015.11.18
      +* Relax validation of native implementation (do not require proper stringification of Map.prototype)
      +
      +v0.1.2  --  2015.10.15
      +* Improve native detection
      +* Ensure proper inheritance
      +* Update up to specification
      +* Fix spelling of LICENSE
      +* Update dependencies
      +
      +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/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/escope/node_modules/es6-map/is-map.js b/tools/eslint/node_modules/es6-map/is-map.js
      similarity index 78%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/is-map.js
      rename to tools/eslint/node_modules/es6-map/is-map.js
      index f45526a43ba1db..1e1fa823327a60 100644
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/is-map.js
      +++ b/tools/eslint/node_modules/es6-map/is-map.js
      @@ -7,6 +7,6 @@ var toStringTagSymbol = require('es6-symbol').toStringTag
         , Global = (typeof Map === 'undefined') ? null : Map;
       
       module.exports = function (x) {
      -	return (x && ((Global && (x instanceof Global)) ||
      +	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..1f1ff679fe9ee6
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/package.json
      @@ -0,0 +1,98 @@
      +{
      +  "_args": [
      +    [
      +      "es6-map@^0.1.3",
      +      "/Users/trott/test/node_modules/eslint"
      +    ]
      +  ],
      +  "_from": "es6-map@>=0.1.3 <0.2.0",
      +  "_id": "es6-map@0.1.3",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/eslint/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": [
      +    "/eslint",
      +    "/eslint/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/trott/test/node_modules/eslint",
      +  "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",
      +    "es6",
      +    "shim",
      +    "harmony",
      +    "list",
      +    "hash",
      +    "map",
      +    "polyfill",
      +    "ponyfill",
      +    "ecmascript"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "email": "medikoo+npm@medikoo.com",
      +      "name": "medikoo"
      +    }
      +  ],
      +  "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/test/implement.js b/tools/eslint/node_modules/es6-map/test/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/implement.js
      rename to tools/eslint/node_modules/es6-map/test/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/index.js b/tools/eslint/node_modules/es6-map/test/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/index.js
      rename to tools/eslint/node_modules/es6-map/test/index.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-implemented.js b/tools/eslint/node_modules/es6-map/test/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/is-implemented.js
      rename to tools/eslint/node_modules/es6-map/test/is-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-map.js b/tools/eslint/node_modules/es6-map/test/is-map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/is-map.js
      rename to tools/eslint/node_modules/es6-map/test/is-map.js
      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/es6-map/test/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/test/is-native-implemented.js
      rename to tools/eslint/node_modules/es6-map/test/is-native-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator-kinds.js b/tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator-kinds.js
      rename to tools/eslint/node_modules/es6-map/test/lib/iterator-kinds.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator.js b/tools/eslint/node_modules/es6-map/test/lib/iterator.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/iterator.js
      rename to tools/eslint/node_modules/es6-map/test/lib/iterator.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/primitive-iterator.js b/tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/lib/primitive-iterator.js
      rename to tools/eslint/node_modules/es6-map/test/lib/primitive-iterator.js
      diff --git a/tools/eslint/node_modules/es6-map/test/polyfill.js b/tools/eslint/node_modules/es6-map/test/polyfill.js
      new file mode 100644
      index 00000000000000..6816cb049b4b39
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/test/polyfill.js
      @@ -0,0 +1,60 @@
      +'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");
      +
      +	a.h1("Empty initialization");
      +	map = new T();
      +	map.set('foo', 'bar');
      +	a(map.size, 1);
      +	a(map.get('foo'), 'bar');
      +};
      diff --git a/tools/eslint/node_modules/es6-map/test/primitive/index.js b/tools/eslint/node_modules/es6-map/test/primitive/index.js
      new file mode 100644
      index 00000000000000..a99c68522d57c7
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-map/test/primitive/index.js
      @@ -0,0 +1,59 @@
      +'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");
      +
      +	a.h1("Empty initialization");
      +	map = new T();
      +	map.set('foo', 'bar');
      +	a(map.size, 1);
      +	a(map.get('foo'), 'bar');
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/valid-map.js b/tools/eslint/node_modules/es6-map/test/valid-map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/valid-map.js
      rename to tools/eslint/node_modules/es6-map/test/valid-map.js
      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/.npmignore b/tools/eslint/node_modules/es6-set/.npmignore
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/.npmignore
      rename to tools/eslint/node_modules/es6-set/.npmignore
      diff --git a/tools/eslint/node_modules/es6-set/.travis.yml b/tools/eslint/node_modules/es6-set/.travis.yml
      new file mode 100644
      index 00000000000000..a51e21e3bca728
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/.travis.yml
      @@ -0,0 +1,12 @@
      +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
      +language: node_js
      +node_js:
      +  - 0.12
      +  - 4
      +  - 5
      +
      +notifications:
      +  email:
      +    - medikoo+es6-set@medikoo.com
      +
      +script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/es6-set/CHANGES b/tools/eslint/node_modules/es6-set/CHANGES
      new file mode 100644
      index 00000000000000..613bbb20d34d28
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/CHANGES
      @@ -0,0 +1,30 @@
      +v0.1.4  --  2016.01.19
      +* Ensure Set polyfill function name is `Set` (#2)
      +
      +v0.1.3  --  2015.11.18
      +* Relax validation of native implementation (do not require proper stringification of Set.prototype)
      +
      +v0.1.2  --  2015.10.02
      +* Improve native Set detection
      +* Fix spelling of LICENSE
      +* Set.prototype.filter extension
      +* Update dependencies
      +
      +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-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/escope/node_modules/es6-map/node_modules/es6-set/is-set.js b/tools/eslint/node_modules/es6-set/is-set.js
      similarity index 79%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-set.js
      rename to tools/eslint/node_modules/es6-set/is-set.js
      index 19e47929356ab6..6b491ddee3b5ae 100644
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/is-set.js
      +++ b/tools/eslint/node_modules/es6-set/is-set.js
      @@ -7,6 +7,6 @@ var toString          = Object.prototype.toString
         , Global = (typeof Set === 'undefined') ? null : Set;
       
       module.exports = function (x) {
      -	return (x && ((Global && (x instanceof Global)) ||
      +	return (x && ((Global && ((x instanceof Global) || (x === Global.prototype))) ||
       			(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/es6-set/lib/iterator.js
      similarity index 92%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/lib/iterator.js
      rename to tools/eslint/node_modules/es6-set/lib/iterator.js
      index 4a7dac7ebdc648..6069a8a130a4ca 100644
      --- a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/lib/iterator.js
      +++ b/tools/eslint/node_modules/es6-set/lib/iterator.js
      @@ -27,5 +27,4 @@ SetIterator.prototype = Object.create(Iterator.prototype, {
       	}),
       	toString: d(function () { return '[object Set Iterator]'; })
       });
      -defineProperty(SetIterator.prototype, toStringTagSymbol,
      -	d('c', '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..c273e3c1c1fd28
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/package.json
      @@ -0,0 +1,92 @@
      +{
      +  "_args": [
      +    [
      +      "es6-set@~0.1.3",
      +      "/Users/trott/test/node_modules/eslint/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es6-set@>=0.1.3 <0.2.0",
      +  "_id": "es6-set@0.1.4",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/eslint/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": [
      +    "/eslint/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/trott/test/node_modules/eslint/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": [
      +    "set",
      +    "collection",
      +    "es6",
      +    "harmony",
      +    "list",
      +    "hash"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "email": "medikoo+npm@medikoo.com",
      +      "name": "medikoo"
      +    }
      +  ],
      +  "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/test/ext/copy.js b/tools/eslint/node_modules/es6-set/test/ext/copy.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/copy.js
      rename to tools/eslint/node_modules/es6-set/test/ext/copy.js
      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/es6-set/test/ext/every.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/every.js
      rename to tools/eslint/node_modules/es6-set/test/ext/every.js
      diff --git a/tools/eslint/node_modules/es6-set/test/ext/filter.js b/tools/eslint/node_modules/es6-set/test/ext/filter.js
      new file mode 100644
      index 00000000000000..46981859b6bdc0
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/test/ext/filter.js
      @@ -0,0 +1,12 @@
      +'use strict';
      +
      +var aFrom = require('es5-ext/array/from')
      +
      +  , Set = require('../../');
      +
      +module.exports = function (t, a) {
      +	a.deep(aFrom(t.call(new Set(), Boolean)), [], "Empty set");
      +	a.deep(aFrom(t.call(new Set([2, 3, 4]), Boolean)), [2, 3, 4], "All true");
      +	a.deep(aFrom(t.call(new Set([0, false, 4]), Boolean)), [4], "Some false");
      +	a.deep(aFrom(t.call(new Set([0, false, null]), Boolean)), [], "All false");
      +};
      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/es6-set/test/ext/get-first.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-first.js
      rename to tools/eslint/node_modules/es6-set/test/ext/get-first.js
      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/es6-set/test/ext/get-last.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/get-last.js
      rename to tools/eslint/node_modules/es6-set/test/ext/get-last.js
      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/es6-set/test/ext/some.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/ext/some.js
      rename to tools/eslint/node_modules/es6-set/test/ext/some.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/implement.js b/tools/eslint/node_modules/es6-set/test/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/implement.js
      rename to tools/eslint/node_modules/es6-set/test/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/index.js b/tools/eslint/node_modules/es6-set/test/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/index.js
      rename to tools/eslint/node_modules/es6-set/test/index.js
      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/es6-set/test/is-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-implemented.js
      rename to tools/eslint/node_modules/es6-set/test/is-implemented.js
      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/es6-set/test/is-native-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-native-implemented.js
      rename to tools/eslint/node_modules/es6-set/test/is-native-implemented.js
      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/es6-set/test/is-set.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/is-set.js
      rename to tools/eslint/node_modules/es6-set/test/is-set.js
      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/es6-set/test/lib/iterator.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/iterator.js
      rename to tools/eslint/node_modules/es6-set/test/lib/iterator.js
      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/es6-set/test/lib/primitive-iterator.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/lib/primitive-iterator.js
      rename to tools/eslint/node_modules/es6-set/test/lib/primitive-iterator.js
      diff --git a/tools/eslint/node_modules/es6-set/test/polyfill.js b/tools/eslint/node_modules/es6-set/test/polyfill.js
      new file mode 100644
      index 00000000000000..94ae3e6e6384a7
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/test/polyfill.js
      @@ -0,0 +1,50 @@
      +'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");
      +
      +	a.h1("Empty initialization");
      +	set = new T();
      +	set.add('foo');
      +	a(set.size, 1);
      +	a(set.has('foo'), true);
      +};
      diff --git a/tools/eslint/node_modules/es6-set/test/primitive/index.js b/tools/eslint/node_modules/es6-set/test/primitive/index.js
      new file mode 100644
      index 00000000000000..88f9502fd9c72e
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-set/test/primitive/index.js
      @@ -0,0 +1,50 @@
      +'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");
      +
      +	a.h1("Empty initialization");
      +	set = new T();
      +	set.add('foo');
      +	a(set.size, 1);
      +	a(set.has('foo'), true);
      +};
      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/es6-set/test/valid-set.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-set/test/valid-set.js
      rename to tools/eslint/node_modules/es6-set/test/valid-set.js
      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/.npmignore b/tools/eslint/node_modules/es6-symbol/.npmignore
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/.npmignore
      rename to tools/eslint/node_modules/es6-symbol/.npmignore
      diff --git a/tools/eslint/node_modules/es6-symbol/.travis.yml b/tools/eslint/node_modules/es6-symbol/.travis.yml
      new file mode 100644
      index 00000000000000..6830765b567773
      --- /dev/null
      +++ b/tools/eslint/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/tools/eslint/node_modules/es6-symbol/CHANGES b/tools/eslint/node_modules/es6-symbol/CHANGES
      new file mode 100644
      index 00000000000000..cbedd4244bc8b6
      --- /dev/null
      +++ b/tools/eslint/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-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..6a2f26db1f2abd
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-symbol/package.json
      @@ -0,0 +1,95 @@
      +{
      +  "_args": [
      +    [
      +      "es6-symbol@~3.0.1",
      +      "/Users/trott/test/node_modules/eslint/node_modules/es6-map"
      +    ]
      +  ],
      +  "_from": "es6-symbol@>=3.0.1 <3.1.0",
      +  "_id": "es6-symbol@3.0.2",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/eslint/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": [
      +    "/eslint/es5-ext",
      +    "/eslint/es6-iterator",
      +    "/eslint/es6-map",
      +    "/eslint/es6-set",
      +    "/eslint/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/trott/test/node_modules/eslint/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": [
      +    "symbol",
      +    "private",
      +    "property",
      +    "es6",
      +    "ecmascript",
      +    "harmony",
      +    "ponyfill",
      +    "polyfill"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "email": "medikoo+npm@medikoo.com",
      +      "name": "medikoo"
      +    }
      +  ],
      +  "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/test/implement.js b/tools/eslint/node_modules/es6-symbol/test/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/implement.js
      rename to tools/eslint/node_modules/es6-symbol/test/implement.js
      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/es6-symbol/test/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/index.js
      rename to tools/eslint/node_modules/es6-symbol/test/index.js
      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/es6-symbol/test/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/test/is-implemented.js
      rename to tools/eslint/node_modules/es6-symbol/test/is-implemented.js
      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/es6-symbol/test/is-native-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-symbol/test/is-native-implemented.js
      rename to tools/eslint/node_modules/es6-symbol/test/is-native-implemented.js
      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/es6-symbol/test/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/test/is-symbol.js
      rename to tools/eslint/node_modules/es6-symbol/test/is-symbol.js
      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/es6-symbol/test/polyfill.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/es6-iterator/node_modules/es6-symbol/test/polyfill.js
      rename to tools/eslint/node_modules/es6-symbol/test/polyfill.js
      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/es6-symbol/test/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/test/validate-symbol.js
      rename to tools/eslint/node_modules/es6-symbol/test/validate-symbol.js
      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/node_modules/d/.npmignore b/tools/eslint/node_modules/es6-weak-map/.npmignore
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/node_modules/d/.npmignore
      rename to tools/eslint/node_modules/es6-weak-map/.npmignore
      diff --git a/tools/eslint/node_modules/es6-weak-map/.travis.yml b/tools/eslint/node_modules/es6-weak-map/.travis.yml
      new file mode 100644
      index 00000000000000..cdd424cc2ecc17
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/.travis.yml
      @@ -0,0 +1,11 @@
      +sudo: false # use faster docker infrastructure
      +language: node_js
      +node_js:
      +  - 0.12
      +  - 4
      +
      +notifications:
      +  email:
      +    - medikoo+es6-weak-map@medikoo.com
      +
      +script: "npm test && npm run lint"
      diff --git a/tools/eslint/node_modules/es6-weak-map/CHANGES b/tools/eslint/node_modules/es6-weak-map/CHANGES
      new file mode 100644
      index 00000000000000..74fced55714a5f
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/CHANGES
      @@ -0,0 +1,42 @@
      +v2.0.1  --  2015.10.02
      +* Update to use es6-symbol at v3
      +
      +v2.0.0  --  2015.09.04
      +* Relax native implementation detection, stringification of instance should returm
      +  expected result (not necesarily prototype)
      +
      +v1.0.2  --  2015.05.07
      +* Add "ponyfill" keyword to meta description. Fixes #7
      +
      +v1.0.1  --  2015.04.14
      +* Fix isNativeImplemented, so it's not affected by #3619 V8 bug
      +* Fix internal prototype resolution, in case where isNativeImplemented was true, and
      +  native implementation was shadowed it got into stack overflow
      +
      +v1.0.0  --  2015.04.13
      +* It's v0.1.3 republished as v1.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/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..7a708a00bd03cf
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/package.json
      @@ -0,0 +1,94 @@
      +{
      +  "_args": [
      +    [
      +      "es6-weak-map@^2.0.1",
      +      "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [
      +    "/eslint/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/trott/test/node_modules/eslint/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": [
      +    "map",
      +    "weakmap",
      +    "collection",
      +    "es6",
      +    "harmony",
      +    "list",
      +    "hash",
      +    "gc",
      +    "ponyfill"
      +  ],
      +  "license": "MIT",
      +  "maintainers": [
      +    {
      +      "email": "medikoo+npm@medikoo.com",
      +      "name": "medikoo"
      +    }
      +  ],
      +  "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/test/implement.js b/tools/eslint/node_modules/es6-weak-map/test/implement.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/implement.js
      rename to tools/eslint/node_modules/es6-weak-map/test/implement.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/index.js b/tools/eslint/node_modules/es6-weak-map/test/index.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/index.js
      rename to tools/eslint/node_modules/es6-weak-map/test/index.js
      diff --git a/tools/eslint/node_modules/es6-weak-map/test/is-implemented.js b/tools/eslint/node_modules/es6-weak-map/test/is-implemented.js
      new file mode 100644
      index 00000000000000..0186871e2e3f4f
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/test/is-implemented.js
      @@ -0,0 +1,14 @@
      +'use strict';
      +
      +var global   = require('es5-ext/global')
      +  , polyfill = require('../polyfill');
      +
      +module.exports = function (t, a) {
      +	var cache;
      +	a(typeof t(), 'boolean');
      +	cache = global.WeakMap;
      +	global.WeakMap = polyfill;
      +	a(t(), true);
      +	if (cache === undefined) delete global.WeakMap;
      +	else global.WeakMap = cache;
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/test/is-native-implemented.js b/tools/eslint/node_modules/es6-weak-map/test/is-native-implemented.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-map/test/is-native-implemented.js
      rename to tools/eslint/node_modules/es6-weak-map/test/is-native-implemented.js
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-weak-map.js b/tools/eslint/node_modules/es6-weak-map/test/is-weak-map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/is-weak-map.js
      rename to tools/eslint/node_modules/es6-weak-map/test/is-weak-map.js
      diff --git a/tools/eslint/node_modules/es6-weak-map/test/polyfill.js b/tools/eslint/node_modules/es6-weak-map/test/polyfill.js
      new file mode 100644
      index 00000000000000..aaffe4a1c27283
      --- /dev/null
      +++ b/tools/eslint/node_modules/es6-weak-map/test/polyfill.js
      @@ -0,0 +1,23 @@
      +'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.h1("Empty initialization");
      +	map = new T();
      +	map.set(x, 'bar');
      +	a(map.get(x), 'bar');
      +};
      diff --git a/tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/valid-weak-map.js b/tools/eslint/node_modules/es6-weak-map/test/valid-weak-map.js
      similarity index 100%
      rename from tools/eslint/node_modules/escope/node_modules/es6-weak-map/test/valid-weak-map.js
      rename to tools/eslint/node_modules/es6-weak-map/test/valid-weak-map.js
      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..a6fa52d711a24d 100644
      --- a/tools/eslint/node_modules/escape-string-regexp/package.json
      +++ b/tools/eslint/node_modules/escape-string-regexp/package.json
      @@ -1,70 +1,97 @@
       {
      -  "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/trott/test/node_modules/eslint/node_modules/chalk"
      +    ]
      +  ],
      +  "_from": "escape-string-regexp@>=1.0.2 <2.0.0",
      +  "_id": "escape-string-regexp@1.0.4",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/eslint/escape-string-regexp",
      +  "_nodeVersion": "4.2.1",
      +  "_npmUser": {
      +    "email": "sindresorhus@gmail.com",
      +    "name": "sindresorhus"
      +  },
      +  "_npmVersion": "2.14.7",
      +  "_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": [
      +    "/eslint/chalk"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz",
      +  "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
      +  "_shrinkwrap": null,
      +  "_spec": "escape-string-regexp@^1.0.2",
      +  "_where": "/Users/trott/test/node_modules/eslint/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": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
      +    "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.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": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97",
      +  "homepage": "https://github.com/sindresorhus/escape-string-regexp",
         "keywords": [
      +    "escape",
           "regex",
           "regexp",
           "re",
           "regular",
           "expression",
      -    "escape",
           "string",
           "str",
           "special",
           "characters"
         ],
      -  "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": [
      +    {
      +      "email": "sindresorhus@gmail.com",
      +      "name": "sindresorhus"
      +    },
      +    {
      +      "email": "jappelman@xebia.com",
      +      "name": "jbnicolai"
      +    }
      +  ],
      +  "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.4"
       }
      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/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/gulpfile.js b/tools/eslint/node_modules/escope/gulpfile.js
      index afc68330dd69eb..64cc31d459956e 100644
      --- a/tools/eslint/node_modules/escope/gulpfile.js
      +++ b/tools/eslint/node_modules/escope/gulpfile.js
      @@ -32,15 +32,18 @@ var gulp = require('gulp'),
           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');
      +    fs = require('fs');
       
      -var TEST = [ 'test/*.coffee' ];
      +require('babel-register')({
      +    only: /escope\/(src|test)\//
      +});
      +
      +var TEST = [ 'test/*.js' ];
       var SOURCE = [ 'src/**/*.js' ];
       
       var ESLINT_OPTION = {
      @@ -51,23 +54,26 @@ var ESLINT_OPTION = {
               'no-shadow': 0,
               'no-new': 0,
               'no-underscore-dangle': 0,
      -        'no-multi-spaces': false,
      +        'no-multi-spaces': 0,
               'no-native-reassign': 0,
               'no-loop-func': 0,
               'no-lone-blocks': 0
           },
      -    settings: {
      -        "ecmascript": 6,
      -        "jsx": false
      +    ecmaFeatures: {
      +        jsx: false,
      +        modules: true
           },
           env: {
      -        'node': true
      +        node: true,
      +        es6: true
           }
       };
       
      +var BABEL_OPTIONS = JSON.parse(fs.readFileSync('.babelrc', { encoding: 'utf8' }));
      +
       var build = lazypipe()
           .pipe(sourcemaps.init)
      -    .pipe(babel)
      +    .pipe(babel, BABEL_OPTIONS)
           .pipe(sourcemaps.write)
           .pipe(gulp.dest, 'lib');
       
      diff --git a/tools/eslint/node_modules/escope/lib/definition.js b/tools/eslint/node_modules/escope/lib/definition.js
      index 5ff4f9751547bc..cef445de5b3915 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,34 @@ 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRlZmluaXRpb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBNkJxQixhQUNqQixTQURpQixVQUNqQixDQUFZLElBQVosRUFBa0IsSUFBbEIsRUFBd0IsSUFBeEIsRUFBOEIsTUFBOUIsRUFBc0MsS0FBdEMsRUFBNkMsSUFBN0MsRUFBbUQ7d0JBRGxDLFlBQ2tDOzs7OztBQUkvQyxPQUFLLElBQUwsR0FBWSxJQUFaOzs7O0FBSitDLE1BUS9DLENBQUssSUFBTCxHQUFZLElBQVo7Ozs7QUFSK0MsTUFZL0MsQ0FBSyxJQUFMLEdBQVksSUFBWjs7OztBQVorQyxNQWdCL0MsQ0FBSyxNQUFMLEdBQWMsTUFBZDs7OztBQWhCK0MsTUFvQi9DLENBQUssS0FBTCxHQUFhLEtBQWI7Ozs7QUFwQitDLE1Bd0IvQyxDQUFLLElBQUwsR0FBWSxJQUFaLENBeEIrQztDQUFuRDs7Ozs7O2tCQURpQjs7SUFnQ2Y7OztBQUNGLFdBREUsbUJBQ0YsQ0FBWSxJQUFaLEVBQWtCLElBQWxCLEVBQXdCLEtBQXhCLEVBQStCLElBQS9CLEVBQXFDOzBCQURuQyxxQkFDbUM7Ozs7Ozs7dUVBRG5DLGdDQUVRLG1CQUFTLFNBQVQsRUFBb0IsTUFBTSxNQUFNLE1BQU0sT0FBTyxPQURsQjs7QUFNakMsVUFBSyxJQUFMLEdBQVksSUFBWixDQU5pQzs7R0FBckM7O1NBREU7RUFBNEI7O1FBWTlCO1FBQ0EiLCJmaWxlIjoiZGVmaW5pdGlvbi5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuaW1wb3J0IFZhcmlhYmxlIGZyb20gJy4vdmFyaWFibGUnO1xuXG4vKipcbiAqIEBjbGFzcyBEZWZpbml0aW9uXG4gKi9cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIERlZmluaXRpb24ge1xuICAgIGNvbnN0cnVjdG9yKHR5cGUsIG5hbWUsIG5vZGUsIHBhcmVudCwgaW5kZXgsIGtpbmQpIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge1N0cmluZ30gRGVmaW5pdGlvbiN0eXBlIC0gdHlwZSBvZiB0aGUgb2NjdXJyZW5jZSAoZS5nLiBcIlBhcmFtZXRlclwiLCBcIlZhcmlhYmxlXCIsIC4uLikuXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnR5cGUgPSB0eXBlO1xuICAgICAgICAvKipcbiAgICAgICAgICogQG1lbWJlciB7ZXNwcmltYS5JZGVudGlmaWVyfSBEZWZpbml0aW9uI25hbWUgLSB0aGUgaWRlbnRpZmllciBBU1Qgbm9kZSBvZiB0aGUgb2NjdXJyZW5jZS5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubmFtZSA9IG5hbWU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLk5vZGV9IERlZmluaXRpb24jbm9kZSAtIHRoZSBlbmNsb3Npbmcgbm9kZSBvZiB0aGUgaWRlbnRpZmllci5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMubm9kZSA9IG5vZGU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLk5vZGU/fSBEZWZpbml0aW9uI3BhcmVudCAtIHRoZSBlbmNsb3Npbmcgc3RhdGVtZW50IG5vZGUgb2YgdGhlIGlkZW50aWZpZXIuXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnBhcmVudCA9IHBhcmVudDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge051bWJlcj99IERlZmluaXRpb24jaW5kZXggLSB0aGUgaW5kZXggaW4gdGhlIGRlY2xhcmF0aW9uIHN0YXRlbWVudC5cbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuaW5kZXggPSBpbmRleDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIEBtZW1iZXIge1N0cmluZz99IERlZmluaXRpb24ja2luZCAtIHRoZSBraW5kIG9mIHRoZSBkZWNsYXJhdGlvbiBzdGF0ZW1lbnQuXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmtpbmQgPSBraW5kO1xuICAgIH1cbn1cblxuLyoqXG4gKiBAY2xhc3MgUGFyYW1ldGVyRGVmaW5pdGlvblxuICovXG5jbGFzcyBQYXJhbWV0ZXJEZWZpbml0aW9uIGV4dGVuZHMgRGVmaW5pdGlvbiB7XG4gICAgY29uc3RydWN0b3IobmFtZSwgbm9kZSwgaW5kZXgsIHJlc3QpIHtcbiAgICAgICAgc3VwZXIoVmFyaWFibGUuUGFyYW1ldGVyLCBuYW1lLCBub2RlLCBudWxsLCBpbmRleCwgbnVsbCk7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoZSBwYXJhbWV0ZXIgZGVmaW5pdGlvbiBpcyBhIHBhcnQgb2YgYSByZXN0IHBhcmFtZXRlci5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gUGFyYW1ldGVyRGVmaW5pdGlvbiNyZXN0XG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnJlc3QgPSByZXN0O1xuICAgIH1cbn1cblxuZXhwb3J0IHtcbiAgICBQYXJhbWV0ZXJEZWZpbml0aW9uLFxuICAgIERlZmluaXRpb25cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      diff --git a/tools/eslint/node_modules/escope/lib/index.js b/tools/eslint/node_modules/escope/lib/index.js
      index 58964e061b8c19..6861459edae75a 100644
      --- a/tools/eslint/node_modules/escope/lib/index.js
      +++ b/tools/eslint/node_modules/escope/lib/index.js
      @@ -1,52 +1,30 @@
      -"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.
      -*/
      +'use strict';
      +
      +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
      + * @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(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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O1FBZ0hnQjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBckRoQixTQUFTLGNBQVQsR0FBMEI7QUFDdEIsV0FBTztBQUNILG9CQUFZLEtBQVo7QUFDQSxtQkFBVyxLQUFYO0FBQ0EscUJBQWEsS0FBYjtBQUNBLHVCQUFlLEtBQWY7QUFDQSxvQkFBWSxRQUFaO0FBQ0EscUJBQWEsQ0FBYjtLQU5KLENBRHNCO0NBQTFCOztBQVdBLFNBQVMsWUFBVCxDQUFzQixNQUF0QixFQUE4QixRQUE5QixFQUF3QztBQUNwQyxRQUFJLEdBQUosRUFBUyxHQUFULENBRG9DOztBQUdwQyxhQUFTLFlBQVQsQ0FBc0IsTUFBdEIsRUFBOEI7QUFDMUIsZUFBTyxRQUFPLHVEQUFQLEtBQWtCLFFBQWxCLElBQThCLGtCQUFrQixNQUFsQixJQUE0QixFQUFFLGtCQUFrQixNQUFsQixDQUFGLENBRHZDO0tBQTlCOztBQUlBLFNBQUssR0FBTCxJQUFZLFFBQVosRUFBc0I7QUFDbEIsWUFBSSxTQUFTLGNBQVQsQ0FBd0IsR0FBeEIsQ0FBSixFQUFrQztBQUM5QixrQkFBTSxTQUFTLEdBQVQsQ0FBTixDQUQ4QjtBQUU5QixnQkFBSSxhQUFhLEdBQWIsQ0FBSixFQUF1QjtBQUNuQixvQkFBSSxhQUFhLE9BQU8sR0FBUCxDQUFiLENBQUosRUFBK0I7QUFDM0IsaUNBQWEsT0FBTyxHQUFQLENBQWIsRUFBMEIsR0FBMUIsRUFEMkI7aUJBQS9CLE1BRU87QUFDSCwyQkFBTyxHQUFQLElBQWMsYUFBYSxFQUFiLEVBQWlCLEdBQWpCLENBQWQsQ0FERztpQkFGUDthQURKLE1BTU87QUFDSCx1QkFBTyxHQUFQLElBQWMsR0FBZCxDQURHO2FBTlA7U0FGSjtLQURKO0FBY0EsV0FBTyxNQUFQLENBckJvQztDQUF4Qzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUEwQ08sU0FBUyxPQUFULENBQWlCLElBQWpCLEVBQXVCLGVBQXZCLEVBQXdDO0FBQzNDLFFBQUksWUFBSixFQUFrQixVQUFsQixFQUE4QixPQUE5QixDQUQyQzs7QUFHM0MsY0FBVSxhQUFhLGdCQUFiLEVBQStCLGVBQS9CLENBQVYsQ0FIMkM7O0FBSzNDLG1CQUFlLDJCQUFpQixPQUFqQixDQUFmLENBTDJDOztBQU8zQyxpQkFBYSx5QkFBZSxZQUFmLENBQWIsQ0FQMkM7QUFRM0MsZUFBVyxLQUFYLENBQWlCLElBQWpCLEVBUjJDOztBQVUzQywwQkFBTyxhQUFhLGNBQWIsS0FBZ0MsSUFBaEMsRUFBc0MsOEJBQTdDLEVBVjJDOztBQVkzQyxXQUFPLFlBQVAsQ0FaMkM7Q0FBeEM7Ozs7QUFpQkg7OztBQUVBOzs7QUFFQTs7O0FBRUE7OztBQUVBIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDEyLTIwMTQgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuICBDb3B5cmlnaHQgKEMpIDIwMTMgQWxleCBTZXZpbGxlIDxoaUBhbGV4YW5kZXJzZXZpbGxlLmNvbT5cbiAgQ29weXJpZ2h0IChDKSAyMDE0IFRoaWFnbyBkZSBBcnJ1ZGEgPHRwYWRpbGhhODRAZ21haWwuY29tPlxuXG4gIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcblxuICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4gICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuXG4gIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4gIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4gIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cbiovXG5cbi8qKlxuICogRXNjb3BlICg8YSBocmVmPVwiaHR0cDovL2dpdGh1Yi5jb20vZXN0b29scy9lc2NvcGVcIj5lc2NvcGU8L2E+KSBpcyBhbiA8YVxuICogaHJlZj1cImh0dHA6Ly93d3cuZWNtYS1pbnRlcm5hdGlvbmFsLm9yZy9wdWJsaWNhdGlvbnMvc3RhbmRhcmRzL0VjbWEtMjYyLmh0bVwiPkVDTUFTY3JpcHQ8L2E+XG4gKiBzY29wZSBhbmFseXplciBleHRyYWN0ZWQgZnJvbSB0aGUgPGFcbiAqIGhyZWY9XCJodHRwOi8vZ2l0aHViLmNvbS9lc3Rvb2xzL2VzbWFuZ2xlXCI+ZXNtYW5nbGUgcHJvamVjdDwvYS8+LlxuICogPHA+XG4gKiA8ZW0+ZXNjb3BlPC9lbT4gZmluZHMgbGV4aWNhbCBzY29wZXMgaW4gYSBzb3VyY2UgcHJvZ3JhbSwgaS5lLiBhcmVhcyBvZiB0aGF0XG4gKiBwcm9ncmFtIHdoZXJlIGRpZmZlcmVudCBvY2N1cnJlbmNlcyBvZiB0aGUgc2FtZSBpZGVudGlmaWVyIHJlZmVyIHRvIHRoZSBzYW1lXG4gKiB2YXJpYWJsZS4gV2l0aCBlYWNoIHNjb3BlIHRoZSBjb250YWluZWQgdmFyaWFibGVzIGFyZSBjb2xsZWN0ZWQsIGFuZCBlYWNoXG4gKiBpZGVudGlmaWVyIHJlZmVyZW5jZSBpbiBjb2RlIGlzIGxpbmtlZCB0byBpdHMgY29ycmVzcG9uZGluZyB2YXJpYWJsZSAoaWZcbiAqIHBvc3NpYmxlKS5cbiAqIDxwPlxuICogPGVtPmVzY29wZTwvZW0+IHdvcmtzIG9uIGEgc3ludGF4IHRyZWUgb2YgdGhlIHBhcnNlZCBzb3VyY2UgY29kZSB3aGljaCBoYXNcbiAqIHRvIGFkaGVyZSB0byB0aGUgPGFcbiAqIGhyZWY9XCJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZy9lbi1VUy9kb2NzL1NwaWRlck1vbmtleS9QYXJzZXJfQVBJXCI+XG4gKiBNb3ppbGxhIFBhcnNlciBBUEk8L2E+LiBFLmcuIDxhIGhyZWY9XCJodHRwOi8vZXNwcmltYS5vcmdcIj5lc3ByaW1hPC9hPiBpcyBhIHBhcnNlclxuICogdGhhdCBwcm9kdWNlcyBzdWNoIHN5bnRheCB0cmVlcy5cbiAqIDxwPlxuICogVGhlIG1haW4gaW50ZXJmYWNlIGlzIHRoZSB7QGxpbmsgYW5hbHl6ZX0gZnVuY3Rpb24uXG4gKiBAbW9kdWxlIGVzY29wZVxuICovXG5cbi8qanNsaW50IGJpdHdpc2U6dHJ1ZSAqL1xuXG5pbXBvcnQgYXNzZXJ0IGZyb20gJ2Fzc2VydCc7XG5cbmltcG9ydCBTY29wZU1hbmFnZXIgZnJvbSAnLi9zY29wZS1tYW5hZ2VyJztcbmltcG9ydCBSZWZlcmVuY2VyIGZyb20gJy4vcmVmZXJlbmNlcic7XG5pbXBvcnQgUmVmZXJlbmNlIGZyb20gJy4vcmVmZXJlbmNlJztcbmltcG9ydCBWYXJpYWJsZSBmcm9tICcuL3ZhcmlhYmxlJztcbmltcG9ydCBTY29wZSBmcm9tICcuL3Njb3BlJztcbmltcG9ydCB7IHZlcnNpb24gfSBmcm9tICcuLi9wYWNrYWdlLmpzb24nO1xuXG5mdW5jdGlvbiBkZWZhdWx0T3B0aW9ucygpIHtcbiAgICByZXR1cm4ge1xuICAgICAgICBvcHRpbWlzdGljOiBmYWxzZSxcbiAgICAgICAgZGlyZWN0aXZlOiBmYWxzZSxcbiAgICAgICAgbm9kZWpzU2NvcGU6IGZhbHNlLFxuICAgICAgICBpbXBsaWVkU3RyaWN0OiBmYWxzZSxcbiAgICAgICAgc291cmNlVHlwZTogJ3NjcmlwdCcsICAvLyBvbmUgb2YgWydzY3JpcHQnLCAnbW9kdWxlJ11cbiAgICAgICAgZWNtYVZlcnNpb246IDVcbiAgICB9O1xufVxuXG5mdW5jdGlvbiB1cGRhdGVEZWVwbHkodGFyZ2V0LCBvdmVycmlkZSkge1xuICAgIHZhciBrZXksIHZhbDtcblxuICAgIGZ1bmN0aW9uIGlzSGFzaE9iamVjdCh0YXJnZXQpIHtcbiAgICAgICAgcmV0dXJuIHR5cGVvZiB0YXJnZXQgPT09ICdvYmplY3QnICYmIHRhcmdldCBpbnN0YW5jZW9mIE9iamVjdCAmJiAhKHRhcmdldCBpbnN0YW5jZW9mIFJlZ0V4cCk7XG4gICAgfVxuXG4gICAgZm9yIChrZXkgaW4gb3ZlcnJpZGUpIHtcbiAgICAgICAgaWYgKG92ZXJyaWRlLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgICAgIHZhbCA9IG92ZXJyaWRlW2tleV07XG4gICAgICAgICAgICBpZiAoaXNIYXNoT2JqZWN0KHZhbCkpIHtcbiAgICAgICAgICAgICAgICBpZiAoaXNIYXNoT2JqZWN0KHRhcmdldFtrZXldKSkge1xuICAgICAgICAgICAgICAgICAgICB1cGRhdGVEZWVwbHkodGFyZ2V0W2tleV0sIHZhbCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgdGFyZ2V0W2tleV0gPSB1cGRhdGVEZWVwbHkoe30sIHZhbCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0YXJnZXRba2V5XSA9IHZhbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbiAgICByZXR1cm4gdGFyZ2V0O1xufVxuXG4vKipcbiAqIE1haW4gaW50ZXJmYWNlIGZ1bmN0aW9uLiBUYWtlcyBhbiBFc3ByaW1hIHN5bnRheCB0cmVlIGFuZCByZXR1cm5zIHRoZVxuICogYW5hbHl6ZWQgc2NvcGVzLlxuICogQGZ1bmN0aW9uIGFuYWx5emVcbiAqIEBwYXJhbSB7ZXNwcmltYS5UcmVlfSB0cmVlXG4gKiBAcGFyYW0ge09iamVjdH0gcHJvdmlkZWRPcHRpb25zIC0gT3B0aW9ucyB0aGF0IHRhaWxvciB0aGUgc2NvcGUgYW5hbHlzaXNcbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Byb3ZpZGVkT3B0aW9ucy5vcHRpbWlzdGljPWZhbHNlXSAtIHRoZSBvcHRpbWlzdGljIGZsYWdcbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Byb3ZpZGVkT3B0aW9ucy5kaXJlY3RpdmU9ZmFsc2VdLSB0aGUgZGlyZWN0aXZlIGZsYWdcbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW3Byb3ZpZGVkT3B0aW9ucy5pZ25vcmVFdmFsPWZhbHNlXS0gd2hldGhlciB0byBjaGVjayAnZXZhbCgpJyBjYWxsc1xuICogQHBhcmFtIHtib29sZWFufSBbcHJvdmlkZWRPcHRpb25zLm5vZGVqc1Njb3BlPWZhbHNlXS0gd2hldGhlciB0aGUgd2hvbGVcbiAqIHNjcmlwdCBpcyBleGVjdXRlZCB1bmRlciBub2RlLmpzIGVudmlyb25tZW50LiBXaGVuIGVuYWJsZWQsIGVzY29wZSBhZGRzXG4gKiBhIGZ1bmN0aW9uIHNjb3BlIGltbWVkaWF0ZWx5IGZvbGxvd2luZyB0aGUgZ2xvYmFsIHNjb3BlLlxuICogQHBhcmFtIHtib29sZWFufSBbcHJvdmlkZWRPcHRpb25zLmltcGxpZWRTdHJpY3Q9ZmFsc2VdLSBpbXBsaWVkIHN0cmljdCBtb2RlXG4gKiAoaWYgZWNtYVZlcnNpb24gPj0gNSkuXG4gKiBAcGFyYW0ge3N0cmluZ30gW3Byb3ZpZGVkT3B0aW9ucy5zb3VyY2VUeXBlPSdzY3JpcHQnXS0gdGhlIHNvdXJjZSB0eXBlIG9mIHRoZSBzY3JpcHQuIG9uZSBvZiAnc2NyaXB0JyBhbmQgJ21vZHVsZSdcbiAqIEBwYXJhbSB7bnVtYmVyfSBbcHJvdmlkZWRPcHRpb25zLmVjbWFWZXJzaW9uPTVdLSB3aGljaCBFQ01BU2NyaXB0IHZlcnNpb24gaXMgY29uc2lkZXJlZFxuICogQHJldHVybiB7U2NvcGVNYW5hZ2VyfVxuICovXG5leHBvcnQgZnVuY3Rpb24gYW5hbHl6ZSh0cmVlLCBwcm92aWRlZE9wdGlvbnMpIHtcbiAgICB2YXIgc2NvcGVNYW5hZ2VyLCByZWZlcmVuY2VyLCBvcHRpb25zO1xuXG4gICAgb3B0aW9ucyA9IHVwZGF0ZURlZXBseShkZWZhdWx0T3B0aW9ucygpLCBwcm92aWRlZE9wdGlvbnMpO1xuXG4gICAgc2NvcGVNYW5hZ2VyID0gbmV3IFNjb3BlTWFuYWdlcihvcHRpb25zKTtcblxuICAgIHJlZmVyZW5jZXIgPSBuZXcgUmVmZXJlbmNlcihzY29wZU1hbmFnZXIpO1xuICAgIHJlZmVyZW5jZXIudmlzaXQodHJlZSk7XG5cbiAgICBhc3NlcnQoc2NvcGVNYW5hZ2VyLl9fY3VycmVudFNjb3BlID09PSBudWxsLCAnY3VycmVudFNjb3BlIHNob3VsZCBiZSBudWxsLicpO1xuXG4gICAgcmV0dXJuIHNjb3BlTWFuYWdlcjtcbn1cblxuZXhwb3J0IHtcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS52ZXJzaW9uICovXG4gICAgdmVyc2lvbixcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS5SZWZlcmVuY2UgKi9cbiAgICBSZWZlcmVuY2UsXG4gICAgLyoqIEBuYW1lIG1vZHVsZTplc2NvcGUuVmFyaWFibGUgKi9cbiAgICBWYXJpYWJsZSxcbiAgICAvKiogQG5hbWUgbW9kdWxlOmVzY29wZS5TY29wZSAqL1xuICAgIFNjb3BlLFxuICAgIC8qKiBAbmFtZSBtb2R1bGU6ZXNjb3BlLlNjb3BlTWFuYWdlciAqL1xuICAgIFNjb3BlTWFuYWdlclxufTtcblxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      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..39687239bb5f62
      --- /dev/null
      +++ b/tools/eslint/node_modules/escope/lib/pattern-visitor.js
      @@ -0,0 +1,175 @@
      +'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; }; }();
      +
      +Object.defineProperty(exports, "__esModule", {
      +    value: true
      +});
      +
      +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(rootPattern, callback) {
      +        _classCallCheck(this, PatternVisitor);
      +
      +        var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(PatternVisitor).call(this));
      +
      +        _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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInBhdHRlcm4tdmlzaXRvci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJCQSxTQUFTLE9BQVQsQ0FBaUIsRUFBakIsRUFBcUI7QUFDakIsV0FBTyxHQUFHLEdBQUcsTUFBSCxHQUFZLENBQVosQ0FBSCxJQUFxQixJQUFyQixDQURVO0NBQXJCOztJQUlxQjs7Ozs7a0NBQ0EsTUFBTTtBQUNuQixnQkFBSSxXQUFXLEtBQUssSUFBTCxDQURJO0FBRW5CLG1CQUNJLGFBQWEsbUJBQU8sVUFBUCxJQUNiLGFBQWEsbUJBQU8sYUFBUCxJQUNiLGFBQWEsbUJBQU8sWUFBUCxJQUNiLGFBQWEsbUJBQU8sYUFBUCxJQUNiLGFBQWEsbUJBQU8sV0FBUCxJQUNiLGFBQWEsbUJBQU8saUJBQVAsQ0FSRTs7OztBQVl2QixhQWJpQixjQWFqQixDQUFZLFdBQVosRUFBeUIsUUFBekIsRUFBbUM7OEJBYmxCLGdCQWFrQjs7MkVBYmxCLDRCQWFrQjs7QUFFL0IsY0FBSyxXQUFMLEdBQW1CLFdBQW5CLENBRitCO0FBRy9CLGNBQUssUUFBTCxHQUFnQixRQUFoQixDQUgrQjtBQUkvQixjQUFLLFdBQUwsR0FBbUIsRUFBbkIsQ0FKK0I7QUFLL0IsY0FBSyxjQUFMLEdBQXNCLEVBQXRCLENBTCtCO0FBTS9CLGNBQUssWUFBTCxHQUFvQixFQUFwQixDQU4rQjs7S0FBbkM7O2lCQWJpQjs7bUNBc0JOLFNBQVM7QUFDaEIsZ0JBQU0sa0JBQWtCLFFBQVEsS0FBSyxZQUFMLENBQTFCLENBRFU7QUFFaEIsaUJBQUssUUFBTCxDQUFjLE9BQWQsRUFBdUI7QUFDbkIsMEJBQVUsWUFBWSxLQUFLLFdBQUw7QUFDdEIsc0JBQU0sbUJBQW1CLElBQW5CLElBQTJCLGdCQUFnQixRQUFoQixLQUE2QixPQUE3QjtBQUNqQyw2QkFBYSxLQUFLLFdBQUw7YUFIakIsRUFGZ0I7Ozs7aUNBU1gsVUFBVTs7QUFFZixnQkFBSSxTQUFTLFFBQVQsRUFBbUI7QUFDbkIscUJBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixTQUFTLEdBQVQsQ0FBekIsQ0FEbUI7YUFBdkI7Ozs7O0FBRmUsZ0JBU2YsQ0FBSyxLQUFMLENBQVcsU0FBUyxLQUFULENBQVgsQ0FUZTs7OztxQ0FZTixTQUFTO0FBQ2xCLGdCQUFJLENBQUosRUFBTyxFQUFQLEVBQVcsT0FBWCxDQURrQjtBQUVsQixpQkFBSyxJQUFJLENBQUosRUFBTyxLQUFLLFFBQVEsUUFBUixDQUFpQixNQUFqQixFQUF5QixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNuRCwwQkFBVSxRQUFRLFFBQVIsQ0FBaUIsQ0FBakIsQ0FBVixDQURtRDtBQUVuRCxxQkFBSyxLQUFMLENBQVcsT0FBWCxFQUZtRDthQUF2RDs7OzswQ0FNYyxTQUFTO0FBQ3ZCLGlCQUFLLFdBQUwsQ0FBaUIsSUFBakIsQ0FBc0IsT0FBdEIsRUFEdUI7QUFFdkIsaUJBQUssS0FBTCxDQUFXLFFBQVEsSUFBUixDQUFYLENBRnVCO0FBR3ZCLGlCQUFLLGNBQUwsQ0FBb0IsSUFBcEIsQ0FBeUIsUUFBUSxLQUFSLENBQXpCLENBSHVCO0FBSXZCLGlCQUFLLFdBQUwsQ0FBaUIsR0FBakIsR0FKdUI7Ozs7b0NBT2YsU0FBUztBQUNqQixpQkFBSyxZQUFMLENBQWtCLElBQWxCLENBQXVCLE9BQXZCLEVBRGlCO0FBRWpCLGlCQUFLLEtBQUwsQ0FBVyxRQUFRLFFBQVIsQ0FBWCxDQUZpQjtBQUdqQixpQkFBSyxZQUFMLENBQWtCLEdBQWxCLEdBSGlCOzs7O3lDQU1KLE1BQU07O0FBRW5CLGdCQUFJLEtBQUssUUFBTCxFQUFlO0FBQ2YscUJBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixLQUFLLFFBQUwsQ0FBekIsQ0FEZTthQUFuQjs7QUFGbUIsZ0JBTW5CLENBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixLQUFLLE1BQUwsQ0FBekIsQ0FObUI7Ozs7Ozs7Ozs7OztzQ0FnQlQsTUFBTTtBQUNoQixpQkFBSyxLQUFMLENBQVcsS0FBSyxRQUFMLENBQVgsQ0FEZ0I7Ozs7d0NBSUosTUFBTTtBQUNsQixpQkFBSyxRQUFMLENBQWMsT0FBZCxDQUFzQixLQUFLLEtBQUwsRUFBWSxJQUFsQyxFQURrQjs7Ozs2Q0FJRCxNQUFNO0FBQ3ZCLGlCQUFLLFdBQUwsQ0FBaUIsSUFBakIsQ0FBc0IsSUFBdEIsRUFEdUI7QUFFdkIsaUJBQUssS0FBTCxDQUFXLEtBQUssSUFBTCxDQUFYLENBRnVCO0FBR3ZCLGlCQUFLLGNBQUwsQ0FBb0IsSUFBcEIsQ0FBeUIsS0FBSyxLQUFMLENBQXpCLENBSHVCO0FBSXZCLGlCQUFLLFdBQUwsQ0FBaUIsR0FBakIsR0FKdUI7Ozs7dUNBT1osTUFBTTs7OztBQUVqQixpQkFBSyxTQUFMLENBQWUsT0FBZixDQUF1QixhQUFLO0FBQUUsdUJBQUssY0FBTCxDQUFvQixJQUFwQixDQUF5QixDQUF6QixFQUFGO2FBQUwsQ0FBdkIsQ0FGaUI7QUFHakIsaUJBQUssS0FBTCxDQUFXLEtBQUssTUFBTCxDQUFYLENBSGlCOzs7O1dBL0ZKO0VBQXVCLG9CQUFVLE9BQVY7Ozs7a0JBQXZCIiwiZmlsZSI6InBhdHRlcm4tdmlzaXRvci5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuaW1wb3J0IHsgU3ludGF4IH0gZnJvbSAnZXN0cmF2ZXJzZSc7XG5pbXBvcnQgZXNyZWN1cnNlIGZyb20gJ2VzcmVjdXJzZSc7XG5cbmZ1bmN0aW9uIGdldExhc3QoeHMpIHtcbiAgICByZXR1cm4geHNbeHMubGVuZ3RoIC0gMV0gfHwgbnVsbDtcbn1cblxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgUGF0dGVyblZpc2l0b3IgZXh0ZW5kcyBlc3JlY3Vyc2UuVmlzaXRvciB7XG4gICAgc3RhdGljIGlzUGF0dGVybihub2RlKSB7XG4gICAgICAgIHZhciBub2RlVHlwZSA9IG5vZGUudHlwZTtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIG5vZGVUeXBlID09PSBTeW50YXguSWRlbnRpZmllciB8fFxuICAgICAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5PYmplY3RQYXR0ZXJuIHx8XG4gICAgICAgICAgICBub2RlVHlwZSA9PT0gU3ludGF4LkFycmF5UGF0dGVybiB8fFxuICAgICAgICAgICAgbm9kZVR5cGUgPT09IFN5bnRheC5TcHJlYWRFbGVtZW50IHx8XG4gICAgICAgICAgICBub2RlVHlwZSA9PT0gU3ludGF4LlJlc3RFbGVtZW50IHx8XG4gICAgICAgICAgICBub2RlVHlwZSA9PT0gU3ludGF4LkFzc2lnbm1lbnRQYXR0ZXJuXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgY29uc3RydWN0b3Iocm9vdFBhdHRlcm4sIGNhbGxiYWNrKSB7XG4gICAgICAgIHN1cGVyKCk7XG4gICAgICAgIHRoaXMucm9vdFBhdHRlcm4gPSByb290UGF0dGVybjtcbiAgICAgICAgdGhpcy5jYWxsYmFjayA9IGNhbGxiYWNrO1xuICAgICAgICB0aGlzLmFzc2lnbm1lbnRzID0gW107XG4gICAgICAgIHRoaXMucmlnaHRIYW5kTm9kZXMgPSBbXTtcbiAgICAgICAgdGhpcy5yZXN0RWxlbWVudHMgPSBbXTtcbiAgICB9XG5cbiAgICBJZGVudGlmaWVyKHBhdHRlcm4pIHtcbiAgICAgICAgY29uc3QgbGFzdFJlc3RFbGVtZW50ID0gZ2V0TGFzdCh0aGlzLnJlc3RFbGVtZW50cyk7XG4gICAgICAgIHRoaXMuY2FsbGJhY2socGF0dGVybiwge1xuICAgICAgICAgICAgdG9wTGV2ZWw6IHBhdHRlcm4gPT09IHRoaXMucm9vdFBhdHRlcm4sXG4gICAgICAgICAgICByZXN0OiBsYXN0UmVzdEVsZW1lbnQgIT0gbnVsbCAmJiBsYXN0UmVzdEVsZW1lbnQuYXJndW1lbnQgPT09IHBhdHRlcm4sXG4gICAgICAgICAgICBhc3NpZ25tZW50czogdGhpcy5hc3NpZ25tZW50c1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBQcm9wZXJ0eShwcm9wZXJ0eSkge1xuICAgICAgICAvLyBDb21wdXRlZCBwcm9wZXJ0eSdzIGtleSBpcyBhIHJpZ2h0IGhhbmQgbm9kZS5cbiAgICAgICAgaWYgKHByb3BlcnR5LmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnJpZ2h0SGFuZE5vZGVzLnB1c2gocHJvcGVydHkua2V5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIElmIGl0J3Mgc2hvcnRoYW5kLCBpdHMga2V5IGlzIHNhbWUgYXMgaXRzIHZhbHVlLlxuICAgICAgICAvLyBJZiBpdCdzIHNob3J0aGFuZCBhbmQgaGFzIGl0cyBkZWZhdWx0IHZhbHVlLCBpdHMga2V5IGlzIHNhbWUgYXMgaXRzIHZhbHVlLmxlZnQgKHRoZSB2YWx1ZSBpcyBBc3NpZ25tZW50UGF0dGVybikuXG4gICAgICAgIC8vIElmIGl0J3Mgbm90IHNob3J0aGFuZCwgdGhlIG5hbWUgb2YgbmV3IHZhcmlhYmxlIGlzIGl0cyB2YWx1ZSdzLlxuICAgICAgICB0aGlzLnZpc2l0KHByb3BlcnR5LnZhbHVlKTtcbiAgICB9XG5cbiAgICBBcnJheVBhdHRlcm4ocGF0dGVybikge1xuICAgICAgICB2YXIgaSwgaXosIGVsZW1lbnQ7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gcGF0dGVybi5lbGVtZW50cy5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBlbGVtZW50ID0gcGF0dGVybi5lbGVtZW50c1tpXTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQoZWxlbWVudCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBBc3NpZ25tZW50UGF0dGVybihwYXR0ZXJuKSB7XG4gICAgICAgIHRoaXMuYXNzaWdubWVudHMucHVzaChwYXR0ZXJuKTtcbiAgICAgICAgdGhpcy52aXNpdChwYXR0ZXJuLmxlZnQpO1xuICAgICAgICB0aGlzLnJpZ2h0SGFuZE5vZGVzLnB1c2gocGF0dGVybi5yaWdodCk7XG4gICAgICAgIHRoaXMuYXNzaWdubWVudHMucG9wKCk7XG4gICAgfVxuXG4gICAgUmVzdEVsZW1lbnQocGF0dGVybikge1xuICAgICAgICB0aGlzLnJlc3RFbGVtZW50cy5wdXNoKHBhdHRlcm4pO1xuICAgICAgICB0aGlzLnZpc2l0KHBhdHRlcm4uYXJndW1lbnQpO1xuICAgICAgICB0aGlzLnJlc3RFbGVtZW50cy5wb3AoKTtcbiAgICB9XG5cbiAgICBNZW1iZXJFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgLy8gQ29tcHV0ZWQgcHJvcGVydHkncyBrZXkgaXMgYSByaWdodCBoYW5kIG5vZGUuXG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnJpZ2h0SGFuZE5vZGVzLnB1c2gobm9kZS5wcm9wZXJ0eSk7XG4gICAgICAgIH1cbiAgICAgICAgLy8gdGhlIG9iamVjdCBpcyBvbmx5IHJlYWQsIHdyaXRlIHRvIGl0cyBwcm9wZXJ0eS5cbiAgICAgICAgdGhpcy5yaWdodEhhbmROb2Rlcy5wdXNoKG5vZGUub2JqZWN0KTtcbiAgICB9XG5cbiAgICAvL1xuICAgIC8vIEZvckluU3RhdGVtZW50LmxlZnQgYW5kIEFzc2lnbm1lbnRFeHByZXNzaW9uLmxlZnQgYXJlIExlZnRIYW5kU2lkZUV4cHJlc3Npb24uXG4gICAgLy8gQnkgc3BlYywgTGVmdEhhbmRTaWRlRXhwcmVzc2lvbiBpcyBQYXR0ZXJuIG9yIE1lbWJlckV4cHJlc3Npb24uXG4gICAgLy8gICAoc2VlIGFsc286IGh0dHBzOi8vZ2l0aHViLmNvbS9lc3RyZWUvZXN0cmVlL3B1bGwvMjAjaXNzdWVjb21tZW50LTc0NTg0NzU4KVxuICAgIC8vIEJ1dCBlc3ByZWUgMi4wIGFuZCBlc3ByaW1hIDIuMCBwYXJzZSB0byBBcnJheUV4cHJlc3Npb24sIE9iamVjdEV4cHJlc3Npb24sIGV0Yy4uLlxuICAgIC8vXG5cbiAgICBTcHJlYWRFbGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmFyZ3VtZW50KTtcbiAgICB9XG5cbiAgICBBcnJheUV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICBub2RlLmVsZW1lbnRzLmZvckVhY2godGhpcy52aXNpdCwgdGhpcyk7XG4gICAgfVxuXG4gICAgQXNzaWdubWVudEV4cHJlc3Npb24obm9kZSkge1xuICAgICAgICB0aGlzLmFzc2lnbm1lbnRzLnB1c2gobm9kZSk7XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgdGhpcy5yaWdodEhhbmROb2Rlcy5wdXNoKG5vZGUucmlnaHQpO1xuICAgICAgICB0aGlzLmFzc2lnbm1lbnRzLnBvcCgpO1xuICAgIH1cblxuICAgIENhbGxFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgLy8gYXJndW1lbnRzIGFyZSByaWdodCBoYW5kIG5vZGVzLlxuICAgICAgICBub2RlLmFyZ3VtZW50cy5mb3JFYWNoKGEgPT4geyB0aGlzLnJpZ2h0SGFuZE5vZGVzLnB1c2goYSk7IH0pO1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuY2FsbGVlKTtcbiAgICB9XG59XG5cbi8qIHZpbTogc2V0IHN3PTQgdHM9NCBldCB0dz04MCA6ICovXG4iXSwic291cmNlUm9vdCI6Ii9zb3VyY2UvIn0=
      diff --git a/tools/eslint/node_modules/escope/lib/reference.js b/tools/eslint/node_modules/escope/lib/reference.js
      index 68b6898a8b9b70..6b1d60a2cd789a 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; }; })();
      +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 _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 
      @@ -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,88 @@ 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 +188,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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBd0JBLElBQU0sT0FBTyxHQUFQO0FBQ04sSUFBTSxRQUFRLEdBQVI7QUFDTixJQUFNLEtBQUssT0FBTyxLQUFQOzs7Ozs7O0lBTVU7QUFDakIsV0FEaUIsU0FDakIsQ0FBWSxLQUFaLEVBQW1CLEtBQW5CLEVBQTBCLElBQTFCLEVBQWlDLFNBQWpDLEVBQTRDLG1CQUE1QyxFQUFpRSxPQUFqRSxFQUEwRSxJQUExRSxFQUFnRjswQkFEL0QsV0FDK0Q7Ozs7OztBQUs1RSxTQUFLLFVBQUwsR0FBa0IsS0FBbEI7Ozs7O0FBTDRFLFFBVTVFLENBQUssSUFBTCxHQUFZLEtBQVo7Ozs7OztBQVY0RSxRQWdCNUUsQ0FBSyxPQUFMLEdBQWUsS0FBZjs7Ozs7QUFoQjRFLFFBcUI1RSxDQUFLLFFBQUwsR0FBZ0IsSUFBaEI7Ozs7Ozs7QUFyQjRFLFFBNEI1RSxDQUFLLElBQUwsR0FBWSxJQUFaLENBNUI0RTtBQTZCNUUsUUFBSSxLQUFLLE9BQUwsRUFBSixFQUFvQjs7Ozs7QUFLaEIsV0FBSyxTQUFMLEdBQWlCLFNBQWpCOzs7OztBQUxnQixVQVVoQixDQUFLLE9BQUwsR0FBZSxPQUFmOzs7OztBQVZnQixVQWVoQixDQUFLLElBQUwsR0FBWSxJQUFaLENBZmdCO0tBQXBCO0FBaUJBLFNBQUsscUJBQUwsR0FBNkIsbUJBQTdCLENBOUM0RTtHQUFoRjs7Ozs7Ozs7ZUFEaUI7OytCQXVETjtBQUNQLGFBQU8sQ0FBQyxLQUFLLE9BQUwsSUFBZ0IsS0FBSyxRQUFMLElBQWlCLEtBQUssUUFBTCxDQUFjLEtBQWQsQ0FBb0IsUUFBcEIsRUFBbEMsQ0FEQTs7Ozs7Ozs7Ozs7OEJBU0Q7QUFDTixhQUFPLENBQUMsRUFBRSxLQUFLLElBQUwsR0FBWSxVQUFVLEtBQVYsQ0FBZCxDQURGOzs7Ozs7Ozs7Ozs2QkFTRDtBQUNMLGFBQU8sQ0FBQyxFQUFFLEtBQUssSUFBTCxHQUFZLFVBQVUsSUFBVixDQUFkLENBREg7Ozs7Ozs7Ozs7O2lDQVNJO0FBQ1QsYUFBTyxLQUFLLElBQUwsS0FBYyxVQUFVLElBQVYsQ0FEWjs7Ozs7Ozs7Ozs7a0NBU0M7QUFDVixhQUFPLEtBQUssSUFBTCxLQUFjLFVBQVUsS0FBVixDQURYOzs7Ozs7Ozs7OztrQ0FTQTtBQUNWLGFBQU8sS0FBSyxJQUFMLEtBQWMsVUFBVSxFQUFWLENBRFg7Ozs7U0FwR0c7Ozs7Ozs7OztBQTZHckIsVUFBVSxJQUFWLEdBQWlCLElBQWpCOzs7OztBQUtBLFVBQVUsS0FBVixHQUFrQixLQUFsQjs7Ozs7QUFLQSxVQUFVLEVBQVYsR0FBZSxFQUFmIiwiZmlsZSI6InJlZmVyZW5jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuY29uc3QgUkVBRCA9IDB4MTtcbmNvbnN0IFdSSVRFID0gMHgyO1xuY29uc3QgUlcgPSBSRUFEIHwgV1JJVEU7XG5cbi8qKlxuICogQSBSZWZlcmVuY2UgcmVwcmVzZW50cyBhIHNpbmdsZSBvY2N1cnJlbmNlIG9mIGFuIGlkZW50aWZpZXIgaW4gY29kZS5cbiAqIEBjbGFzcyBSZWZlcmVuY2VcbiAqL1xuZXhwb3J0IGRlZmF1bHQgY2xhc3MgUmVmZXJlbmNlIHtcbiAgICBjb25zdHJ1Y3RvcihpZGVudCwgc2NvcGUsIGZsYWcsICB3cml0ZUV4cHIsIG1heWJlSW1wbGljaXRHbG9iYWwsIHBhcnRpYWwsIGluaXQpIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIElkZW50aWZpZXIgc3ludGF4IG5vZGUuXG4gICAgICAgICAqIEBtZW1iZXIge2VzcHJpbWEjSWRlbnRpZmllcn0gUmVmZXJlbmNlI2lkZW50aWZpZXJcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuaWRlbnRpZmllciA9IGlkZW50O1xuICAgICAgICAvKipcbiAgICAgICAgICogUmVmZXJlbmNlIHRvIHRoZSBlbmNsb3NpbmcgU2NvcGUuXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBSZWZlcmVuY2UjZnJvbVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5mcm9tID0gc2NvcGU7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoZSByZWZlcmVuY2UgY29tZXMgZnJvbSBhIGR5bmFtaWMgc2NvcGUgKHN1Y2ggYXMgJ2V2YWwnLFxuICAgICAgICAgKiAnd2l0aCcsIGV0Yy4pLCBhbmQgbWF5IGJlIHRyYXBwZWQgYnkgZHluYW1pYyBzY29wZXMuXG4gICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFJlZmVyZW5jZSN0YWludGVkXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnRhaW50ZWQgPSBmYWxzZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFRoZSB2YXJpYWJsZSB0aGlzIHJlZmVyZW5jZSBpcyByZXNvbHZlZCB3aXRoLlxuICAgICAgICAgKiBAbWVtYmVyIHtWYXJpYWJsZX0gUmVmZXJlbmNlI3Jlc29sdmVkXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLnJlc29sdmVkID0gbnVsbDtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFRoZSByZWFkLXdyaXRlIG1vZGUgb2YgdGhlIHJlZmVyZW5jZS4gKFZhbHVlIGlzIG9uZSBvZiB7QGxpbmtcbiAgICAgICAgICogUmVmZXJlbmNlLlJFQUR9LCB7QGxpbmsgUmVmZXJlbmNlLlJXfSwge0BsaW5rIFJlZmVyZW5jZS5XUklURX0pLlxuICAgICAgICAgKiBAbWVtYmVyIHtudW1iZXJ9IFJlZmVyZW5jZSNmbGFnXG4gICAgICAgICAqIEBwcml2YXRlXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmZsYWcgPSBmbGFnO1xuICAgICAgICBpZiAodGhpcy5pc1dyaXRlKCkpIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogSWYgcmVmZXJlbmNlIGlzIHdyaXRlYWJsZSwgdGhpcyBpcyB0aGUgdHJlZSBiZWluZyB3cml0dGVuIHRvIGl0LlxuICAgICAgICAgICAgICogQG1lbWJlciB7ZXNwcmltYSNOb2RlfSBSZWZlcmVuY2Ujd3JpdGVFeHByXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMud3JpdGVFeHByID0gd3JpdGVFeHByO1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiBXaGV0aGVyIHRoZSBSZWZlcmVuY2UgbWlnaHQgcmVmZXIgdG8gYSBwYXJ0aWFsIHZhbHVlIG9mIHdyaXRlRXhwci5cbiAgICAgICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFJlZmVyZW5jZSNwYXJ0aWFsXG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMucGFydGlhbCA9IHBhcnRpYWw7XG4gICAgICAgICAgICAvKipcbiAgICAgICAgICAgICAqIFdoZXRoZXIgdGhlIFJlZmVyZW5jZSBpcyB0byB3cml0ZSBvZiBpbml0aWFsaXphdGlvbi5cbiAgICAgICAgICAgICAqIEBtZW1iZXIge2Jvb2xlYW59IFJlZmVyZW5jZSNpbml0XG4gICAgICAgICAgICAgKi9cbiAgICAgICAgICAgIHRoaXMuaW5pdCA9IGluaXQ7XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5fX21heWJlSW1wbGljaXRHbG9iYWwgPSBtYXliZUltcGxpY2l0R2xvYmFsO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyBzdGF0aWMuXG4gICAgICogQG1ldGhvZCBSZWZlcmVuY2UjaXNTdGF0aWNcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzU3RhdGljKCkge1xuICAgICAgICByZXR1cm4gIXRoaXMudGFpbnRlZCAmJiB0aGlzLnJlc29sdmVkICYmIHRoaXMucmVzb2x2ZWQuc2NvcGUuaXNTdGF0aWMoKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBXaGV0aGVyIHRoZSByZWZlcmVuY2UgaXMgd3JpdGVhYmxlLlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzV3JpdGVcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzV3JpdGUoKSB7XG4gICAgICAgIHJldHVybiAhISh0aGlzLmZsYWcgJiBSZWZlcmVuY2UuV1JJVEUpO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyByZWFkYWJsZS5cbiAgICAgKiBAbWV0aG9kIFJlZmVyZW5jZSNpc1JlYWRcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzUmVhZCgpIHtcbiAgICAgICAgcmV0dXJuICEhKHRoaXMuZmxhZyAmIFJlZmVyZW5jZS5SRUFEKTtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBXaGV0aGVyIHRoZSByZWZlcmVuY2UgaXMgcmVhZC1vbmx5LlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzUmVhZE9ubHlcbiAgICAgKiBAcmV0dXJuIHtib29sZWFufVxuICAgICAqL1xuICAgIGlzUmVhZE9ubHkoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLmZsYWcgPT09IFJlZmVyZW5jZS5SRUFEO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyB3cml0ZS1vbmx5LlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzV3JpdGVPbmx5XG4gICAgICogQHJldHVybiB7Ym9vbGVhbn1cbiAgICAgKi9cbiAgICBpc1dyaXRlT25seSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmxhZyA9PT0gUmVmZXJlbmNlLldSSVRFO1xuICAgIH1cblxuICAgIC8qKlxuICAgICAqIFdoZXRoZXIgdGhlIHJlZmVyZW5jZSBpcyByZWFkLXdyaXRlLlxuICAgICAqIEBtZXRob2QgUmVmZXJlbmNlI2lzUmVhZFdyaXRlXG4gICAgICogQHJldHVybiB7Ym9vbGVhbn1cbiAgICAgKi9cbiAgICBpc1JlYWRXcml0ZSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuZmxhZyA9PT0gUmVmZXJlbmNlLlJXO1xuICAgIH1cbn1cblxuLyoqXG4gKiBAY29uc3RhbnQgUmVmZXJlbmNlLlJFQURcbiAqIEBwcml2YXRlXG4gKi9cblJlZmVyZW5jZS5SRUFEID0gUkVBRDtcbi8qKlxuICogQGNvbnN0YW50IFJlZmVyZW5jZS5XUklURVxuICogQHByaXZhdGVcbiAqL1xuUmVmZXJlbmNlLldSSVRFID0gV1JJVEU7XG4vKipcbiAqIEBjb25zdGFudCBSZWZlcmVuY2UuUldcbiAqIEBwcml2YXRlXG4gKi9cblJlZmVyZW5jZS5SVyA9IFJXO1xuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      diff --git a/tools/eslint/node_modules/escope/lib/referencer.js b/tools/eslint/node_modules/escope/lib/referencer.js
      index 09f59918045ec7..4620007006f096 100644
      --- a/tools/eslint/node_modules/escope/lib/referencer.js
      +++ b/tools/eslint/node_modules/escope/lib/referencer.js
      @@ -1,193 +1,68 @@
      -"use strict";
      +'use strict';
       
      -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
      +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 _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 _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);
      -
      -function getLast(xs) {
      -    return xs[xs.length - 1] || null;
      -}
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 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 traverseIdentifierInPattern(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(rootPattern, callback);
           visitor.visit(rootPattern);
       
           // Process the right hand nodes recursively.
      @@ -196,559 +71,560 @@ 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));
       
      -    _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) {
      +var Referencer = function (_esrecurse$Visitor2) {
      +    _inherits(Referencer, _esrecurse$Visitor2);
      +
           function Referencer(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));
       
      -    _inherits(Referencer, _esrecurse$Visitor3);
      +        _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(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);
      -                }
      -            }
      -        },
      -        MemberExpression: {
      -            value: function MemberExpression(node) {
      -                this.visit(node.object);
      -                if (node.computed) {
      -                    this.visit(node.property);
      +                    this.currentScope().__referencing(node.left, _reference2.default.RW, node.right);
                       }
      +            } else {
      +                this.visit(node.left);
                   }
      -        },
      -        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);
      +        }
      +    }]);
       
           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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZmVyZW5jZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUErQkEsU0FBUywyQkFBVCxDQUFxQyxXQUFyQyxFQUFrRCxVQUFsRCxFQUE4RCxRQUE5RCxFQUF3RTs7QUFFcEUsUUFBSSxVQUFVLDZCQUFtQixXQUFuQixFQUFnQyxRQUFoQyxDQUFWLENBRmdFO0FBR3BFLFlBQVEsS0FBUixDQUFjLFdBQWQ7OztBQUhvRSxRQU1oRSxjQUFjLElBQWQsRUFBb0I7QUFDcEIsZ0JBQVEsY0FBUixDQUF1QixPQUF2QixDQUErQixXQUFXLEtBQVgsRUFBa0IsVUFBakQsRUFEb0I7S0FBeEI7Q0FOSjs7Ozs7Ozs7SUFpQk07OztBQUNGLGFBREUsUUFDRixDQUFZLFdBQVosRUFBeUIsVUFBekIsRUFBcUM7OEJBRG5DLFVBQ21DOzsyRUFEbkMsc0JBQ21DOztBQUVqQyxjQUFLLFdBQUwsR0FBbUIsV0FBbkIsQ0FGaUM7QUFHakMsY0FBSyxVQUFMLEdBQWtCLFVBQWxCLENBSGlDOztLQUFyQzs7aUJBREU7O29DQU9VLElBQUksV0FBVzs7O0FBQ3ZCLGlCQUFLLFVBQUwsQ0FBZ0IsWUFBaEIsQ0FBNkIsRUFBN0IsRUFBaUMsVUFBQyxPQUFELEVBQWE7QUFDMUMsdUJBQUssVUFBTCxDQUFnQixZQUFoQixHQUErQixRQUEvQixDQUF3QyxPQUF4QyxFQUNJLDJCQUNJLG1CQUFTLGFBQVQsRUFDQSxPQUZKLEVBR0ksU0FISixFQUlJLE9BQUssV0FBTCxFQUNBLElBTEosRUFNSSxJQU5KLENBREosRUFEMEM7YUFBYixDQUFqQyxDQUR1Qjs7OztpREFjRixNQUFNO0FBQzNCLGdCQUFJLFFBQVMsS0FBSyxLQUFMLElBQWMsS0FBSyxFQUFMLENBREE7QUFFM0IsZ0JBQUksS0FBSixFQUFXO0FBQ1AscUJBQUssV0FBTCxDQUFpQixLQUFqQixFQUF3QixJQUF4QixFQURPO2FBQVg7Ozs7K0NBS21CLE1BQU07QUFDekIsZ0JBQUksUUFBUyxLQUFLLEtBQUwsSUFBYyxLQUFLLEVBQUwsQ0FERjtBQUV6QixpQkFBSyxXQUFMLENBQWlCLEtBQWpCLEVBQXdCLElBQXhCLEVBRnlCOzs7O3dDQUtiLE1BQU07QUFDbEIsZ0JBQUksUUFBUyxLQUFLLEtBQUwsSUFBYyxLQUFLLEVBQUwsQ0FEVDtBQUVsQixnQkFBSSxLQUFLLElBQUwsRUFBVztBQUNYLHFCQUFLLFdBQUwsQ0FBaUIsS0FBSyxJQUFMLEVBQVcsSUFBNUIsRUFEVzthQUFmLE1BRU87QUFDSCxxQkFBSyxXQUFMLENBQWlCLEtBQWpCLEVBQXdCLElBQXhCLEVBREc7YUFGUDs7OztXQW5DRjtFQUFpQixvQkFBVSxPQUFWOzs7O0lBNENGOzs7QUFDakIsYUFEaUIsVUFDakIsQ0FBWSxZQUFaLEVBQTBCOzhCQURULFlBQ1M7OzRFQURULHdCQUNTOztBQUV0QixlQUFLLFlBQUwsR0FBb0IsWUFBcEIsQ0FGc0I7QUFHdEIsZUFBSyxNQUFMLEdBQWMsSUFBZCxDQUhzQjtBQUl0QixlQUFLLHVCQUFMLEdBQStCLEtBQS9CLENBSnNCOztLQUExQjs7aUJBRGlCOzt1Q0FRRjtBQUNYLG1CQUFPLEtBQUssWUFBTCxDQUFrQixjQUFsQixDQURJOzs7OzhCQUlULE1BQU07QUFDUixtQkFBTyxLQUFLLFlBQUwsTUFBdUIsU0FBUyxLQUFLLFlBQUwsR0FBb0IsS0FBcEIsRUFBMkI7QUFDOUQscUJBQUssWUFBTCxDQUFrQixjQUFsQixHQUFtQyxLQUFLLFlBQUwsR0FBb0IsT0FBcEIsQ0FBNEIsS0FBSyxZQUFMLENBQS9ELENBRDhEO2FBQWxFOzs7O2tEQUtzQix5QkFBeUI7QUFDL0MsZ0JBQUksV0FBVyxLQUFLLHVCQUFMLENBRGdDO0FBRS9DLGlCQUFLLHVCQUFMLEdBQStCLHVCQUEvQixDQUYrQztBQUcvQyxtQkFBTyxRQUFQLENBSCtDOzs7O2lEQU0xQix5QkFBeUI7QUFDOUMsaUJBQUssdUJBQUwsR0FBK0IsdUJBQS9CLENBRDhDOzs7OzRDQUk5QixNQUFNLGVBQWU7OztBQUdyQyxpQkFBSyxZQUFMLENBQWtCLGNBQWxCLENBQWlDLElBQWpDLEVBQXVDLGFBQXZDLEVBSHFDO0FBSXJDLGlCQUFLLHdCQUFMLENBQThCLEtBQUssWUFBTCxFQUE5QixFQUFtRCxtQkFBUyxHQUFULEVBQWMsY0FBYyxJQUFkLEVBQW9CLENBQXJGLEVBQXdGLElBQXhGLEVBSnFDOzs7O2tEQU9mLE1BQU07Ozs7QUFFNUIsZ0JBQUksY0FBSixDQUY0QjtBQUc1QixpQkFBSyxZQUFMLENBQWtCLGNBQWxCLENBQWlDLElBQWpDLEVBSDRCO0FBSTVCLDZCQUFpQixLQUFLLElBQUwsQ0FKVztBQUs1QixpQkFBSyx3QkFBTCxDQUE4QixLQUFLLFlBQUwsRUFBOUIsRUFBbUQsbUJBQVMsUUFBVCxFQUFtQixjQUF0RSxFQUFzRixDQUF0RixFQUw0QjtBQU01QixpQkFBSyxZQUFMLENBQWtCLGVBQWUsWUFBZixDQUE0QixDQUE1QixFQUErQixFQUEvQixFQUFtQyxVQUFDLE9BQUQsRUFBYTtBQUM5RCx1QkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLE9BQWxDLEVBQTJDLG9CQUFVLEtBQVYsRUFBaUIsS0FBSyxLQUFMLEVBQVksSUFBeEUsRUFBOEUsSUFBOUUsRUFBb0YsSUFBcEYsRUFEOEQ7YUFBYixDQUFyRCxDQU40Qjs7OztnREFXUixTQUFTLGFBQWEscUJBQXFCLE1BQU07QUFDckUsZ0JBQU0sUUFBUSxLQUFLLFlBQUwsRUFBUixDQUQrRDtBQUVyRSx3QkFBWSxPQUFaLENBQW9CLHNCQUFjO0FBQzlCLHNCQUFNLGFBQU4sQ0FDSSxPQURKLEVBRUksb0JBQVUsS0FBVixFQUNBLFdBQVcsS0FBWCxFQUNBLG1CQUpKLEVBS0ksWUFBWSxXQUFXLElBQVgsRUFDWixJQU5KLEVBRDhCO2FBQWQsQ0FBcEIsQ0FGcUU7Ozs7cUNBYTVELE1BQU0sU0FBUyxVQUFVO0FBQ2xDLGdCQUFJLE9BQU8sT0FBUCxLQUFtQixVQUFuQixFQUErQjtBQUMvQiwyQkFBVyxPQUFYLENBRCtCO0FBRS9CLDBCQUFVLEVBQUMsdUJBQXVCLEtBQXZCLEVBQVgsQ0FGK0I7YUFBbkM7QUFJQSx3Q0FDSSxJQURKLEVBRUksUUFBUSxxQkFBUixHQUFnQyxJQUFoQyxHQUF1QyxJQUF2QyxFQUNBLFFBSEosRUFMa0M7Ozs7c0NBV3hCLE1BQU07OztBQUNoQixnQkFBSSxDQUFKLEVBQU8sRUFBUDs7Ozs7O0FBRGdCLGdCQU9aLEtBQUssSUFBTCxLQUFjLG1CQUFPLG1CQUFQLEVBQTRCOztBQUUxQyxxQkFBSyxZQUFMLEdBQW9CLFFBQXBCLENBQTZCLEtBQUssRUFBTCxFQUNyQiwyQkFDSSxtQkFBUyxZQUFULEVBQ0EsS0FBSyxFQUFMLEVBQ0EsSUFISixFQUlJLElBSkosRUFLSSxJQUxKLEVBTUksSUFOSixDQURSLEVBRjBDO2FBQTlDOzs7O0FBUGdCLGdCQXNCWixLQUFLLElBQUwsS0FBYyxtQkFBTyxrQkFBUCxJQUE2QixLQUFLLEVBQUwsRUFBUztBQUNwRCxxQkFBSyxZQUFMLENBQWtCLGlDQUFsQixDQUFvRCxJQUFwRCxFQURvRDthQUF4RDs7O0FBdEJnQixnQkEyQmhCLENBQUssWUFBTCxDQUFrQixtQkFBbEIsQ0FBc0MsSUFBdEMsRUFBNEMsS0FBSyx1QkFBTCxDQUE1Qzs7O0FBM0JnQixpQkE4QlgsSUFBSSxDQUFKLEVBQU8sS0FBSyxLQUFLLE1BQUwsQ0FBWSxNQUFaLEVBQW9CLElBQUksRUFBSixFQUFRLEVBQUUsQ0FBRixFQUFLO0FBQzlDLHFCQUFLLFlBQUwsQ0FBa0IsS0FBSyxNQUFMLENBQVksQ0FBWixDQUFsQixFQUFrQyxFQUFDLHVCQUF1QixJQUF2QixFQUFuQyxFQUFpRSxVQUFDLE9BQUQsRUFBVSxJQUFWLEVBQW1CO0FBQ2hGLDJCQUFLLFlBQUwsR0FBb0IsUUFBcEIsQ0FBNkIsT0FBN0IsRUFDSSxvQ0FDSSxPQURKLEVBRUksSUFGSixFQUdJLENBSEosRUFJSSxLQUFLLElBQUwsQ0FMUixFQURnRjs7QUFTaEYsMkJBQUssdUJBQUwsQ0FBNkIsT0FBN0IsRUFBc0MsS0FBSyxXQUFMLEVBQWtCLElBQXhELEVBQThELElBQTlELEVBVGdGO2lCQUFuQixDQUFqRSxDQUQ4QzthQUFsRDs7O0FBOUJnQixnQkE2Q1osS0FBSyxJQUFMLEVBQVc7QUFDWCxxQkFBSyxZQUFMLENBQWtCO0FBQ2QsMEJBQU0sYUFBTjtBQUNBLDhCQUFVLEtBQUssSUFBTDtpQkFGZCxFQUdHLFVBQUMsT0FBRCxFQUFhO0FBQ1osMkJBQUssWUFBTCxHQUFvQixRQUFwQixDQUE2QixPQUE3QixFQUNJLG9DQUNJLE9BREosRUFFSSxJQUZKLEVBR0ksS0FBSyxNQUFMLENBQVksTUFBWixFQUNBLElBSkosQ0FESixFQURZO2lCQUFiLENBSEgsQ0FEVzthQUFmOzs7QUE3Q2dCLGdCQTZEWixLQUFLLElBQUwsQ0FBVSxJQUFWLEtBQW1CLG1CQUFPLGNBQVAsRUFBdUI7QUFDMUMscUJBQUssYUFBTCxDQUFtQixLQUFLLElBQUwsQ0FBbkIsQ0FEMEM7YUFBOUMsTUFFTztBQUNILHFCQUFLLEtBQUwsQ0FBVyxLQUFLLElBQUwsQ0FBWCxDQURHO2FBRlA7O0FBTUEsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFuRWdCOzs7O21DQXNFVCxNQUFNO0FBQ2IsZ0JBQUksS0FBSyxJQUFMLEtBQWMsbUJBQU8sZ0JBQVAsRUFBeUI7QUFDdkMscUJBQUssWUFBTCxHQUFvQixRQUFwQixDQUE2QixLQUFLLEVBQUwsRUFDckIsMkJBQ0ksbUJBQVMsU0FBVCxFQUNBLEtBQUssRUFBTCxFQUNBLElBSEosRUFJSSxJQUpKLEVBS0ksSUFMSixFQU1JLElBTkosQ0FEUixFQUR1QzthQUEzQzs7O0FBRGEsZ0JBY2IsQ0FBSyxLQUFMLENBQVcsS0FBSyxVQUFMLENBQVgsQ0FkYTs7QUFnQmIsaUJBQUssWUFBTCxDQUFrQixnQkFBbEIsQ0FBbUMsSUFBbkMsRUFoQmE7O0FBa0JiLGdCQUFJLEtBQUssRUFBTCxFQUFTO0FBQ1QscUJBQUssWUFBTCxHQUFvQixRQUFwQixDQUE2QixLQUFLLEVBQUwsRUFDckIsMkJBQ0ksbUJBQVMsU0FBVCxFQUNBLEtBQUssRUFBTCxFQUNBLElBSEosQ0FEUixFQURTO2FBQWI7QUFRQSxpQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0ExQmE7O0FBNEJiLGlCQUFLLEtBQUwsQ0FBVyxJQUFYLEVBNUJhOzs7O3NDQStCSCxNQUFNO0FBQ2hCLGdCQUFJLFFBQUosRUFBYyxrQkFBZCxDQURnQjtBQUVoQixnQkFBSSxLQUFLLFFBQUwsRUFBZTtBQUNmLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLEdBQUwsQ0FBWCxDQURlO2FBQW5COztBQUlBLGlDQUFxQixLQUFLLElBQUwsS0FBYyxtQkFBTyxnQkFBUCxDQU5uQjtBQU9oQixnQkFBSSxrQkFBSixFQUF3QjtBQUNwQiwyQkFBVyxLQUFLLHlCQUFMLENBQStCLElBQS9CLENBQVgsQ0FEb0I7YUFBeEI7QUFHQSxpQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FWZ0I7QUFXaEIsZ0JBQUksa0JBQUosRUFBd0I7QUFDcEIscUJBQUssd0JBQUwsQ0FBOEIsUUFBOUIsRUFEb0I7YUFBeEI7Ozs7bUNBS08sTUFBTTs7O0FBQ2IsZ0JBQUksS0FBSyxJQUFMLENBQVUsSUFBVixLQUFtQixtQkFBTyxtQkFBUCxJQUE4QixLQUFLLElBQUwsQ0FBVSxJQUFWLEtBQW1CLEtBQW5CLEVBQTBCO0FBQzNFLHFCQUFLLG1CQUFMLENBQXlCLEtBQUssS0FBTCxFQUFZLElBQXJDLEVBRDJFO0FBRTNFLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLEtBQUwsQ0FBWCxDQUYyRTtBQUczRSxxQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FIMkU7O0FBSzNFLHFCQUFLLHlCQUFMLENBQStCLElBQS9CLEVBTDJFO0FBTTNFLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLElBQUwsQ0FBWCxDQU4yRTtBQU8zRSxxQkFBSyxLQUFMLENBQVcsSUFBWCxFQVAyRTthQUEvRSxNQVFPO0FBQ0gsb0JBQUksS0FBSyxJQUFMLENBQVUsSUFBVixLQUFtQixtQkFBTyxtQkFBUCxFQUE0QjtBQUMvQyx5QkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FEK0M7QUFFL0MseUJBQUssWUFBTCxDQUFrQixLQUFLLElBQUwsQ0FBVSxZQUFWLENBQXVCLENBQXZCLEVBQTBCLEVBQTFCLEVBQThCLFVBQUMsT0FBRCxFQUFhO0FBQ3pELCtCQUFLLFlBQUwsR0FBb0IsYUFBcEIsQ0FBa0MsT0FBbEMsRUFBMkMsb0JBQVUsS0FBVixFQUFpQixLQUFLLEtBQUwsRUFBWSxJQUF4RSxFQUE4RSxJQUE5RSxFQUFvRixJQUFwRixFQUR5RDtxQkFBYixDQUFoRCxDQUYrQztpQkFBbkQsTUFLTztBQUNILHlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxJQUFMLEVBQVcsRUFBQyx1QkFBdUIsSUFBdkIsRUFBOUIsRUFBNEQsVUFBQyxPQUFELEVBQVUsSUFBVixFQUFtQjtBQUMzRSw0QkFBSSxzQkFBc0IsSUFBdEIsQ0FEdUU7QUFFM0UsNEJBQUksQ0FBQyxPQUFLLFlBQUwsR0FBb0IsUUFBcEIsRUFBOEI7QUFDL0Isa0RBQXNCO0FBQ2xCLHlDQUFTLE9BQVQ7QUFDQSxzQ0FBTSxJQUFOOzZCQUZKLENBRCtCO3lCQUFuQztBQU1BLCtCQUFLLHVCQUFMLENBQTZCLE9BQTdCLEVBQXNDLEtBQUssV0FBTCxFQUFrQixtQkFBeEQsRUFBNkUsS0FBN0UsRUFSMkU7QUFTM0UsK0JBQUssWUFBTCxHQUFvQixhQUFwQixDQUFrQyxPQUFsQyxFQUEyQyxvQkFBVSxLQUFWLEVBQWlCLEtBQUssS0FBTCxFQUFZLG1CQUF4RSxFQUE2RixJQUE3RixFQUFtRyxLQUFuRyxFQVQyRTtxQkFBbkIsQ0FBNUQsQ0FERztpQkFMUDtBQWtCQSxxQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FuQkc7QUFvQkgscUJBQUssS0FBTCxDQUFXLEtBQUssSUFBTCxDQUFYLENBcEJHO2FBUlA7Ozs7aURBZ0NxQixxQkFBcUIsTUFBTSxNQUFNLE9BQU8sU0FBUzs7OztBQUV0RSxnQkFBSSxJQUFKLEVBQVUsSUFBVixDQUZzRTs7QUFJdEUsbUJBQU8sS0FBSyxZQUFMLENBQWtCLEtBQWxCLENBQVAsQ0FKc0U7QUFLdEUsbUJBQU8sS0FBSyxJQUFMLENBTCtEO0FBTXRFLGlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxFQUFMLEVBQVMsRUFBQyx1QkFBdUIsQ0FBQyxPQUFELEVBQW5ELEVBQThELFVBQUMsT0FBRCxFQUFVLElBQVYsRUFBbUI7QUFDN0Usb0NBQW9CLFFBQXBCLENBQTZCLE9BQTdCLEVBQ0ksMkJBQ0ksSUFESixFQUVJLE9BRkosRUFHSSxJQUhKLEVBSUksSUFKSixFQUtJLEtBTEosRUFNSSxLQUFLLElBQUwsQ0FQUixFQUQ2RTs7QUFXN0Usb0JBQUksQ0FBQyxPQUFELEVBQVU7QUFDViwyQkFBSyx1QkFBTCxDQUE2QixPQUE3QixFQUFzQyxLQUFLLFdBQUwsRUFBa0IsSUFBeEQsRUFBOEQsSUFBOUQsRUFEVTtpQkFBZDtBQUdBLG9CQUFJLElBQUosRUFBVTtBQUNOLDJCQUFLLFlBQUwsR0FBb0IsYUFBcEIsQ0FBa0MsT0FBbEMsRUFBMkMsb0JBQVUsS0FBVixFQUFpQixJQUE1RCxFQUFrRSxJQUFsRSxFQUF3RSxDQUFDLEtBQUssUUFBTCxFQUFlLElBQXhGLEVBRE07aUJBQVY7YUFkMEQsQ0FBOUQsQ0FOc0U7Ozs7NkNBMEJyRCxNQUFNOzs7QUFDdkIsZ0JBQUkseUJBQWUsU0FBZixDQUF5QixLQUFLLElBQUwsQ0FBN0IsRUFBeUM7QUFDckMsb0JBQUksS0FBSyxRQUFMLEtBQWtCLEdBQWxCLEVBQXVCO0FBQ3ZCLHlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxJQUFMLEVBQVcsRUFBQyx1QkFBdUIsSUFBdkIsRUFBOUIsRUFBNEQsVUFBQyxPQUFELEVBQVUsSUFBVixFQUFtQjtBQUMzRSw0QkFBSSxzQkFBc0IsSUFBdEIsQ0FEdUU7QUFFM0UsNEJBQUksQ0FBQyxPQUFLLFlBQUwsR0FBb0IsUUFBcEIsRUFBOEI7QUFDL0Isa0RBQXNCO0FBQ2xCLHlDQUFTLE9BQVQ7QUFDQSxzQ0FBTSxJQUFOOzZCQUZKLENBRCtCO3lCQUFuQztBQU1BLCtCQUFLLHVCQUFMLENBQTZCLE9BQTdCLEVBQXNDLEtBQUssV0FBTCxFQUFrQixtQkFBeEQsRUFBNkUsS0FBN0UsRUFSMkU7QUFTM0UsK0JBQUssWUFBTCxHQUFvQixhQUFwQixDQUFrQyxPQUFsQyxFQUEyQyxvQkFBVSxLQUFWLEVBQWlCLEtBQUssS0FBTCxFQUFZLG1CQUF4RSxFQUE2RixDQUFDLEtBQUssUUFBTCxFQUFlLEtBQTdHLEVBVDJFO3FCQUFuQixDQUE1RCxDQUR1QjtpQkFBM0IsTUFZTztBQUNILHlCQUFLLFlBQUwsR0FBb0IsYUFBcEIsQ0FBa0MsS0FBSyxJQUFMLEVBQVcsb0JBQVUsRUFBVixFQUFjLEtBQUssS0FBTCxDQUEzRCxDQURHO2lCQVpQO2FBREosTUFnQk87QUFDSCxxQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FERzthQWhCUDtBQW1CQSxpQkFBSyxLQUFMLENBQVcsS0FBSyxLQUFMLENBQVgsQ0FwQnVCOzs7O29DQXVCZixNQUFNOzs7QUFDZCxpQkFBSyxZQUFMLENBQWtCLGdCQUFsQixDQUFtQyxJQUFuQyxFQURjOztBQUdkLGlCQUFLLFlBQUwsQ0FBa0IsS0FBSyxLQUFMLEVBQVksRUFBQyx1QkFBdUIsSUFBdkIsRUFBL0IsRUFBNkQsVUFBQyxPQUFELEVBQVUsSUFBVixFQUFtQjtBQUM1RSx1QkFBSyxZQUFMLEdBQW9CLFFBQXBCLENBQTZCLE9BQTdCLEVBQ0ksMkJBQ0ksbUJBQVMsV0FBVCxFQUNBLEtBQUssS0FBTCxFQUNBLElBSEosRUFJSSxJQUpKLEVBS0ksSUFMSixFQU1JLElBTkosQ0FESixFQUQ0RTtBQVU1RSx1QkFBSyx1QkFBTCxDQUE2QixPQUE3QixFQUFzQyxLQUFLLFdBQUwsRUFBa0IsSUFBeEQsRUFBOEQsSUFBOUQsRUFWNEU7YUFBbkIsQ0FBN0QsQ0FIYztBQWVkLGlCQUFLLEtBQUwsQ0FBVyxLQUFLLElBQUwsQ0FBWCxDQWZjOztBQWlCZCxpQkFBSyxLQUFMLENBQVcsSUFBWCxFQWpCYzs7OztnQ0FvQlYsTUFBTTtBQUNWLGlCQUFLLFlBQUwsQ0FBa0IsaUJBQWxCLENBQW9DLElBQXBDLEVBRFU7O0FBR1YsZ0JBQUksS0FBSyxZQUFMLENBQWtCLGVBQWxCLEVBQUosRUFBeUM7O0FBRXJDLHFCQUFLLFlBQUwsR0FBb0IsUUFBcEIsR0FBK0IsS0FBL0IsQ0FGcUM7QUFHckMscUJBQUssWUFBTCxDQUFrQixtQkFBbEIsQ0FBc0MsSUFBdEMsRUFBNEMsS0FBNUMsRUFIcUM7YUFBekM7O0FBTUEsZ0JBQUksS0FBSyxZQUFMLENBQWtCLE9BQWxCLE1BQStCLEtBQUssWUFBTCxDQUFrQixRQUFsQixFQUEvQixFQUE2RDtBQUM3RCxxQkFBSyxZQUFMLENBQWtCLGlCQUFsQixDQUFvQyxJQUFwQyxFQUQ2RDthQUFqRTs7QUFJQSxnQkFBSSxLQUFLLFlBQUwsQ0FBa0IscUJBQWxCLE1BQTZDLEtBQUssWUFBTCxDQUFrQixlQUFsQixFQUE3QyxFQUFrRjtBQUNsRixxQkFBSyxZQUFMLEdBQW9CLFFBQXBCLEdBQStCLElBQS9CLENBRGtGO2FBQXRGOztBQUlBLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFqQlU7QUFrQlYsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFsQlU7Ozs7bUNBcUJILE1BQU07QUFDYixpQkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLElBQWxDLEVBRGE7Ozs7eUNBSUEsTUFBTTtBQUNuQixnQkFBSSx5QkFBZSxTQUFmLENBQXlCLEtBQUssUUFBTCxDQUE3QixFQUE2QztBQUN6QyxxQkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLEtBQUssUUFBTCxFQUFlLG9CQUFVLEVBQVYsRUFBYyxJQUEvRCxFQUR5QzthQUE3QyxNQUVPO0FBQ0gscUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURHO2FBRlA7Ozs7eUNBT2EsTUFBTTtBQUNuQixpQkFBSyxLQUFMLENBQVcsS0FBSyxNQUFMLENBQVgsQ0FEbUI7QUFFbkIsZ0JBQUksS0FBSyxRQUFMLEVBQWU7QUFDZixxQkFBSyxLQUFMLENBQVcsS0FBSyxRQUFMLENBQVgsQ0FEZTthQUFuQjs7OztpQ0FLSyxNQUFNO0FBQ1gsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURXOzs7O3lDQUlFLE1BQU07QUFDbkIsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURtQjs7Ozt5Q0FJTjs7OzRDQUVHOzs7eUNBRUgsTUFBTTtBQUNuQixpQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FEbUI7Ozs7cUNBSVYsTUFBTTs7Ozs7QUFLZixnQkFBSSxLQUFLLElBQUwsSUFBYSxLQUFLLElBQUwsQ0FBVSxJQUFWLEtBQW1CLG1CQUFPLG1CQUFQLElBQThCLEtBQUssSUFBTCxDQUFVLElBQVYsS0FBbUIsS0FBbkIsRUFBMEI7QUFDeEYscUJBQUssWUFBTCxDQUFrQixjQUFsQixDQUFpQyxJQUFqQyxFQUR3RjthQUE1Rjs7QUFJQSxpQkFBSyxhQUFMLENBQW1CLElBQW5CLEVBVGU7O0FBV2YsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFYZTs7Ozt3Q0FjSCxNQUFNO0FBQ2xCLGlCQUFLLFVBQUwsQ0FBZ0IsSUFBaEIsRUFEa0I7Ozs7eUNBSUwsTUFBTTtBQUNuQixpQkFBSyxVQUFMLENBQWdCLElBQWhCLEVBRG1COzs7O3VDQUlSLE1BQU07O0FBRWpCLGdCQUFJLENBQUMsS0FBSyxZQUFMLENBQWtCLFlBQWxCLEVBQUQsSUFBcUMsS0FBSyxNQUFMLENBQVksSUFBWixLQUFxQixtQkFBTyxVQUFQLElBQXFCLEtBQUssTUFBTCxDQUFZLElBQVosS0FBcUIsTUFBckIsRUFBNkI7OztBQUc1RyxxQkFBSyxZQUFMLEdBQW9CLGFBQXBCLENBQWtDLFlBQWxDLEdBSDRHO2FBQWhIO0FBS0EsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQVBpQjs7Ozt1Q0FVTixNQUFNO0FBQ2pCLGdCQUFJLEtBQUssWUFBTCxDQUFrQixPQUFsQixFQUFKLEVBQWlDO0FBQzdCLHFCQUFLLFlBQUwsQ0FBa0IsZ0JBQWxCLENBQW1DLElBQW5DLEVBRDZCO2FBQWpDOztBQUlBLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFMaUI7O0FBT2pCLGlCQUFLLEtBQUwsQ0FBVyxJQUFYLEVBUGlCOzs7O3lDQVVKO0FBQ2IsaUJBQUssWUFBTCxHQUFvQixhQUFwQixDQUFrQyxZQUFsQyxHQURhOzs7O3NDQUlILE1BQU07QUFDaEIsaUJBQUssS0FBTCxDQUFXLEtBQUssTUFBTCxDQUFYOztBQURnQixnQkFHaEIsQ0FBSyxZQUFMLENBQWtCLGVBQWxCLENBQWtDLElBQWxDLEVBSGdCOztBQUtoQixpQkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FMZ0I7O0FBT2hCLGlCQUFLLEtBQUwsQ0FBVyxJQUFYLEVBUGdCOzs7OzRDQVVBLE1BQU07QUFDdEIsZ0JBQUksbUJBQUosRUFBeUIsQ0FBekIsRUFBNEIsRUFBNUIsRUFBZ0MsSUFBaEMsQ0FEc0I7QUFFdEIsa0NBQXNCLElBQUMsQ0FBSyxJQUFMLEtBQWMsS0FBZCxHQUF1QixLQUFLLFlBQUwsR0FBb0IsYUFBcEIsR0FBb0MsS0FBSyxZQUFMLEVBQTVELENBRkE7QUFHdEIsaUJBQUssSUFBSSxDQUFKLEVBQU8sS0FBSyxLQUFLLFlBQUwsQ0FBa0IsTUFBbEIsRUFBMEIsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDcEQsdUJBQU8sS0FBSyxZQUFMLENBQWtCLENBQWxCLENBQVAsQ0FEb0Q7QUFFcEQscUJBQUssd0JBQUwsQ0FBOEIsbUJBQTlCLEVBQW1ELG1CQUFTLFFBQVQsRUFBbUIsSUFBdEUsRUFBNEUsQ0FBNUUsRUFGb0Q7QUFHcEQsb0JBQUksS0FBSyxJQUFMLEVBQVc7QUFDWCx5QkFBSyxLQUFMLENBQVcsS0FBSyxJQUFMLENBQVgsQ0FEVztpQkFBZjthQUhKOzs7Ozs7O3dDQVVZLE1BQU07QUFDbEIsZ0JBQUksQ0FBSixFQUFPLEVBQVAsQ0FEa0I7O0FBR2xCLGlCQUFLLEtBQUwsQ0FBVyxLQUFLLFlBQUwsQ0FBWCxDQUhrQjs7QUFLbEIsZ0JBQUksS0FBSyxZQUFMLENBQWtCLE9BQWxCLEVBQUosRUFBaUM7QUFDN0IscUJBQUssWUFBTCxDQUFrQixpQkFBbEIsQ0FBb0MsSUFBcEMsRUFENkI7YUFBakM7O0FBSUEsaUJBQUssSUFBSSxDQUFKLEVBQU8sS0FBSyxLQUFLLEtBQUwsQ0FBVyxNQUFYLEVBQW1CLElBQUksRUFBSixFQUFRLEVBQUUsQ0FBRixFQUFLO0FBQzdDLHFCQUFLLEtBQUwsQ0FBVyxLQUFLLEtBQUwsQ0FBVyxDQUFYLENBQVgsRUFENkM7YUFBakQ7O0FBSUEsaUJBQUssS0FBTCxDQUFXLElBQVgsRUFia0I7Ozs7NENBZ0JGLE1BQU07QUFDdEIsaUJBQUssYUFBTCxDQUFtQixJQUFuQixFQURzQjs7OzsyQ0FJUCxNQUFNO0FBQ3JCLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFEcUI7Ozs7dUNBSVYsTUFBTTtBQUNqQixpQkFBSyxVQUFMLENBQWdCLElBQWhCLEVBRGlCOzs7O3VDQUlOLE1BQU07QUFDakIsaUJBQUssVUFBTCxDQUFnQixJQUFoQixFQURpQjs7OztnREFJRyxNQUFNO0FBQzFCLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFEMEI7Ozs7MENBSVosTUFBTTtBQUNwQixnQkFBSSxRQUFKLENBRG9COztBQUdwQixrQ0FBTyxLQUFLLFlBQUwsQ0FBa0IsT0FBbEIsTUFBK0IsS0FBSyxZQUFMLENBQWtCLFFBQWxCLEVBQS9CLEVBQTZELGlGQUFwRSxFQUhvQjs7QUFLcEIsdUJBQVcsSUFBSSxRQUFKLENBQWEsSUFBYixFQUFtQixJQUFuQixDQUFYLENBTG9CO0FBTXBCLHFCQUFTLEtBQVQsQ0FBZSxJQUFmLEVBTm9COzs7OytDQVNELE1BQU07QUFDekIsZ0JBQUksS0FBSyxNQUFMLEVBQWE7QUFDYix1QkFEYTthQUFqQjtBQUdBLGdCQUFJLEtBQUssV0FBTCxFQUFrQjtBQUNsQixxQkFBSyxLQUFMLENBQVcsS0FBSyxXQUFMLENBQVgsQ0FEa0I7QUFFbEIsdUJBRmtCO2FBQXRCOztBQUtBLGlCQUFLLGFBQUwsQ0FBbUIsSUFBbkIsRUFUeUI7Ozs7MENBWVgsTUFBTTtBQUNwQixpQkFBSyxzQkFBTCxDQUE0QixJQUE1QixFQURvQjs7OzsrQ0FJRCxNQUFNO0FBQ3pCLGlCQUFLLHNCQUFMLENBQTRCLElBQTVCLEVBRHlCOzs7O3dDQUliLE1BQU07QUFDbEIsZ0JBQUksUUFBUyxLQUFLLEVBQUwsSUFBVyxLQUFLLEtBQUwsQ0FETjtBQUVsQixpQkFBSyxLQUFMLENBQVcsS0FBWCxFQUZrQjs7OztXQS9kTDtFQUFtQixvQkFBVSxPQUFWOzs7O2tCQUFuQiIsImZpbGUiOiJyZWZlcmVuY2VyLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuaW1wb3J0IHsgU3ludGF4IH0gZnJvbSAnZXN0cmF2ZXJzZSc7XG5pbXBvcnQgZXNyZWN1cnNlIGZyb20gJ2VzcmVjdXJzZSc7XG5pbXBvcnQgUmVmZXJlbmNlIGZyb20gJy4vcmVmZXJlbmNlJztcbmltcG9ydCBWYXJpYWJsZSBmcm9tICcuL3ZhcmlhYmxlJztcbmltcG9ydCBQYXR0ZXJuVmlzaXRvciBmcm9tICcuL3BhdHRlcm4tdmlzaXRvcic7XG5pbXBvcnQgeyBQYXJhbWV0ZXJEZWZpbml0aW9uLCBEZWZpbml0aW9uIH0gZnJvbSAnLi9kZWZpbml0aW9uJztcbmltcG9ydCBhc3NlcnQgZnJvbSAnYXNzZXJ0JztcblxuZnVuY3Rpb24gdHJhdmVyc2VJZGVudGlmaWVySW5QYXR0ZXJuKHJvb3RQYXR0ZXJuLCByZWZlcmVuY2VyLCBjYWxsYmFjaykge1xuICAgIC8vIENhbGwgdGhlIGNhbGxiYWNrIGF0IGxlZnQgaGFuZCBpZGVudGlmaWVyIG5vZGVzLCBhbmQgQ29sbGVjdCByaWdodCBoYW5kIG5vZGVzLlxuICAgIHZhciB2aXNpdG9yID0gbmV3IFBhdHRlcm5WaXNpdG9yKHJvb3RQYXR0ZXJuLCBjYWxsYmFjayk7XG4gICAgdmlzaXRvci52aXNpdChyb290UGF0dGVybik7XG5cbiAgICAvLyBQcm9jZXNzIHRoZSByaWdodCBoYW5kIG5vZGVzIHJlY3Vyc2l2ZWx5LlxuICAgIGlmIChyZWZlcmVuY2VyICE9IG51bGwpIHtcbiAgICAgICAgdmlzaXRvci5yaWdodEhhbmROb2Rlcy5mb3JFYWNoKHJlZmVyZW5jZXIudmlzaXQsIHJlZmVyZW5jZXIpO1xuICAgIH1cbn1cblxuLy8gSW1wb3J0aW5nIEltcG9ydERlY2xhcmF0aW9uLlxuLy8gaHR0cDovL3Blb3BsZS5tb3ppbGxhLm9yZy9+am9yZW5kb3JmZi9lczYtZHJhZnQuaHRtbCNzZWMtbW9kdWxlZGVjbGFyYXRpb25pbnN0YW50aWF0aW9uXG4vLyBodHRwczovL2dpdGh1Yi5jb20vZXN0cmVlL2VzdHJlZS9ibG9iL21hc3Rlci9lczYubWQjaW1wb3J0ZGVjbGFyYXRpb25cbi8vIEZJWE1FOiBOb3csIHdlIGRvbid0IGNyZWF0ZSBtb2R1bGUgZW52aXJvbm1lbnQsIGJlY2F1c2UgdGhlIGNvbnRleHQgaXNcbi8vIGltcGxlbWVudGF0aW9uIGRlcGVuZGVudC5cblxuY2xhc3MgSW1wb3J0ZXIgZXh0ZW5kcyBlc3JlY3Vyc2UuVmlzaXRvciB7XG4gICAgY29uc3RydWN0b3IoZGVjbGFyYXRpb24sIHJlZmVyZW5jZXIpIHtcbiAgICAgICAgc3VwZXIoKTtcbiAgICAgICAgdGhpcy5kZWNsYXJhdGlvbiA9IGRlY2xhcmF0aW9uO1xuICAgICAgICB0aGlzLnJlZmVyZW5jZXIgPSByZWZlcmVuY2VyO1xuICAgIH1cblxuICAgIHZpc2l0SW1wb3J0KGlkLCBzcGVjaWZpZXIpIHtcbiAgICAgICAgdGhpcy5yZWZlcmVuY2VyLnZpc2l0UGF0dGVybihpZCwgKHBhdHRlcm4pID0+IHtcbiAgICAgICAgICAgIHRoaXMucmVmZXJlbmNlci5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgIG5ldyBEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5JbXBvcnRCaW5kaW5nLFxuICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBzcGVjaWZpZXIsXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGVjbGFyYXRpb24sXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICAgICAgKSk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIEltcG9ydE5hbWVzcGFjZVNwZWNpZmllcihub2RlKSB7XG4gICAgICAgIGxldCBsb2NhbCA9IChub2RlLmxvY2FsIHx8IG5vZGUuaWQpO1xuICAgICAgICBpZiAobG9jYWwpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRJbXBvcnQobG9jYWwsIG5vZGUpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgSW1wb3J0RGVmYXVsdFNwZWNpZmllcihub2RlKSB7XG4gICAgICAgIGxldCBsb2NhbCA9IChub2RlLmxvY2FsIHx8IG5vZGUuaWQpO1xuICAgICAgICB0aGlzLnZpc2l0SW1wb3J0KGxvY2FsLCBub2RlKTtcbiAgICB9XG5cbiAgICBJbXBvcnRTcGVjaWZpZXIobm9kZSkge1xuICAgICAgICBsZXQgbG9jYWwgPSAobm9kZS5sb2NhbCB8fCBub2RlLmlkKTtcbiAgICAgICAgaWYgKG5vZGUubmFtZSkge1xuICAgICAgICAgICAgdGhpcy52aXNpdEltcG9ydChub2RlLm5hbWUsIG5vZGUpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpcy52aXNpdEltcG9ydChsb2NhbCwgbm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG59XG5cbi8vIFJlZmVyZW5jaW5nIHZhcmlhYmxlcyBhbmQgY3JlYXRpbmcgYmluZGluZ3MuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBSZWZlcmVuY2VyIGV4dGVuZHMgZXNyZWN1cnNlLlZpc2l0b3Ige1xuICAgIGNvbnN0cnVjdG9yKHNjb3BlTWFuYWdlcikge1xuICAgICAgICBzdXBlcigpO1xuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlciA9IHNjb3BlTWFuYWdlcjtcbiAgICAgICAgdGhpcy5wYXJlbnQgPSBudWxsO1xuICAgICAgICB0aGlzLmlzSW5uZXJNZXRob2REZWZpbml0aW9uID0gZmFsc2U7XG4gICAgfVxuXG4gICAgY3VycmVudFNjb3BlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5zY29wZU1hbmFnZXIuX19jdXJyZW50U2NvcGU7XG4gICAgfVxuXG4gICAgY2xvc2Uobm9kZSkge1xuICAgICAgICB3aGlsZSAodGhpcy5jdXJyZW50U2NvcGUoKSAmJiBub2RlID09PSB0aGlzLmN1cnJlbnRTY29wZSgpLmJsb2NrKSB7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX2N1cnJlbnRTY29wZSA9IHRoaXMuY3VycmVudFNjb3BlKCkuX19jbG9zZSh0aGlzLnNjb3BlTWFuYWdlcik7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBwdXNoSW5uZXJNZXRob2REZWZpbml0aW9uKGlzSW5uZXJNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgIHZhciBwcmV2aW91cyA9IHRoaXMuaXNJbm5lck1ldGhvZERlZmluaXRpb247XG4gICAgICAgIHRoaXMuaXNJbm5lck1ldGhvZERlZmluaXRpb24gPSBpc0lubmVyTWV0aG9kRGVmaW5pdGlvbjtcbiAgICAgICAgcmV0dXJuIHByZXZpb3VzO1xuICAgIH1cblxuICAgIHBvcElubmVyTWV0aG9kRGVmaW5pdGlvbihpc0lubmVyTWV0aG9kRGVmaW5pdGlvbikge1xuICAgICAgICB0aGlzLmlzSW5uZXJNZXRob2REZWZpbml0aW9uID0gaXNJbm5lck1ldGhvZERlZmluaXRpb247XG4gICAgfVxuXG4gICAgbWF0ZXJpYWxpemVURFpTY29wZShub2RlLCBpdGVyYXRpb25Ob2RlKSB7XG4gICAgICAgIC8vIGh0dHA6Ly9wZW9wbGUubW96aWxsYS5vcmcvfmpvcmVuZG9yZmYvZXM2LWRyYWZ0Lmh0bWwjc2VjLXJ1bnRpbWUtc2VtYW50aWNzLWZvcmluLWRpdi1vZmV4cHJlc3Npb25ldmFsdWF0aW9uLWFic3RyYWN0LW9wZXJhdGlvblxuICAgICAgICAvLyBURFogc2NvcGUgaGlkZXMgdGhlIGRlY2xhcmF0aW9uJ3MgbmFtZXMuXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdFREWlNjb3BlKG5vZGUsIGl0ZXJhdGlvbk5vZGUpO1xuICAgICAgICB0aGlzLnZpc2l0VmFyaWFibGVEZWNsYXJhdGlvbih0aGlzLmN1cnJlbnRTY29wZSgpLCBWYXJpYWJsZS5URFosIGl0ZXJhdGlvbk5vZGUubGVmdCwgMCwgdHJ1ZSk7XG4gICAgfVxuXG4gICAgbWF0ZXJpYWxpemVJdGVyYXRpb25TY29wZShub2RlKSB7XG4gICAgICAgIC8vIEdlbmVyYXRlIGl0ZXJhdGlvbiBzY29wZSBmb3IgdXBwZXIgRm9ySW4vRm9yT2YgU3RhdGVtZW50cy5cbiAgICAgICAgdmFyIGxldE9yQ29uc3REZWNsO1xuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RGb3JTY29wZShub2RlKTtcbiAgICAgICAgbGV0T3JDb25zdERlY2wgPSBub2RlLmxlZnQ7XG4gICAgICAgIHRoaXMudmlzaXRWYXJpYWJsZURlY2xhcmF0aW9uKHRoaXMuY3VycmVudFNjb3BlKCksIFZhcmlhYmxlLlZhcmlhYmxlLCBsZXRPckNvbnN0RGVjbCwgMCk7XG4gICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKGxldE9yQ29uc3REZWNsLmRlY2xhcmF0aW9uc1swXS5pZCwgKHBhdHRlcm4pID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUsIHRydWUpO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICByZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBhc3NpZ25tZW50cywgbWF5YmVJbXBsaWNpdEdsb2JhbCwgaW5pdCkge1xuICAgICAgICBjb25zdCBzY29wZSA9IHRoaXMuY3VycmVudFNjb3BlKCk7XG4gICAgICAgIGFzc2lnbm1lbnRzLmZvckVhY2goYXNzaWdubWVudCA9PiB7XG4gICAgICAgICAgICBzY29wZS5fX3JlZmVyZW5jaW5nKFxuICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgUmVmZXJlbmNlLldSSVRFLFxuICAgICAgICAgICAgICAgIGFzc2lnbm1lbnQucmlnaHQsXG4gICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCxcbiAgICAgICAgICAgICAgICBwYXR0ZXJuICE9PSBhc3NpZ25tZW50LmxlZnQsXG4gICAgICAgICAgICAgICAgaW5pdCk7XG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHZpc2l0UGF0dGVybihub2RlLCBvcHRpb25zLCBjYWxsYmFjaykge1xuICAgICAgICBpZiAodHlwZW9mIG9wdGlvbnMgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgIGNhbGxiYWNrID0gb3B0aW9ucztcbiAgICAgICAgICAgIG9wdGlvbnMgPSB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiBmYWxzZX1cbiAgICAgICAgfVxuICAgICAgICB0cmF2ZXJzZUlkZW50aWZpZXJJblBhdHRlcm4oXG4gICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgb3B0aW9ucy5wcm9jZXNzUmlnaHRIYW5kTm9kZXMgPyB0aGlzIDogbnVsbCxcbiAgICAgICAgICAgIGNhbGxiYWNrKTtcbiAgICB9XG5cbiAgICB2aXNpdEZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgdmFyIGksIGl6O1xuICAgICAgICAvLyBGdW5jdGlvbkRlY2xhcmF0aW9uIG5hbWUgaXMgZGVmaW5lZCBpbiB1cHBlciBzY29wZVxuICAgICAgICAvLyBOT1RFOiBOb3QgcmVmZXJyaW5nIHZhcmlhYmxlU2NvcGUuIEl0IGlzIGludGVuZGVkLlxuICAgICAgICAvLyBTaW5jZVxuICAgICAgICAvLyAgaW4gRVM1LCBGdW5jdGlvbkRlY2xhcmF0aW9uIHNob3VsZCBiZSBpbiBGdW5jdGlvbkJvZHkuXG4gICAgICAgIC8vICBpbiBFUzYsIEZ1bmN0aW9uRGVjbGFyYXRpb24gc2hvdWxkIGJlIGJsb2NrIHNjb3BlZC5cbiAgICAgICAgaWYgKG5vZGUudHlwZSA9PT0gU3ludGF4LkZ1bmN0aW9uRGVjbGFyYXRpb24pIHtcbiAgICAgICAgICAgIC8vIGlkIGlzIGRlZmluZWQgaW4gdXBwZXIgc2NvcGVcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5GdW5jdGlvbk5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbFxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIEZ1bmN0aW9uRXhwcmVzc2lvbiB3aXRoIG5hbWUgY3JlYXRlcyBpdHMgc3BlY2lhbCBzY29wZTtcbiAgICAgICAgLy8gRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlLlxuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguRnVuY3Rpb25FeHByZXNzaW9uICYmIG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZShub2RlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8vIENvbnNpZGVyIHRoaXMgZnVuY3Rpb24gaXMgaW4gdGhlIE1ldGhvZERlZmluaXRpb24uXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uU2NvcGUobm9kZSwgdGhpcy5pc0lubmVyTWV0aG9kRGVmaW5pdGlvbik7XG5cbiAgICAgICAgLy8gUHJvY2VzcyBwYXJhbWV0ZXIgZGVjbGFyYXRpb25zLlxuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IG5vZGUucGFyYW1zLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUucGFyYW1zW2ldLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmN1cnJlbnRTY29wZSgpLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIG5ldyBQYXJhbWV0ZXJEZWZpbml0aW9uKFxuICAgICAgICAgICAgICAgICAgICAgICAgcGF0dGVybixcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgICAgICBpLFxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mby5yZXN0XG4gICAgICAgICAgICAgICAgICAgICkpO1xuXG4gICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gaWYgdGhlcmUncyBhIHJlc3QgYXJndW1lbnQsIGFkZCB0aGF0XG4gICAgICAgIGlmIChub2RlLnJlc3QpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKHtcbiAgICAgICAgICAgICAgICB0eXBlOiAnUmVzdEVsZW1lbnQnLFxuICAgICAgICAgICAgICAgIGFyZ3VtZW50OiBub2RlLnJlc3RcbiAgICAgICAgICAgIH0sIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICBuZXcgUGFyYW1ldGVyRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5wYXJhbXMubGVuZ3RoLFxuICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gU2tpcCBCbG9ja1N0YXRlbWVudCB0byBwcmV2ZW50IGNyZWF0aW5nIEJsb2NrU3RhdGVtZW50IHNjb3BlLlxuICAgICAgICBpZiAobm9kZS5ib2R5LnR5cGUgPT09IFN5bnRheC5CbG9ja1N0YXRlbWVudCkge1xuICAgICAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUuYm9keSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIHZpc2l0Q2xhc3Mobm9kZSkge1xuICAgICAgICBpZiAobm9kZS50eXBlID09PSBTeW50YXguQ2xhc3NEZWNsYXJhdGlvbikge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX2RlZmluZShub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFZhcmlhYmxlLkNsYXNzTmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUuaWQsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLFxuICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCxcbiAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgICAgICBudWxsXG4gICAgICAgICAgICAgICAgICAgICkpO1xuICAgICAgICB9XG5cbiAgICAgICAgLy8gRklYTUU6IE1heWJlIGNvbnNpZGVyIFREWi5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLnN1cGVyQ2xhc3MpO1xuXG4gICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdENsYXNzU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKG5vZGUuaWQpIHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUobm9kZS5pZCxcbiAgICAgICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZS5DbGFzc05hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZVxuICAgICAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICB2aXNpdFByb3BlcnR5KG5vZGUpIHtcbiAgICAgICAgdmFyIHByZXZpb3VzLCBpc01ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUua2V5KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlzTWV0aG9kRGVmaW5pdGlvbiA9IG5vZGUudHlwZSA9PT0gU3ludGF4Lk1ldGhvZERlZmluaXRpb247XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHByZXZpb3VzID0gdGhpcy5wdXNoSW5uZXJNZXRob2REZWZpbml0aW9uKHRydWUpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXQobm9kZS52YWx1ZSk7XG4gICAgICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgICAgIHRoaXMucG9wSW5uZXJNZXRob2REZWZpbml0aW9uKHByZXZpb3VzKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIHZpc2l0Rm9ySW4obm9kZSkge1xuICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUubGVmdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5tYXRlcmlhbGl6ZVREWlNjb3BlKG5vZGUucmlnaHQsIG5vZGUpO1xuICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZS5yaWdodCk7XG5cbiAgICAgICAgICAgIHRoaXMubWF0ZXJpYWxpemVJdGVyYXRpb25TY29wZShub2RlKTtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5ib2R5KTtcbiAgICAgICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBpZiAobm9kZS5sZWZ0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52aXNpdChub2RlLmxlZnQpO1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdC5kZWNsYXJhdGlvbnNbMF0uaWQsIChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG51bGwsIHRydWUsIHRydWUpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLmxlZnQsIHtwcm9jZXNzUmlnaHRIYW5kTm9kZXM6IHRydWV9LCAocGF0dGVybiwgaW5mbykgPT4ge1xuICAgICAgICAgICAgICAgICAgICB2YXIgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IG51bGw7XG4gICAgICAgICAgICAgICAgICAgIGlmICghdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbWF5YmVJbXBsaWNpdEdsb2JhbCA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXR0ZXJuOiBwYXR0ZXJuLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGU6IG5vZGVcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBtYXliZUltcGxpY2l0R2xvYmFsLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhwYXR0ZXJuLCBSZWZlcmVuY2UuV1JJVEUsIG5vZGUucmlnaHQsIG1heWJlSW1wbGljaXRHbG9iYWwsIHRydWUsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5yaWdodCk7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICB2aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odmFyaWFibGVUYXJnZXRTY29wZSwgdHlwZSwgbm9kZSwgaW5kZXgsIGZyb21URFopIHtcbiAgICAgICAgLy8gSWYgdGhpcyB3YXMgY2FsbGVkIHRvIGluaXRpYWxpemUgYSBURFogc2NvcGUsIHRoaXMgbmVlZHMgdG8gbWFrZSBkZWZpbml0aW9ucywgYnV0IGRvZXNuJ3QgbWFrZSByZWZlcmVuY2VzLlxuICAgICAgICB2YXIgZGVjbCwgaW5pdDtcblxuICAgICAgICBkZWNsID0gbm9kZS5kZWNsYXJhdGlvbnNbaW5kZXhdO1xuICAgICAgICBpbml0ID0gZGVjbC5pbml0O1xuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihkZWNsLmlkLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiAhZnJvbVREWn0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICB2YXJpYWJsZVRhcmdldFNjb3BlLl9fZGVmaW5lKHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgbmV3IERlZmluaXRpb24oXG4gICAgICAgICAgICAgICAgICAgIHR5cGUsXG4gICAgICAgICAgICAgICAgICAgIHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgIGRlY2wsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIGluZGV4LFxuICAgICAgICAgICAgICAgICAgICBub2RlLmtpbmRcbiAgICAgICAgICAgICAgICApKTtcblxuICAgICAgICAgICAgaWYgKCFmcm9tVERaKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZWZlcmVuY2luZ0RlZmF1bHRWYWx1ZShwYXR0ZXJuLCBpbmZvLmFzc2lnbm1lbnRzLCBudWxsLCB0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChpbml0KSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgaW5pdCwgbnVsbCwgIWluZm8udG9wTGV2ZWwsIHRydWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBBc3NpZ25tZW50RXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIGlmIChQYXR0ZXJuVmlzaXRvci5pc1BhdHRlcm4obm9kZS5sZWZ0KSkge1xuICAgICAgICAgICAgaWYgKG5vZGUub3BlcmF0b3IgPT09ICc9Jykge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXRQYXR0ZXJuKG5vZGUubGVmdCwge3Byb2Nlc3NSaWdodEhhbmROb2RlczogdHJ1ZX0sIChwYXR0ZXJuLCBpbmZvKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBtYXliZUltcGxpY2l0R2xvYmFsID0gbnVsbDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLmN1cnJlbnRTY29wZSgpLmlzU3RyaWN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtYXliZUltcGxpY2l0R2xvYmFsID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhdHRlcm46IHBhdHRlcm4sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZTogbm9kZVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlZmVyZW5jaW5nRGVmYXVsdFZhbHVlKHBhdHRlcm4sIGluZm8uYXNzaWdubWVudHMsIG1heWJlSW1wbGljaXRHbG9iYWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKHBhdHRlcm4sIFJlZmVyZW5jZS5XUklURSwgbm9kZS5yaWdodCwgbWF5YmVJbXBsaWNpdEdsb2JhbCwgIWluZm8udG9wTGV2ZWwsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUubGVmdCwgUmVmZXJlbmNlLlJXLCBub2RlLnJpZ2h0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5sZWZ0KTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLnZpc2l0KG5vZGUucmlnaHQpO1xuICAgIH1cblxuICAgIENhdGNoQ2xhdXNlKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Q2F0Y2hTY29wZShub2RlKTtcblxuICAgICAgICB0aGlzLnZpc2l0UGF0dGVybihub2RlLnBhcmFtLCB7cHJvY2Vzc1JpZ2h0SGFuZE5vZGVzOiB0cnVlfSwgKHBhdHRlcm4sIGluZm8pID0+IHtcbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19kZWZpbmUocGF0dGVybixcbiAgICAgICAgICAgICAgICBuZXcgRGVmaW5pdGlvbihcbiAgICAgICAgICAgICAgICAgICAgVmFyaWFibGUuQ2F0Y2hDbGF1c2UsXG4gICAgICAgICAgICAgICAgICAgIG5vZGUucGFyYW0sXG4gICAgICAgICAgICAgICAgICAgIG5vZGUsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGwsXG4gICAgICAgICAgICAgICAgICAgIG51bGxcbiAgICAgICAgICAgICAgICApKTtcbiAgICAgICAgICAgIHRoaXMucmVmZXJlbmNpbmdEZWZhdWx0VmFsdWUocGF0dGVybiwgaW5mby5hc3NpZ25tZW50cywgbnVsbCwgdHJ1ZSk7XG4gICAgICAgIH0pO1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUuYm9keSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBQcm9ncmFtKG5vZGUpIHtcbiAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0R2xvYmFsU2NvcGUobm9kZSk7XG5cbiAgICAgICAgaWYgKHRoaXMuc2NvcGVNYW5hZ2VyLl9faXNOb2RlanNTY29wZSgpKSB7XG4gICAgICAgICAgICAvLyBGb3JjZSBzdHJpY3RuZXNzIG9mIEdsb2JhbFNjb3BlIHRvIGZhbHNlIHdoZW4gdXNpbmcgbm9kZS5qcyBzY29wZS5cbiAgICAgICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuaXNTdHJpY3QgPSBmYWxzZTtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEZ1bmN0aW9uU2NvcGUobm9kZSwgZmFsc2UpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuc2NvcGVNYW5hZ2VyLl9faXNFUzYoKSAmJiB0aGlzLnNjb3BlTWFuYWdlci5pc01vZHVsZSgpKSB7XG4gICAgICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RNb2R1bGVTY29wZShub2RlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5pc1N0cmljdE1vZGVTdXBwb3J0ZWQoKSAmJiB0aGlzLnNjb3BlTWFuYWdlci5pc0ltcGxpZWRTdHJpY3QoKSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5pc1N0cmljdCA9IHRydWU7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgSWRlbnRpZmllcihub2RlKSB7XG4gICAgICAgIHRoaXMuY3VycmVudFNjb3BlKCkuX19yZWZlcmVuY2luZyhub2RlKTtcbiAgICB9XG5cbiAgICBVcGRhdGVFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgaWYgKFBhdHRlcm5WaXNpdG9yLmlzUGF0dGVybihub2RlLmFyZ3VtZW50KSkge1xuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS5fX3JlZmVyZW5jaW5nKG5vZGUuYXJndW1lbnQsIFJlZmVyZW5jZS5SVywgbnVsbCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBNZW1iZXJFeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLm9iamVjdCk7XG4gICAgICAgIGlmIChub2RlLmNvbXB1dGVkKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUucHJvcGVydHkpO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgUHJvcGVydHkobm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0UHJvcGVydHkobm9kZSk7XG4gICAgfVxuXG4gICAgTWV0aG9kRGVmaW5pdGlvbihub2RlKSB7XG4gICAgICAgIHRoaXMudmlzaXRQcm9wZXJ0eShub2RlKTtcbiAgICB9XG5cbiAgICBCcmVha1N0YXRlbWVudCgpIHt9XG5cbiAgICBDb250aW51ZVN0YXRlbWVudCgpIHt9XG5cbiAgICBMYWJlbGVkU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuICAgIH1cblxuICAgIEZvclN0YXRlbWVudChub2RlKSB7XG4gICAgICAgIC8vIENyZWF0ZSBGb3JTdGF0ZW1lbnQgZGVjbGFyYXRpb24uXG4gICAgICAgIC8vIE5PVEU6IEluIEVTNiwgRm9yU3RhdGVtZW50IGR5bmFtaWNhbGx5IGdlbmVyYXRlc1xuICAgICAgICAvLyBwZXIgaXRlcmF0aW9uIGVudmlyb25tZW50LiBIb3dldmVyLCBlc2NvcGUgaXNcbiAgICAgICAgLy8gYSBzdGF0aWMgYW5hbHl6ZXIsIHdlIG9ubHkgZ2VuZXJhdGUgb25lIHNjb3BlIGZvciBGb3JTdGF0ZW1lbnQuXG4gICAgICAgIGlmIChub2RlLmluaXQgJiYgbm9kZS5pbml0LnR5cGUgPT09IFN5bnRheC5WYXJpYWJsZURlY2xhcmF0aW9uICYmIG5vZGUuaW5pdC5raW5kICE9PSAndmFyJykge1xuICAgICAgICAgICAgdGhpcy5zY29wZU1hbmFnZXIuX19uZXN0Rm9yU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBDbGFzc0V4cHJlc3Npb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0Q2xhc3Mobm9kZSk7XG4gICAgfVxuXG4gICAgQ2xhc3NEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHRoaXMudmlzaXRDbGFzcyhub2RlKTtcbiAgICB9XG5cbiAgICBDYWxsRXhwcmVzc2lvbihub2RlKSB7XG4gICAgICAgIC8vIENoZWNrIHRoaXMgaXMgZGlyZWN0IGNhbGwgdG8gZXZhbFxuICAgICAgICBpZiAoIXRoaXMuc2NvcGVNYW5hZ2VyLl9faWdub3JlRXZhbCgpICYmIG5vZGUuY2FsbGVlLnR5cGUgPT09IFN5bnRheC5JZGVudGlmaWVyICYmIG5vZGUuY2FsbGVlLm5hbWUgPT09ICdldmFsJykge1xuICAgICAgICAgICAgLy8gTk9URTogVGhpcyBzaG91bGQgYmUgYHZhcmlhYmxlU2NvcGVgLiBTaW5jZSBkaXJlY3QgZXZhbCBjYWxsIGFsd2F5cyBjcmVhdGVzIExleGljYWwgZW52aXJvbm1lbnQgYW5kXG4gICAgICAgICAgICAvLyBsZXQgLyBjb25zdCBzaG91bGQgYmUgZW5jbG9zZWQgaW50byBpdC4gT25seSBWYXJpYWJsZURlY2xhcmF0aW9uIGFmZmVjdHMgb24gdGhlIGNhbGxlcidzIGVudmlyb25tZW50LlxuICAgICAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS52YXJpYWJsZVNjb3BlLl9fZGV0ZWN0RXZhbCgpO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudmlzaXRDaGlsZHJlbihub2RlKTtcbiAgICB9XG5cbiAgICBCbG9ja1N0YXRlbWVudChub2RlKSB7XG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdEJsb2NrU2NvcGUobm9kZSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLnZpc2l0Q2hpbGRyZW4obm9kZSk7XG5cbiAgICAgICAgdGhpcy5jbG9zZShub2RlKTtcbiAgICB9XG5cbiAgICBUaGlzRXhwcmVzc2lvbigpIHtcbiAgICAgICAgdGhpcy5jdXJyZW50U2NvcGUoKS52YXJpYWJsZVNjb3BlLl9fZGV0ZWN0VGhpcygpO1xuICAgIH1cblxuICAgIFdpdGhTdGF0ZW1lbnQobm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0KG5vZGUub2JqZWN0KTtcbiAgICAgICAgLy8gVGhlbiBuZXN0IHNjb3BlIGZvciBXaXRoU3RhdGVtZW50LlxuICAgICAgICB0aGlzLnNjb3BlTWFuYWdlci5fX25lc3RXaXRoU2NvcGUobm9kZSk7XG5cbiAgICAgICAgdGhpcy52aXNpdChub2RlLmJvZHkpO1xuXG4gICAgICAgIHRoaXMuY2xvc2Uobm9kZSk7XG4gICAgfVxuXG4gICAgVmFyaWFibGVEZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIHZhciB2YXJpYWJsZVRhcmdldFNjb3BlLCBpLCBpeiwgZGVjbDtcbiAgICAgICAgdmFyaWFibGVUYXJnZXRTY29wZSA9IChub2RlLmtpbmQgPT09ICd2YXInKSA/IHRoaXMuY3VycmVudFNjb3BlKCkudmFyaWFibGVTY29wZSA6IHRoaXMuY3VycmVudFNjb3BlKCk7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gbm9kZS5kZWNsYXJhdGlvbnMubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgZGVjbCA9IG5vZGUuZGVjbGFyYXRpb25zW2ldO1xuICAgICAgICAgICAgdGhpcy52aXNpdFZhcmlhYmxlRGVjbGFyYXRpb24odmFyaWFibGVUYXJnZXRTY29wZSwgVmFyaWFibGUuVmFyaWFibGUsIG5vZGUsIGkpO1xuICAgICAgICAgICAgaWYgKGRlY2wuaW5pdCkge1xuICAgICAgICAgICAgICAgIHRoaXMudmlzaXQoZGVjbC5pbml0KTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cblxuICAgIC8vIHNlYyAxMy4xMS44XG4gICAgU3dpdGNoU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdmFyIGksIGl6O1xuXG4gICAgICAgIHRoaXMudmlzaXQobm9kZS5kaXNjcmltaW5hbnQpO1xuXG4gICAgICAgIGlmICh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkpIHtcbiAgICAgICAgICAgIHRoaXMuc2NvcGVNYW5hZ2VyLl9fbmVzdFN3aXRjaFNjb3BlKG5vZGUpO1xuICAgICAgICB9XG5cbiAgICAgICAgZm9yIChpID0gMCwgaXogPSBub2RlLmNhc2VzLmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHRoaXMudmlzaXQobm9kZS5jYXNlc1tpXSk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLmNsb3NlKG5vZGUpO1xuICAgIH1cblxuICAgIEZ1bmN0aW9uRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0RnVuY3Rpb24obm9kZSk7XG4gICAgfVxuXG4gICAgRnVuY3Rpb25FeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZ1bmN0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEZvck9mU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZvckluKG5vZGUpO1xuICAgIH1cblxuICAgIEZvckluU3RhdGVtZW50KG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZvckluKG5vZGUpO1xuICAgIH1cblxuICAgIEFycm93RnVuY3Rpb25FeHByZXNzaW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEZ1bmN0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEltcG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgdmFyIGltcG9ydGVyO1xuXG4gICAgICAgIGFzc2VydCh0aGlzLnNjb3BlTWFuYWdlci5fX2lzRVM2KCkgJiYgdGhpcy5zY29wZU1hbmFnZXIuaXNNb2R1bGUoKSwgJ0ltcG9ydERlY2xhcmF0aW9uIHNob3VsZCBhcHBlYXIgd2hlbiB0aGUgbW9kZSBpcyBFUzYgYW5kIGluIHRoZSBtb2R1bGUgY29udGV4dC4nKTtcblxuICAgICAgICBpbXBvcnRlciA9IG5ldyBJbXBvcnRlcihub2RlLCB0aGlzKTtcbiAgICAgICAgaW1wb3J0ZXIudmlzaXQobm9kZSk7XG4gICAgfVxuXG4gICAgdmlzaXRFeHBvcnREZWNsYXJhdGlvbihub2RlKSB7XG4gICAgICAgIGlmIChub2RlLnNvdXJjZSkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGlmIChub2RlLmRlY2xhcmF0aW9uKSB7XG4gICAgICAgICAgICB0aGlzLnZpc2l0KG5vZGUuZGVjbGFyYXRpb24pO1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG5cbiAgICAgICAgdGhpcy52aXNpdENoaWxkcmVuKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpIHtcbiAgICAgICAgdGhpcy52aXNpdEV4cG9ydERlY2xhcmF0aW9uKG5vZGUpO1xuICAgIH1cblxuICAgIEV4cG9ydE5hbWVkRGVjbGFyYXRpb24obm9kZSkge1xuICAgICAgICB0aGlzLnZpc2l0RXhwb3J0RGVjbGFyYXRpb24obm9kZSk7XG4gICAgfVxuXG4gICAgRXhwb3J0U3BlY2lmaWVyKG5vZGUpIHtcbiAgICAgICAgbGV0IGxvY2FsID0gKG5vZGUuaWQgfHwgbm9kZS5sb2NhbCk7XG4gICAgICAgIHRoaXMudmlzaXQobG9jYWwpO1xuICAgIH1cbn1cblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      diff --git a/tools/eslint/node_modules/escope/lib/scope-manager.js b/tools/eslint/node_modules/escope/lib/scope-manager.js
      index bb64896f007223..6e85372a540d47 100644
      --- a/tools/eslint/node_modules/escope/lib/scope-manager.js
      +++ b/tools/eslint/node_modules/escope/lib/scope-manager.js
      @@ -1,275 +1,296 @@
      -"use strict";
      +'use strict';
       
      -var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
      +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.
       
      -/*
      -  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.
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     */
       
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      +Object.defineProperty(exports, "__esModule", {
      +    value: true
      +});
       
      -    * 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLW1hbmFnZXIuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUE2Q3FCO0FBQ2pCLGFBRGlCLFlBQ2pCLENBQVksT0FBWixFQUFxQjs4QkFESixjQUNJOztBQUNqQixhQUFLLE1BQUwsR0FBYyxFQUFkLENBRGlCO0FBRWpCLGFBQUssV0FBTCxHQUFtQixJQUFuQixDQUZpQjtBQUdqQixhQUFLLGFBQUwsR0FBcUIsMEJBQXJCLENBSGlCO0FBSWpCLGFBQUssY0FBTCxHQUFzQixJQUF0QixDQUppQjtBQUtqQixhQUFLLFNBQUwsR0FBaUIsT0FBakIsQ0FMaUI7QUFNakIsYUFBSyxtQkFBTCxHQUEyQiwwQkFBM0IsQ0FOaUI7S0FBckI7O2lCQURpQjs7eUNBVUE7QUFDYixtQkFBTyxLQUFLLFNBQUwsQ0FBZSxTQUFmLENBRE07Ozs7eUNBSUE7QUFDYixtQkFBTyxLQUFLLFNBQUwsQ0FBZSxVQUFmLENBRE07Ozs7dUNBSUY7QUFDWCxtQkFBTyxLQUFLLFNBQUwsQ0FBZSxVQUFmLENBREk7Ozs7MENBSUc7QUFDZCxtQkFBTyxLQUFLLFNBQUwsQ0FBZSxXQUFmLENBRE87Ozs7bUNBSVA7QUFDUCxtQkFBTyxLQUFLLFNBQUwsQ0FBZSxVQUFmLEtBQThCLFFBQTlCLENBREE7Ozs7MENBSU87QUFDZCxtQkFBTyxLQUFLLFNBQUwsQ0FBZSxhQUFmLENBRE87Ozs7Z0RBSU07QUFDcEIsbUJBQU8sS0FBSyxTQUFMLENBQWUsV0FBZixJQUE4QixDQUE5QixDQURhOzs7Ozs7OzhCQUtsQixNQUFNO0FBQ1IsbUJBQU8sS0FBSyxhQUFMLENBQW1CLEdBQW5CLENBQXVCLElBQXZCLENBQVAsQ0FEUTs7Ozs7Ozs7Ozs7Ozs7Ozs2Q0FjUyxNQUFNO0FBQ3ZCLG1CQUFPLEtBQUssbUJBQUwsQ0FBeUIsR0FBekIsQ0FBNkIsSUFBN0IsS0FBc0MsRUFBdEMsQ0FEZ0I7Ozs7Ozs7Ozs7Ozs7Z0NBV25CLE1BQU0sT0FBTztBQUNqQixnQkFBSSxNQUFKLEVBQVksS0FBWixFQUFtQixDQUFuQixFQUFzQixFQUF0QixDQURpQjs7QUFHakIscUJBQVMsU0FBVCxDQUFtQixLQUFuQixFQUEwQjtBQUN0QixvQkFBSSxNQUFNLElBQU4sS0FBZSxVQUFmLElBQTZCLE1BQU0sdUJBQU4sRUFBK0I7QUFDNUQsMkJBQU8sS0FBUCxDQUQ0RDtpQkFBaEU7QUFHQSxvQkFBSSxNQUFNLElBQU4sS0FBZSxLQUFmLEVBQXNCO0FBQ3RCLDJCQUFPLEtBQVAsQ0FEc0I7aUJBQTFCO0FBR0EsdUJBQU8sSUFBUCxDQVBzQjthQUExQjs7QUFVQSxxQkFBUyxLQUFLLEtBQUwsQ0FBVyxJQUFYLENBQVQsQ0FiaUI7QUFjakIsZ0JBQUksQ0FBQyxNQUFELElBQVcsT0FBTyxNQUFQLEtBQWtCLENBQWxCLEVBQXFCO0FBQ2hDLHVCQUFPLElBQVAsQ0FEZ0M7YUFBcEM7Ozs7QUFkaUIsZ0JBb0JiLE9BQU8sTUFBUCxLQUFrQixDQUFsQixFQUFxQjtBQUNyQix1QkFBTyxPQUFPLENBQVAsQ0FBUCxDQURxQjthQUF6Qjs7QUFJQSxnQkFBSSxLQUFKLEVBQVc7QUFDUCxxQkFBSyxJQUFJLE9BQU8sTUFBUCxHQUFnQixDQUFoQixFQUFtQixLQUFLLENBQUwsRUFBUSxFQUFFLENBQUYsRUFBSztBQUNyQyw0QkFBUSxPQUFPLENBQVAsQ0FBUixDQURxQztBQUVyQyx3QkFBSSxVQUFVLEtBQVYsQ0FBSixFQUFzQjtBQUNsQiwrQkFBTyxLQUFQLENBRGtCO3FCQUF0QjtpQkFGSjthQURKLE1BT087QUFDSCxxQkFBSyxJQUFJLENBQUosRUFBTyxLQUFLLE9BQU8sTUFBUCxFQUFlLElBQUksRUFBSixFQUFRLEVBQUUsQ0FBRixFQUFLO0FBQ3pDLDRCQUFRLE9BQU8sQ0FBUCxDQUFSLENBRHlDO0FBRXpDLHdCQUFJLFVBQVUsS0FBVixDQUFKLEVBQXNCO0FBQ2xCLCtCQUFPLEtBQVAsQ0FEa0I7cUJBQXRCO2lCQUZKO2FBUko7O0FBZ0JBLG1CQUFPLElBQVAsQ0F4Q2lCOzs7Ozs7Ozs7Ozs7bUNBaURWLE1BQU07QUFDYixtQkFBTyxLQUFLLEtBQUwsQ0FBVyxJQUFYLENBQVAsQ0FEYTs7Ozs7Ozs7Ozs7OztnQ0FXVCxNQUFNLE9BQU87QUFDakIsZ0JBQUksTUFBSixFQUFZLEtBQVosQ0FEaUI7QUFFakIscUJBQVMsS0FBSyxLQUFMLENBQVcsSUFBWCxDQUFULENBRmlCO0FBR2pCLGdCQUFJLFVBQVUsT0FBTyxNQUFQLEVBQWU7QUFDekIsd0JBQVEsT0FBTyxDQUFQLEVBQVUsS0FBVixDQURpQjtBQUV6QixvQkFBSSxDQUFDLEtBQUQsRUFBUTtBQUNSLDJCQUFPLElBQVAsQ0FEUTtpQkFBWjtBQUdBLHVCQUFPLEtBQUssT0FBTCxDQUFhLE1BQU0sS0FBTixFQUFhLEtBQTFCLENBQVAsQ0FMeUI7YUFBN0I7QUFPQSxtQkFBTyxJQUFQLENBVmlCOzs7O2lDQWFaOzs7aUNBRUE7OztvQ0FFRyxPQUFPO0FBQ2YsZ0JBQUksbUNBQUosRUFBa0M7QUFDOUIsc0NBQU8sS0FBSyxjQUFMLEtBQXdCLElBQXhCLENBQVAsQ0FEOEI7QUFFOUIscUJBQUssV0FBTCxHQUFtQixLQUFuQixDQUY4QjthQUFsQztBQUlBLGlCQUFLLGNBQUwsR0FBc0IsS0FBdEIsQ0FMZTtBQU1mLG1CQUFPLEtBQVAsQ0FOZTs7OzswQ0FTRCxNQUFNO0FBQ3BCLG1CQUFPLEtBQUssV0FBTCxDQUFpQix1QkFBZ0IsSUFBaEIsRUFBc0IsSUFBdEIsQ0FBakIsQ0FBUCxDQURvQjs7Ozt5Q0FJUCxNQUFNLG9CQUFvQjtBQUN2QyxtQkFBTyxLQUFLLFdBQUwsQ0FBaUIsc0JBQWUsSUFBZixFQUFxQixLQUFLLGNBQUwsRUFBcUIsSUFBMUMsQ0FBakIsQ0FBUCxDQUR1Qzs7Ozs0Q0FJdkIsTUFBTSxvQkFBb0I7QUFDMUMsbUJBQU8sS0FBSyxXQUFMLENBQWlCLHlCQUFrQixJQUFsQixFQUF3QixLQUFLLGNBQUwsRUFBcUIsSUFBN0MsRUFBbUQsa0JBQW5ELENBQWpCLENBQVAsQ0FEMEM7Ozs7dUNBSS9CLE1BQU07QUFDakIsbUJBQU8sS0FBSyxXQUFMLENBQWlCLG9CQUFhLElBQWIsRUFBbUIsS0FBSyxjQUFMLEVBQXFCLElBQXhDLENBQWpCLENBQVAsQ0FEaUI7Ozs7eUNBSUosTUFBTTtBQUNuQixtQkFBTyxLQUFLLFdBQUwsQ0FBaUIsc0JBQWUsSUFBZixFQUFxQixLQUFLLGNBQUwsRUFBcUIsSUFBMUMsQ0FBakIsQ0FBUCxDQURtQjs7Ozt3Q0FJUCxNQUFNO0FBQ2xCLG1CQUFPLEtBQUssV0FBTCxDQUFpQixxQkFBYyxJQUFkLEVBQW9CLEtBQUssY0FBTCxFQUFxQixJQUF6QyxDQUFqQixDQUFQLENBRGtCOzs7O3lDQUlMLE1BQU07QUFDbkIsbUJBQU8sS0FBSyxXQUFMLENBQWlCLHNCQUFlLElBQWYsRUFBcUIsS0FBSyxjQUFMLEVBQXFCLElBQTFDLENBQWpCLENBQVAsQ0FEbUI7Ozs7MENBSUwsTUFBTTtBQUNwQixtQkFBTyxLQUFLLFdBQUwsQ0FBaUIsdUJBQWdCLElBQWhCLEVBQXNCLEtBQUssY0FBTCxFQUFxQixJQUEzQyxDQUFqQixDQUFQLENBRG9COzs7OzBDQUlOLE1BQU07QUFDcEIsbUJBQU8sS0FBSyxXQUFMLENBQWlCLHVCQUFnQixJQUFoQixFQUFzQixLQUFLLGNBQUwsRUFBcUIsSUFBM0MsQ0FBakIsQ0FBUCxDQURvQjs7Ozt1Q0FJVCxNQUFNO0FBQ2pCLG1CQUFPLEtBQUssV0FBTCxDQUFpQixvQkFBYSxJQUFiLEVBQW1CLEtBQUssY0FBTCxFQUFxQixJQUF4QyxDQUFqQixDQUFQLENBRGlCOzs7OzBEQUlhLE1BQU07QUFDcEMsbUJBQU8sS0FBSyxXQUFMLENBQWlCLHVDQUFnQyxJQUFoQyxFQUFzQyxLQUFLLGNBQUwsRUFBcUIsSUFBM0QsQ0FBakIsQ0FBUCxDQURvQzs7OztrQ0FJOUI7QUFDTixtQkFBTyxLQUFLLFNBQUwsQ0FBZSxXQUFmLElBQThCLENBQTlCLENBREQ7Ozs7V0FsTU8iLCJmaWxlIjoic2NvcGUtbWFuYWdlci5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qXG4gIENvcHlyaWdodCAoQykgMjAxNSBZdXN1a2UgU3V6dWtpIDx1dGF0YW5lLnRlYUBnbWFpbC5jb20+XG5cbiAgUmVkaXN0cmlidXRpb24gYW5kIHVzZSBpbiBzb3VyY2UgYW5kIGJpbmFyeSBmb3Jtcywgd2l0aCBvciB3aXRob3V0XG4gIG1vZGlmaWNhdGlvbiwgYXJlIHBlcm1pdHRlZCBwcm92aWRlZCB0aGF0IHRoZSBmb2xsb3dpbmcgY29uZGl0aW9ucyBhcmUgbWV0OlxuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgb2Ygc291cmNlIGNvZGUgbXVzdCByZXRhaW4gdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyLlxuICAgICogUmVkaXN0cmlidXRpb25zIGluIGJpbmFyeSBmb3JtIG11c3QgcmVwcm9kdWNlIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lciBpbiB0aGVcbiAgICAgIGRvY3VtZW50YXRpb24gYW5kL29yIG90aGVyIG1hdGVyaWFscyBwcm92aWRlZCB3aXRoIHRoZSBkaXN0cmlidXRpb24uXG5cbiAgVEhJUyBTT0ZUV0FSRSBJUyBQUk9WSURFRCBCWSBUSEUgQ09QWVJJR0hUIEhPTERFUlMgQU5EIENPTlRSSUJVVE9SUyBcIkFTIElTXCJcbiAgQU5EIEFOWSBFWFBSRVNTIE9SIElNUExJRUQgV0FSUkFOVElFUywgSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFRIRVxuICBJTVBMSUVEIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZIEFORCBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRVxuICBBUkUgRElTQ0xBSU1FRC4gSU4gTk8gRVZFTlQgU0hBTEwgPENPUFlSSUdIVCBIT0xERVI+IEJFIExJQUJMRSBGT1IgQU5ZXG4gIERJUkVDVCwgSU5ESVJFQ1QsIElOQ0lERU5UQUwsIFNQRUNJQUwsIEVYRU1QTEFSWSwgT1IgQ09OU0VRVUVOVElBTCBEQU1BR0VTXG4gIChJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgUFJPQ1VSRU1FTlQgT0YgU1VCU1RJVFVURSBHT09EUyBPUiBTRVJWSUNFUztcbiAgTE9TUyBPRiBVU0UsIERBVEEsIE9SIFBST0ZJVFM7IE9SIEJVU0lORVNTIElOVEVSUlVQVElPTikgSE9XRVZFUiBDQVVTRUQgQU5EXG4gIE9OIEFOWSBUSEVPUlkgT0YgTElBQklMSVRZLCBXSEVUSEVSIElOIENPTlRSQUNULCBTVFJJQ1QgTElBQklMSVRZLCBPUiBUT1JUXG4gIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRlxuICBUSElTIFNPRlRXQVJFLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuKi9cblxuaW1wb3J0IFdlYWtNYXAgZnJvbSAnZXM2LXdlYWstbWFwJztcbmltcG9ydCBTY29wZSBmcm9tICcuL3Njb3BlJztcbmltcG9ydCBhc3NlcnQgZnJvbSAnYXNzZXJ0JztcblxuaW1wb3J0IHtcbiAgICBHbG9iYWxTY29wZSxcbiAgICBDYXRjaFNjb3BlLFxuICAgIFdpdGhTY29wZSxcbiAgICBNb2R1bGVTY29wZSxcbiAgICBDbGFzc1Njb3BlLFxuICAgIFN3aXRjaFNjb3BlLFxuICAgIEZ1bmN0aW9uU2NvcGUsXG4gICAgRm9yU2NvcGUsXG4gICAgVERaU2NvcGUsXG4gICAgRnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlLFxuICAgIEJsb2NrU2NvcGVcbn0gZnJvbSAnLi9zY29wZSc7XG5cbi8qKlxuICogQGNsYXNzIFNjb3BlTWFuYWdlclxuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBTY29wZU1hbmFnZXIge1xuICAgIGNvbnN0cnVjdG9yKG9wdGlvbnMpIHtcbiAgICAgICAgdGhpcy5zY29wZXMgPSBbXTtcbiAgICAgICAgdGhpcy5nbG9iYWxTY29wZSA9IG51bGw7XG4gICAgICAgIHRoaXMuX19ub2RlVG9TY29wZSA9IG5ldyBXZWFrTWFwKCk7XG4gICAgICAgIHRoaXMuX19jdXJyZW50U2NvcGUgPSBudWxsO1xuICAgICAgICB0aGlzLl9fb3B0aW9ucyA9IG9wdGlvbnM7XG4gICAgICAgIHRoaXMuX19kZWNsYXJlZFZhcmlhYmxlcyA9IG5ldyBXZWFrTWFwKCk7XG4gICAgfVxuXG4gICAgX191c2VEaXJlY3RpdmUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5kaXJlY3RpdmU7XG4gICAgfVxuXG4gICAgX19pc09wdGltaXN0aWMoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5vcHRpbWlzdGljO1xuICAgIH1cblxuICAgIF9faWdub3JlRXZhbCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19vcHRpb25zLmlnbm9yZUV2YWw7XG4gICAgfVxuXG4gICAgX19pc05vZGVqc1Njb3BlKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX29wdGlvbnMubm9kZWpzU2NvcGU7XG4gICAgfVxuXG4gICAgaXNNb2R1bGUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5zb3VyY2VUeXBlID09PSAnbW9kdWxlJztcbiAgICB9XG5cbiAgICBpc0ltcGxpZWRTdHJpY3QoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fb3B0aW9ucy5pbXBsaWVkU3RyaWN0O1xuICAgIH1cblxuICAgIGlzU3RyaWN0TW9kZVN1cHBvcnRlZCgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19vcHRpb25zLmVjbWFWZXJzaW9uID49IDU7XG4gICAgfVxuXG4gICAgLy8gUmV0dXJucyBhcHByb3ByaWF0ZSBzY29wZSBmb3IgdGhpcyBub2RlLlxuICAgIF9fZ2V0KG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19ub2RlVG9TY29wZS5nZXQobm9kZSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogR2V0IHZhcmlhYmxlcyB0aGF0IGFyZSBkZWNsYXJlZCBieSB0aGUgbm9kZS5cbiAgICAgKlxuICAgICAqIFwiYXJlIGRlY2xhcmVkIGJ5IHRoZSBub2RlXCIgbWVhbnMgdGhlIG5vZGUgaXMgc2FtZSBhcyBgVmFyaWFibGUuZGVmc1tdLm5vZGVgIG9yIGBWYXJpYWJsZS5kZWZzW10ucGFyZW50YC5cbiAgICAgKiBJZiB0aGUgbm9kZSBkZWNsYXJlcyBub3RoaW5nLCB0aGlzIG1ldGhvZCByZXR1cm5zIGFuIGVtcHR5IGFycmF5LlxuICAgICAqIENBVVRJT046IFRoaXMgQVBJIGlzIGV4cGVyaW1lbnRhbC4gU2VlIGh0dHBzOi8vZ2l0aHViLmNvbS9lc3Rvb2xzL2VzY29wZS9wdWxsLzY5IGZvciBtb3JlIGRldGFpbHMuXG4gICAgICpcbiAgICAgKiBAcGFyYW0ge0VzcHJpbWEuTm9kZX0gbm9kZSAtIGEgbm9kZSB0byBnZXQuXG4gICAgICogQHJldHVybnMge1ZhcmlhYmxlW119IHZhcmlhYmxlcyB0aGF0IGRlY2xhcmVkIGJ5IHRoZSBub2RlLlxuICAgICAqL1xuICAgIGdldERlY2xhcmVkVmFyaWFibGVzKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19kZWNsYXJlZFZhcmlhYmxlcy5nZXQobm9kZSkgfHwgW107XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogYWNxdWlyZSBzY29wZSBmcm9tIG5vZGUuXG4gICAgICogQG1ldGhvZCBTY29wZU1hbmFnZXIjYWNxdWlyZVxuICAgICAqIEBwYXJhbSB7RXNwcmltYS5Ob2RlfSBub2RlIC0gbm9kZSBmb3IgdGhlIGFjcXVpcmVkIHNjb3BlLlxuICAgICAqIEBwYXJhbSB7Ym9vbGVhbj19IGlubmVyIC0gbG9vayB1cCB0aGUgbW9zdCBpbm5lciBzY29wZSwgZGVmYXVsdCB2YWx1ZSBpcyBmYWxzZS5cbiAgICAgKiBAcmV0dXJuIHtTY29wZT99XG4gICAgICovXG4gICAgYWNxdWlyZShub2RlLCBpbm5lcikge1xuICAgICAgICB2YXIgc2NvcGVzLCBzY29wZSwgaSwgaXo7XG5cbiAgICAgICAgZnVuY3Rpb24gcHJlZGljYXRlKHNjb3BlKSB7XG4gICAgICAgICAgICBpZiAoc2NvcGUudHlwZSA9PT0gJ2Z1bmN0aW9uJyAmJiBzY29wZS5mdW5jdGlvbkV4cHJlc3Npb25TY29wZSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGlmIChzY29wZS50eXBlID09PSAnVERaJykge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgc2NvcGVzID0gdGhpcy5fX2dldChub2RlKTtcbiAgICAgICAgaWYgKCFzY29wZXMgfHwgc2NvcGVzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICAgICAgcmV0dXJuIG51bGw7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBIZXVyaXN0aWMgc2VsZWN0aW9uIGZyb20gYWxsIHNjb3Blcy5cbiAgICAgICAgLy8gSWYgeW91IHdvdWxkIGxpa2UgdG8gZ2V0IGFsbCBzY29wZXMsIHBsZWFzZSB1c2UgU2NvcGVNYW5hZ2VyI2FjcXVpcmVBbGwuXG4gICAgICAgIGlmIChzY29wZXMubGVuZ3RoID09PSAxKSB7XG4gICAgICAgICAgICByZXR1cm4gc2NvcGVzWzBdO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGlubmVyKSB7XG4gICAgICAgICAgICBmb3IgKGkgPSBzY29wZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgICAgICAgICBzY29wZSA9IHNjb3Blc1tpXTtcbiAgICAgICAgICAgICAgICBpZiAocHJlZGljYXRlKHNjb3BlKSkge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NvcGU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgZm9yIChpID0gMCwgaXogPSBzY29wZXMubGVuZ3RoOyBpIDwgaXo7ICsraSkge1xuICAgICAgICAgICAgICAgIHNjb3BlID0gc2NvcGVzW2ldO1xuICAgICAgICAgICAgICAgIGlmIChwcmVkaWNhdGUoc2NvcGUpKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBzY29wZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICAvKipcbiAgICAgKiBhY3F1aXJlIGFsbCBzY29wZXMgZnJvbSBub2RlLlxuICAgICAqIEBtZXRob2QgU2NvcGVNYW5hZ2VyI2FjcXVpcmVBbGxcbiAgICAgKiBAcGFyYW0ge0VzcHJpbWEuTm9kZX0gbm9kZSAtIG5vZGUgZm9yIHRoZSBhY3F1aXJlZCBzY29wZS5cbiAgICAgKiBAcmV0dXJuIHtTY29wZVtdP31cbiAgICAgKi9cbiAgICBhY3F1aXJlQWxsKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19nZXQobm9kZSk7XG4gICAgfVxuXG4gICAgLyoqXG4gICAgICogcmVsZWFzZSB0aGUgbm9kZS5cbiAgICAgKiBAbWV0aG9kIFNjb3BlTWFuYWdlciNyZWxlYXNlXG4gICAgICogQHBhcmFtIHtFc3ByaW1hLk5vZGV9IG5vZGUgLSByZWxlYXNpbmcgbm9kZS5cbiAgICAgKiBAcGFyYW0ge2Jvb2xlYW49fSBpbm5lciAtIGxvb2sgdXAgdGhlIG1vc3QgaW5uZXIgc2NvcGUsIGRlZmF1bHQgdmFsdWUgaXMgZmFsc2UuXG4gICAgICogQHJldHVybiB7U2NvcGU/fSB1cHBlciBzY29wZSBmb3IgdGhlIG5vZGUuXG4gICAgICovXG4gICAgcmVsZWFzZShub2RlLCBpbm5lcikge1xuICAgICAgICB2YXIgc2NvcGVzLCBzY29wZTtcbiAgICAgICAgc2NvcGVzID0gdGhpcy5fX2dldChub2RlKTtcbiAgICAgICAgaWYgKHNjb3BlcyAmJiBzY29wZXMubGVuZ3RoKSB7XG4gICAgICAgICAgICBzY29wZSA9IHNjb3Blc1swXS51cHBlcjtcbiAgICAgICAgICAgIGlmICghc2NvcGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiB0aGlzLmFjcXVpcmUoc2NvcGUuYmxvY2ssIGlubmVyKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gbnVsbDtcbiAgICB9XG5cbiAgICBhdHRhY2goKSB7IH1cblxuICAgIGRldGFjaCgpIHsgfVxuXG4gICAgX19uZXN0U2NvcGUoc2NvcGUpIHtcbiAgICAgICAgaWYgKHNjb3BlIGluc3RhbmNlb2YgR2xvYmFsU2NvcGUpIHtcbiAgICAgICAgICAgIGFzc2VydCh0aGlzLl9fY3VycmVudFNjb3BlID09PSBudWxsKTtcbiAgICAgICAgICAgIHRoaXMuZ2xvYmFsU2NvcGUgPSBzY29wZTtcbiAgICAgICAgfVxuICAgICAgICB0aGlzLl9fY3VycmVudFNjb3BlID0gc2NvcGU7XG4gICAgICAgIHJldHVybiBzY29wZTtcbiAgICB9XG5cbiAgICBfX25lc3RHbG9iYWxTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBHbG9iYWxTY29wZSh0aGlzLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0QmxvY2tTY29wZShub2RlLCBpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IEJsb2NrU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdEZ1bmN0aW9uU2NvcGUobm9kZSwgaXNNZXRob2REZWZpbml0aW9uKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBGdW5jdGlvblNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUsIGlzTWV0aG9kRGVmaW5pdGlvbikpO1xuICAgIH1cblxuICAgIF9fbmVzdEZvclNjb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IEZvclNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RDYXRjaFNjb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IENhdGNoU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdFdpdGhTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBXaXRoU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdENsYXNzU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgQ2xhc3NTY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0U3dpdGNoU2NvcGUobm9kZSkge1xuICAgICAgICByZXR1cm4gdGhpcy5fX25lc3RTY29wZShuZXcgU3dpdGNoU2NvcGUodGhpcywgdGhpcy5fX2N1cnJlbnRTY29wZSwgbm9kZSkpO1xuICAgIH1cblxuICAgIF9fbmVzdE1vZHVsZVNjb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IE1vZHVsZVNjb3BlKHRoaXMsIHRoaXMuX19jdXJyZW50U2NvcGUsIG5vZGUpKTtcbiAgICB9XG5cbiAgICBfX25lc3RURFpTY29wZShub2RlKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9fbmVzdFNjb3BlKG5ldyBURFpTY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19uZXN0RnVuY3Rpb25FeHByZXNzaW9uTmFtZVNjb3BlKG5vZGUpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19uZXN0U2NvcGUobmV3IEZ1bmN0aW9uRXhwcmVzc2lvbk5hbWVTY29wZSh0aGlzLCB0aGlzLl9fY3VycmVudFNjb3BlLCBub2RlKSk7XG4gICAgfVxuXG4gICAgX19pc0VTNigpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX19vcHRpb25zLmVjbWFWZXJzaW9uID49IDY7XG4gICAgfVxufVxuXG4vKiB2aW06IHNldCBzdz00IHRzPTQgZXQgdHc9ODAgOiAqL1xuIl0sInNvdXJjZVJvb3QiOiIvc291cmNlLyJ9
      diff --git a/tools/eslint/node_modules/escope/lib/scope.js b/tools/eslint/node_modules/escope/lib/scope.js
      index ec1547b91fe8bb..a9b3b897d87db1 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 _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 _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 
      +
      +                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       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 _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 _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 _es6Map = require('es6-map');
       
      -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 _es6Map2 = _interopRequireDefault(_es6Map);
       
      -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
      +var _reference = require('./reference');
       
      -Object.defineProperty(exports, "__esModule", {
      -    value: true
      -});
      -/*
      -  Copyright (C) 2015 Yusuke Suzuki 
      +var _reference2 = _interopRequireDefault(_reference);
      +
      +var _variable = require('./variable');
       
      -  Redistribution and use in source and binary forms, with or without
      -  modification, are permitted provided that the following conditions are met:
      +var _variable2 = _interopRequireDefault(_variable);
       
      -    * 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 _definition = require('./definition');
       
      -  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 _definition2 = _interopRequireDefault(_definition);
       
      -var Syntax = require("estraverse").Syntax;
      +var _assert = require('assert');
       
      -var Map = _interopRequire(require("es6-map"));
      +var _assert2 = _interopRequireDefault(_assert);
       
      -var Reference = _interopRequire(require("./reference"));
      +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
       
      -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; }
       
      -var Definition = _interopRequire(require("./definition"));
      +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; }
       
      -var assert = _interopRequire(require("assert"));
      +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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNjb3BlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWdDQSxTQUFTLGFBQVQsQ0FBdUIsS0FBdkIsRUFBOEIsS0FBOUIsRUFBcUMsa0JBQXJDLEVBQXlELFlBQXpELEVBQXVFO0FBQ25FLFFBQUksSUFBSixFQUFVLENBQVYsRUFBYSxFQUFiLEVBQWlCLElBQWpCLEVBQXVCLElBQXZCOzs7QUFEbUUsUUFJL0QsTUFBTSxLQUFOLElBQWUsTUFBTSxLQUFOLENBQVksUUFBWixFQUFzQjtBQUNyQyxlQUFPLElBQVAsQ0FEcUM7S0FBekM7OztBQUptRSxRQVMvRCxNQUFNLElBQU4sS0FBZSxtQkFBTyx1QkFBUCxFQUFnQztBQUMvQyxlQUFPLElBQVAsQ0FEK0M7S0FBbkQ7O0FBSUEsUUFBSSxrQkFBSixFQUF3QjtBQUNwQixlQUFPLElBQVAsQ0FEb0I7S0FBeEI7O0FBSUEsUUFBSSxNQUFNLElBQU4sS0FBZSxPQUFmLElBQTBCLE1BQU0sSUFBTixLQUFlLFFBQWYsRUFBeUI7QUFDbkQsZUFBTyxJQUFQLENBRG1EO0tBQXZEOztBQUlBLFFBQUksTUFBTSxJQUFOLEtBQWUsT0FBZixJQUEwQixNQUFNLElBQU4sS0FBZSxRQUFmLEVBQXlCO0FBQ25ELGVBQU8sS0FBUCxDQURtRDtLQUF2RDs7QUFJQSxRQUFJLE1BQU0sSUFBTixLQUFlLFVBQWYsRUFBMkI7QUFDM0IsWUFBSSxNQUFNLElBQU4sS0FBZSxtQkFBTyxPQUFQLEVBQWdCO0FBQy9CLG1CQUFPLEtBQVAsQ0FEK0I7U0FBbkMsTUFFTztBQUNILG1CQUFPLE1BQU0sSUFBTixDQURKO1NBRlA7S0FESixNQU1PLElBQUksTUFBTSxJQUFOLEtBQWUsUUFBZixFQUF5QjtBQUNoQyxlQUFPLEtBQVAsQ0FEZ0M7S0FBN0IsTUFFQTtBQUNILGVBQU8sS0FBUCxDQURHO0tBRkE7OztBQS9CNEQsUUFzQy9ELFlBQUosRUFBa0I7QUFDZCxhQUFLLElBQUksQ0FBSixFQUFPLEtBQUssS0FBSyxJQUFMLENBQVUsTUFBVixFQUFrQixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUM1QyxtQkFBTyxLQUFLLElBQUwsQ0FBVSxDQUFWLENBQVAsQ0FENEM7QUFFNUMsZ0JBQUksS0FBSyxJQUFMLEtBQWMsbUJBQU8sa0JBQVAsRUFBMkI7QUFDekMsc0JBRHlDO2FBQTdDO0FBR0EsZ0JBQUksS0FBSyxHQUFMLEtBQWEsY0FBYixJQUErQixLQUFLLEdBQUwsS0FBYSxnQkFBYixFQUErQjtBQUM5RCx1QkFBTyxJQUFQLENBRDhEO2FBQWxFO1NBTEo7S0FESixNQVVPO0FBQ0gsYUFBSyxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssSUFBTCxDQUFVLE1BQVYsRUFBa0IsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDNUMsbUJBQU8sS0FBSyxJQUFMLENBQVUsQ0FBVixDQUFQLENBRDRDO0FBRTVDLGdCQUFJLEtBQUssSUFBTCxLQUFjLG1CQUFPLG1CQUFQLEVBQTRCO0FBQzFDLHNCQUQwQzthQUE5QztBQUdBLG1CQUFPLEtBQUssVUFBTCxDQUxxQztBQU01QyxnQkFBSSxLQUFLLElBQUwsS0FBYyxtQkFBTyxPQUFQLElBQWtCLE9BQU8sS0FBSyxLQUFMLEtBQWUsUUFBdEIsRUFBZ0M7QUFDaEUsc0JBRGdFO2FBQXBFO0FBR0EsZ0JBQUksS0FBSyxHQUFMLElBQVksSUFBWixFQUFrQjtBQUNsQixvQkFBSSxLQUFLLEdBQUwsS0FBYSxjQUFiLElBQStCLEtBQUssR0FBTCxLQUFhLGdCQUFiLEVBQStCO0FBQzlELDJCQUFPLElBQVAsQ0FEOEQ7aUJBQWxFO2FBREosTUFJTztBQUNILG9CQUFJLEtBQUssS0FBTCxLQUFlLFlBQWYsRUFBNkI7QUFDN0IsMkJBQU8sSUFBUCxDQUQ2QjtpQkFBakM7YUFMSjtTQVRKO0tBWEo7QUErQkEsV0FBTyxLQUFQLENBckVtRTtDQUF2RTs7QUF3RUEsU0FBUyxhQUFULENBQXVCLFlBQXZCLEVBQXFDLEtBQXJDLEVBQTRDO0FBQ3hDLFFBQUksTUFBSixDQUR3Qzs7QUFHeEMsaUJBQWEsTUFBYixDQUFvQixJQUFwQixDQUF5QixLQUF6QixFQUh3Qzs7QUFLeEMsYUFBUyxhQUFhLGFBQWIsQ0FBMkIsR0FBM0IsQ0FBK0IsTUFBTSxLQUFOLENBQXhDLENBTHdDO0FBTXhDLFFBQUksTUFBSixFQUFZO0FBQ1IsZUFBTyxJQUFQLENBQVksS0FBWixFQURRO0tBQVosTUFFTztBQUNILHFCQUFhLGFBQWIsQ0FBMkIsR0FBM0IsQ0FBK0IsTUFBTSxLQUFOLEVBQWEsQ0FBRSxLQUFGLENBQTVDLEVBREc7S0FGUDtDQU5KOztBQWFBLFNBQVMsa0JBQVQsQ0FBNEIsR0FBNUIsRUFBaUM7QUFDN0IsV0FDSSxHQUFDLENBQUksSUFBSixLQUFhLG1CQUFTLFNBQVQsSUFDYixJQUFJLElBQUosS0FBYSxtQkFBUyxRQUFULElBQXFCLElBQUksTUFBSixDQUFXLElBQVgsS0FBb0IsS0FBcEIsQ0FIVjtDQUFqQzs7Ozs7O0lBVXFCO0FBQ2pCLGFBRGlCLEtBQ2pCLENBQVksWUFBWixFQUEwQixJQUExQixFQUFnQyxVQUFoQyxFQUE0QyxLQUE1QyxFQUFtRCxrQkFBbkQsRUFBdUU7OEJBRHRELE9BQ3NEOzs7Ozs7QUFLbkUsYUFBSyxJQUFMLEdBQVksSUFBWjs7Ozs7O0FBTG1FLFlBV25FLENBQUssR0FBTCxHQUFXLHNCQUFYOzs7OztBQVhtRSxZQWdCbkUsQ0FBSyxNQUFMLEdBQWMsc0JBQWQ7Ozs7Ozs7Ozs7O0FBaEJtRSxZQTJCbkUsQ0FBSyxPQUFMLEdBQWUsS0FBSyxJQUFMLEtBQWMsUUFBZCxJQUEwQixLQUFLLElBQUwsS0FBYyxNQUFkOzs7OztBQTNCMEIsWUFnQ25FLENBQUssS0FBTCxHQUFhLEtBQWI7Ozs7O0FBaENtRSxZQXFDbkUsQ0FBSyxPQUFMLEdBQWUsRUFBZjs7Ozs7OztBQXJDbUUsWUE0Q25FLENBQUssU0FBTCxHQUFpQixFQUFqQjs7Ozs7Ozs7OztBQTVDbUUsWUFzRG5FLENBQUssVUFBTCxHQUFrQixFQUFsQjs7Ozs7Ozs7QUF0RG1FLFlBOERuRSxDQUFLLGFBQUwsR0FDSSxJQUFDLENBQUssSUFBTCxLQUFjLFFBQWQsSUFBMEIsS0FBSyxJQUFMLEtBQWMsVUFBZCxJQUE0QixLQUFLLElBQUwsS0FBYyxRQUFkLEdBQTBCLElBQWpGLEdBQXdGLFdBQVcsYUFBWDs7Ozs7QUEvRHpCLFlBb0VuRSxDQUFLLHVCQUFMLEdBQStCLEtBQS9COzs7OztBQXBFbUUsWUF5RW5FLENBQUsscUJBQUwsR0FBNkIsS0FBN0I7Ozs7QUF6RW1FLFlBNkVuRSxDQUFLLFNBQUwsR0FBaUIsS0FBakIsQ0E3RW1FOztBQStFbkUsYUFBSyxNQUFMLEdBQWMsRUFBZDs7Ozs7O0FBL0VtRSxZQXFGbkUsQ0FBSyxLQUFMLEdBQWEsVUFBYjs7Ozs7QUFyRm1FLFlBMEZuRSxDQUFLLFFBQUwsR0FBZ0IsY0FBYyxJQUFkLEVBQW9CLEtBQXBCLEVBQTJCLGtCQUEzQixFQUErQyxhQUFhLGNBQWIsRUFBL0MsQ0FBaEI7Ozs7OztBQTFGbUUsWUFnR25FLENBQUssV0FBTCxHQUFtQixFQUFuQixDQWhHbUU7QUFpR25FLFlBQUksS0FBSyxLQUFMLEVBQVk7QUFDWixpQkFBSyxLQUFMLENBQVcsV0FBWCxDQUF1QixJQUF2QixDQUE0QixJQUE1QixFQURZO1NBQWhCOztBQUlBLGFBQUssbUJBQUwsR0FBMkIsYUFBYSxtQkFBYixDQXJHd0M7O0FBdUduRSxzQkFBYyxZQUFkLEVBQTRCLElBQTVCLEVBdkdtRTtLQUF2RTs7aUJBRGlCOztnREEyR08sY0FBYztBQUNsQyxtQkFBUSxDQUFDLEtBQUssT0FBTCxJQUFnQixhQUFhLGNBQWIsRUFBakIsQ0FEMEI7Ozs7eURBSUwsS0FBSzs7QUFFbEMsZ0JBQUksT0FBTyxJQUFJLFVBQUosQ0FBZSxJQUFmLENBRnVCO0FBR2xDLGdCQUFJLENBQUMsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBRCxFQUFxQjtBQUNyQix1QkFBTyxLQUFQLENBRHFCO2FBQXpCOztBQUlBLGdCQUFJLFdBQVcsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBWCxDQVA4QjtBQVFsQyxnQkFBSSxPQUFPLFNBQVMsSUFBVCxDQVJ1QjtBQVNsQyxtQkFBTyxLQUFLLE1BQUwsR0FBYyxDQUFkLElBQW1CLEtBQUssS0FBTCxDQUFXLGtCQUFYLENBQW5CLENBVDJCOzs7O3lDQVlyQixLQUFLO0FBQ2xCLGdCQUFJLENBQUMsS0FBSyxTQUFMLENBQWUsR0FBZixDQUFELEVBQXNCO0FBQ3RCLHFCQUFLLHNCQUFMLENBQTRCLEdBQTVCLEVBRHNCO2FBQTFCOzs7OzBDQUtjLEtBQUs7O0FBRW5CLGdCQUFJLFVBQVUsSUFBVixDQUZlO0FBR25CLGVBQUc7QUFDQyx3QkFBUSxPQUFSLENBQWdCLElBQWhCLENBQXFCLEdBQXJCLEVBREQ7QUFFQywwQkFBVSxRQUFRLEtBQVIsQ0FGWDthQUFILFFBR1MsT0FIVCxFQUhtQjs7Ozt5Q0FTTixLQUFLOzs7QUFHbEIsZ0JBQUksS0FBSyxnQ0FBTCxDQUFzQyxHQUF0QyxDQUFKLEVBQWdEO0FBQzVDLHFCQUFLLGdCQUFMLENBQXNCLEdBQXRCLEVBRDRDO2FBQWhELE1BRU87QUFDSCxxQkFBSyxpQkFBTCxDQUF1QixHQUF2QixFQURHO2FBRlA7Ozs7Z0NBT0ksY0FBYztBQUNsQixnQkFBSSxRQUFKLENBRGtCO0FBRWxCLGdCQUFJLEtBQUssdUJBQUwsQ0FBNkIsWUFBN0IsQ0FBSixFQUFnRDtBQUM1QywyQkFBVyxLQUFLLGdCQUFMLENBRGlDO2FBQWhELE1BRU8sSUFBSSxLQUFLLElBQUwsS0FBYyxRQUFkLEVBQXdCO0FBQy9CLDJCQUFXLEtBQUssaUJBQUwsQ0FEb0I7YUFBNUIsTUFFQTtBQUNILDJCQUFXLEtBQUssZ0JBQUwsQ0FEUjthQUZBOzs7QUFKVyxpQkFXYixJQUFJLElBQUksQ0FBSixFQUFPLEtBQUssS0FBSyxNQUFMLENBQVksTUFBWixFQUFvQixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNsRCxvQkFBSSxNQUFNLEtBQUssTUFBTCxDQUFZLENBQVosQ0FBTixDQUQ4QztBQUVsRCx5QkFBUyxJQUFULENBQWMsSUFBZCxFQUFvQixHQUFwQixFQUZrRDthQUF0RDtBQUlBLGlCQUFLLE1BQUwsR0FBYyxJQUFkLENBZmtCOztBQWlCbEIsbUJBQU8sS0FBSyxLQUFMLENBakJXOzs7O2tDQW9CWixLQUFLO0FBQ1gsZ0JBQUksUUFBSixFQUFjLElBQWQsQ0FEVztBQUVYLG1CQUFPLElBQUksVUFBSixDQUFlLElBQWYsQ0FGSTtBQUdYLGdCQUFJLEtBQUssR0FBTCxDQUFTLEdBQVQsQ0FBYSxJQUFiLENBQUosRUFBd0I7QUFDcEIsMkJBQVcsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBWCxDQURvQjtBQUVwQix5QkFBUyxVQUFULENBQW9CLElBQXBCLENBQXlCLEdBQXpCLEVBRm9CO0FBR3BCLHlCQUFTLEtBQVQsR0FBaUIsU0FBUyxLQUFULElBQWtCLElBQUksSUFBSixDQUFTLGFBQVQsS0FBMkIsS0FBSyxhQUFMLENBSDFDO0FBSXBCLG9CQUFJLElBQUksT0FBSixFQUFhO0FBQ2IsNkJBQVMsT0FBVCxHQUFtQixJQUFuQixDQURhO0FBRWIseUJBQUssTUFBTCxDQUFZLEdBQVosQ0FBZ0IsU0FBUyxJQUFULEVBQWUsSUFBL0IsRUFGYTtpQkFBakI7QUFJQSxvQkFBSSxRQUFKLEdBQWUsUUFBZixDQVJvQjtBQVNwQix1QkFBTyxJQUFQLENBVG9CO2FBQXhCO0FBV0EsbUJBQU8sS0FBUCxDQWRXOzs7OytDQWlCUSxLQUFLO0FBQ3hCLGdCQUFJLEtBQUssS0FBTCxFQUFZO0FBQ1oscUJBQUssS0FBTCxDQUFXLE1BQVgsQ0FBa0IsSUFBbEIsQ0FBdUIsR0FBdkIsRUFEWTthQUFoQjtBQUdBLGlCQUFLLE9BQUwsQ0FBYSxJQUFiLENBQWtCLEdBQWxCLEVBSndCOzs7O3FEQU9DLFVBQVUsTUFBTTtBQUN6QyxnQkFBSSxRQUFRLElBQVIsRUFBYztBQUNkLHVCQURjO2FBQWxCOztBQUlBLGdCQUFJLFlBQVksS0FBSyxtQkFBTCxDQUF5QixHQUF6QixDQUE2QixJQUE3QixDQUFaLENBTHFDO0FBTXpDLGdCQUFJLGFBQWEsSUFBYixFQUFtQjtBQUNuQiw0QkFBWSxFQUFaLENBRG1CO0FBRW5CLHFCQUFLLG1CQUFMLENBQXlCLEdBQXpCLENBQTZCLElBQTdCLEVBQW1DLFNBQW5DLEVBRm1CO2FBQXZCO0FBSUEsZ0JBQUksVUFBVSxPQUFWLENBQWtCLFFBQWxCLE1BQWdDLENBQUMsQ0FBRCxFQUFJO0FBQ3BDLDBCQUFVLElBQVYsQ0FBZSxRQUFmLEVBRG9DO2FBQXhDOzs7O3dDQUtZLE1BQU0sS0FBSyxXQUFXLE1BQU0sS0FBSztBQUM3QyxnQkFBSSxRQUFKLENBRDZDOztBQUc3Qyx1QkFBVyxJQUFJLEdBQUosQ0FBUSxJQUFSLENBQVgsQ0FINkM7QUFJN0MsZ0JBQUksQ0FBQyxRQUFELEVBQVc7QUFDWCwyQkFBVyx1QkFBYSxJQUFiLEVBQW1CLElBQW5CLENBQVgsQ0FEVztBQUVYLG9CQUFJLEdBQUosQ0FBUSxJQUFSLEVBQWMsUUFBZCxFQUZXO0FBR1gsMEJBQVUsSUFBVixDQUFlLFFBQWYsRUFIVzthQUFmOztBQU1BLGdCQUFJLEdBQUosRUFBUztBQUNMLHlCQUFTLElBQVQsQ0FBYyxJQUFkLENBQW1CLEdBQW5CLEVBREs7QUFFTCxvQkFBSSxJQUFJLElBQUosS0FBYSxtQkFBUyxHQUFULEVBQWM7QUFDM0IseUJBQUssNEJBQUwsQ0FBa0MsUUFBbEMsRUFBNEMsSUFBSSxJQUFKLENBQTVDLENBRDJCO0FBRTNCLHlCQUFLLDRCQUFMLENBQWtDLFFBQWxDLEVBQTRDLElBQUksTUFBSixDQUE1QyxDQUYyQjtpQkFBL0I7YUFGSjtBQU9BLGdCQUFJLElBQUosRUFBVTtBQUNOLHlCQUFTLFdBQVQsQ0FBcUIsSUFBckIsQ0FBMEIsSUFBMUIsRUFETTthQUFWOzs7O2lDQUtLLE1BQU0sS0FBSztBQUNoQixnQkFBSSxRQUFRLEtBQUssSUFBTCxLQUFjLG1CQUFPLFVBQVAsRUFBbUI7QUFDekMscUJBQUssZUFBTCxDQUNRLEtBQUssSUFBTCxFQUNBLEtBQUssR0FBTCxFQUNBLEtBQUssU0FBTCxFQUNBLElBSlIsRUFLUSxHQUxSLEVBRHlDO2FBQTdDOzs7O3NDQVVVLE1BQU0sUUFBUSxXQUFXLHFCQUFxQixTQUFTLE1BQU07O0FBRXZFLGdCQUFJLENBQUMsSUFBRCxJQUFTLEtBQUssSUFBTCxLQUFjLG1CQUFPLFVBQVAsRUFBbUI7QUFDMUMsdUJBRDBDO2FBQTlDOzs7QUFGdUUsZ0JBT25FLEtBQUssSUFBTCxLQUFjLE9BQWQsRUFBdUI7QUFDdkIsdUJBRHVCO2FBQTNCOztBQUlBLGdCQUFJLE1BQU0sd0JBQWMsSUFBZCxFQUFvQixJQUFwQixFQUEwQixVQUFVLG9CQUFVLElBQVYsRUFBZ0IsU0FBcEQsRUFBK0QsbUJBQS9ELEVBQW9GLENBQUMsQ0FBQyxPQUFELEVBQVUsQ0FBQyxDQUFDLElBQUQsQ0FBdEcsQ0FYbUU7QUFZdkUsaUJBQUssVUFBTCxDQUFnQixJQUFoQixDQUFxQixHQUFyQixFQVp1RTtBQWF2RSxpQkFBSyxNQUFMLENBQVksSUFBWixDQUFpQixHQUFqQixFQWJ1RTs7Ozt1Q0FnQjVEO0FBQ1gsZ0JBQUksT0FBSixDQURXO0FBRVgsc0JBQVUsSUFBVixDQUZXO0FBR1gsaUJBQUsscUJBQUwsR0FBNkIsSUFBN0IsQ0FIVztBQUlYLGVBQUc7QUFDQyx3QkFBUSxPQUFSLEdBQWtCLElBQWxCLENBREQ7QUFFQywwQkFBVSxRQUFRLEtBQVIsQ0FGWDthQUFILFFBR1MsT0FIVCxFQUpXOzs7O3VDQVVBO0FBQ1gsaUJBQUssU0FBTCxHQUFpQixJQUFqQixDQURXOzs7O3FDQUlGO0FBQ1QsbUJBQU8sS0FBSyxNQUFMLEtBQWdCLElBQWhCLENBREU7Ozs7Ozs7Ozs7OztnQ0FVTCxPQUFPO0FBQ1gsZ0JBQUksR0FBSixFQUFTLENBQVQsRUFBWSxFQUFaLENBRFc7QUFFWCxrQ0FBTyxLQUFLLFVBQUwsRUFBUCxFQUEwQix5QkFBMUIsRUFGVztBQUdYLGtDQUFPLE1BQU0sSUFBTixLQUFlLG1CQUFPLFVBQVAsRUFBbUIsOEJBQXpDLEVBSFc7QUFJWCxpQkFBSyxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssVUFBTCxDQUFnQixNQUFoQixFQUF3QixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNsRCxzQkFBTSxLQUFLLFVBQUwsQ0FBZ0IsQ0FBaEIsQ0FBTixDQURrRDtBQUVsRCxvQkFBSSxJQUFJLFVBQUosS0FBbUIsS0FBbkIsRUFBMEI7QUFDMUIsMkJBQU8sR0FBUCxDQUQwQjtpQkFBOUI7YUFGSjtBQU1BLG1CQUFPLElBQVAsQ0FWVzs7Ozs7Ozs7Ozs7bUNBa0JKO0FBQ1AsbUJBQU8sQ0FBQyxLQUFLLE9BQUwsQ0FERDs7Ozs7Ozs7Ozs7a0RBU2U7QUFDdEIsbUJBQU8sSUFBUCxDQURzQjs7Ozs7Ozs7Ozs7NkNBU0w7QUFDakIsbUJBQU8sSUFBUCxDQURpQjs7OzttQ0FJVixNQUFNO0FBQ2IsZ0JBQUksS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLElBQWIsQ0FBSixFQUF3QjtBQUNwQix1QkFBTyxJQUFQLENBRG9CO2FBQXhCO0FBR0EsaUJBQUssSUFBSSxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssT0FBTCxDQUFhLE1BQWIsRUFBcUIsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDbkQsb0JBQUksS0FBSyxPQUFMLENBQWEsQ0FBYixFQUFnQixVQUFoQixDQUEyQixJQUEzQixLQUFvQyxJQUFwQyxFQUEwQztBQUMxQywyQkFBTyxJQUFQLENBRDBDO2lCQUE5QzthQURKO0FBS0EsbUJBQU8sS0FBUCxDQVRhOzs7O1dBaFVBOzs7OztJQTZVUjs7O0FBQ1QsYUFEUyxXQUNULENBQVksWUFBWixFQUEwQixLQUExQixFQUFpQzs4QkFEeEIsYUFDd0I7OzJFQUR4Qix3QkFFQyxjQUFjLFVBQVUsTUFBTSxPQUFPLFFBRGQ7O0FBRTdCLGNBQUssUUFBTCxHQUFnQjtBQUNaLGlCQUFLLHNCQUFMO0FBQ0EsdUJBQVcsRUFBWDs7Ozs7O0FBTUEsa0JBQU0sRUFBTjtTQVJKLENBRjZCOztLQUFqQzs7aUJBRFM7O2dDQWVELGNBQWM7QUFDbEIsZ0JBQUksV0FBVyxFQUFYLENBRGM7QUFFbEIsaUJBQUssSUFBSSxJQUFJLENBQUosRUFBTyxLQUFLLEtBQUssTUFBTCxDQUFZLE1BQVosRUFBb0IsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDbEQsb0JBQUksTUFBTSxLQUFLLE1BQUwsQ0FBWSxDQUFaLENBQU4sQ0FEOEM7QUFFbEQsb0JBQUksSUFBSSxxQkFBSixJQUE2QixDQUFDLEtBQUssR0FBTCxDQUFTLEdBQVQsQ0FBYSxJQUFJLFVBQUosQ0FBZSxJQUFmLENBQWQsRUFBb0M7QUFDakUsNkJBQVMsSUFBVCxDQUFjLElBQUkscUJBQUosQ0FBZCxDQURpRTtpQkFBckU7YUFGSjs7O0FBRmtCLGlCQVViLElBQUksSUFBSSxDQUFKLEVBQU8sS0FBSyxTQUFTLE1BQVQsRUFBaUIsSUFBSSxFQUFKLEVBQVEsRUFBRSxDQUFGLEVBQUs7QUFDL0Msb0JBQUksT0FBTyxTQUFTLENBQVQsQ0FBUCxDQUQyQztBQUUvQyxxQkFBSyxnQkFBTCxDQUFzQixLQUFLLE9BQUwsRUFDZCx5QkFDSSxtQkFBUyxzQkFBVCxFQUNBLEtBQUssT0FBTCxFQUNBLEtBQUssSUFBTCxFQUNBLElBSkosRUFLSSxJQUxKLEVBTUksSUFOSixDQURSLEVBRitDO2FBQW5EOztBQWNBLGlCQUFLLFFBQUwsQ0FBYyxJQUFkLEdBQXFCLEtBQUssTUFBTCxDQXhCSDs7QUEwQmxCLDhDQXpDSyxvREF5Q2dCLGFBQXJCLENBMUJrQjs7Ozt5Q0E2QkwsTUFBTSxLQUFLO0FBQ3hCLGdCQUFJLFFBQVEsS0FBSyxJQUFMLEtBQWMsbUJBQU8sVUFBUCxFQUFtQjtBQUN6QyxxQkFBSyxlQUFMLENBQ1EsS0FBSyxJQUFMLEVBQ0EsS0FBSyxRQUFMLENBQWMsR0FBZCxFQUNBLEtBQUssUUFBTCxDQUFjLFNBQWQsRUFDQSxJQUpSLEVBS1EsR0FMUixFQUR5QzthQUE3Qzs7OztXQTdDSztFQUFvQjs7SUF3RHBCOzs7QUFDVCxhQURTLFdBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxhQUNvQzs7c0VBRHBDLHdCQUVDLGNBQWMsVUFBVSxZQUFZLE9BQU8sUUFEUjtLQUE3Qzs7V0FEUztFQUFvQjs7SUFNcEI7OztBQUNULGFBRFMsMkJBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyw2QkFDb0M7OzRFQURwQyx3Q0FFQyxjQUFjLDRCQUE0QixZQUFZLE9BQU8sUUFEMUI7O0FBRXpDLGVBQUssUUFBTCxDQUFjLE1BQU0sRUFBTixFQUNOLHlCQUNJLG1CQUFTLFlBQVQsRUFDQSxNQUFNLEVBQU4sRUFDQSxLQUhKLEVBSUksSUFKSixFQUtJLElBTEosRUFNSSxJQU5KLENBRFIsRUFGeUM7QUFXekMsZUFBSyx1QkFBTCxHQUErQixJQUEvQixDQVh5Qzs7S0FBN0M7O1dBRFM7RUFBb0M7O0lBZ0JwQzs7O0FBQ1QsYUFEUyxVQUNULENBQVksWUFBWixFQUEwQixVQUExQixFQUFzQyxLQUF0QyxFQUE2Qzs4QkFEcEMsWUFDb0M7O3NFQURwQyx1QkFFQyxjQUFjLFNBQVMsWUFBWSxPQUFPLFFBRFA7S0FBN0M7O1dBRFM7RUFBbUI7O0lBTW5COzs7QUFDVCxhQURTLFNBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxXQUNvQzs7c0VBRHBDLHNCQUVDLGNBQWMsUUFBUSxZQUFZLE9BQU8sUUFETjtLQUE3Qzs7aUJBRFM7O2dDQUtELGNBQWM7QUFDbEIsZ0JBQUksS0FBSyx1QkFBTCxDQUE2QixZQUE3QixDQUFKLEVBQWdEO0FBQzVDLGtEQVBDLGtEQU9vQixhQUFyQixDQUQ0QzthQUFoRDs7QUFJQSxpQkFBSyxJQUFJLElBQUksQ0FBSixFQUFPLEtBQUssS0FBSyxNQUFMLENBQVksTUFBWixFQUFvQixJQUFJLEVBQUosRUFBUSxFQUFFLENBQUYsRUFBSztBQUNsRCxvQkFBSSxNQUFNLEtBQUssTUFBTCxDQUFZLENBQVosQ0FBTixDQUQ4QztBQUVsRCxvQkFBSSxPQUFKLEdBQWMsSUFBZCxDQUZrRDtBQUdsRCxxQkFBSyxzQkFBTCxDQUE0QixHQUE1QixFQUhrRDthQUF0RDtBQUtBLGlCQUFLLE1BQUwsR0FBYyxJQUFkLENBVmtCOztBQVlsQixtQkFBTyxLQUFLLEtBQUwsQ0FaVzs7OztXQUxiO0VBQWtCOztJQXFCbEI7OztBQUNULGFBRFMsUUFDVCxDQUFZLFlBQVosRUFBMEIsVUFBMUIsRUFBc0MsS0FBdEMsRUFBNkM7OEJBRHBDLFVBQ29DOztzRUFEcEMscUJBRUMsY0FBYyxPQUFPLFlBQVksT0FBTyxRQURMO0tBQTdDOztXQURTO0VBQWlCOztJQU1qQjs7O0FBQ1QsYUFEUyxVQUNULENBQVksWUFBWixFQUEwQixVQUExQixFQUFzQyxLQUF0QyxFQUE2Qzs4QkFEcEMsWUFDb0M7O3NFQURwQyx1QkFFQyxjQUFjLFNBQVMsWUFBWSxPQUFPLFFBRFA7S0FBN0M7O1dBRFM7RUFBbUI7O0lBTW5COzs7QUFDVCxhQURTLFdBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxhQUNvQzs7c0VBRHBDLHdCQUVDLGNBQWMsVUFBVSxZQUFZLE9BQU8sUUFEUjtLQUE3Qzs7V0FEUztFQUFvQjs7SUFNcEI7OztBQUNULGFBRFMsYUFDVCxDQUFZLFlBQVosRUFBMEIsVUFBMUIsRUFBc0MsS0FBdEMsRUFBNkMsa0JBQTdDLEVBQWlFOzhCQUR4RCxlQUN3RDs7Ozs7NEVBRHhELDBCQUVDLGNBQWMsWUFBWSxZQUFZLE9BQU8scUJBRFU7O0FBSzdELFlBQUksT0FBSyxLQUFMLENBQVcsSUFBWCxLQUFvQixtQkFBTyx1QkFBUCxFQUFnQztBQUNwRCxtQkFBSyxpQkFBTCxHQURvRDtTQUF4RDtzQkFMNkQ7S0FBakU7O2lCQURTOztrREFXaUI7Ozs7Ozs7OztBQVN0QixnQkFBSSxLQUFLLEtBQUwsQ0FBVyxJQUFYLEtBQW9CLG1CQUFPLHVCQUFQLEVBQWdDO0FBQ3BELHVCQUFPLEtBQVAsQ0FEb0Q7YUFBeEQ7O0FBSUEsZ0JBQUksQ0FBQyxLQUFLLFFBQUwsRUFBRCxFQUFrQjtBQUNsQix1QkFBTyxJQUFQLENBRGtCO2FBQXRCOztBQUlBLGdCQUFJLFdBQVcsS0FBSyxHQUFMLENBQVMsR0FBVCxDQUFhLFdBQWIsQ0FBWCxDQWpCa0I7QUFrQnRCLGtDQUFPLFFBQVAsRUFBaUIsaUNBQWpCLEVBbEJzQjtBQW1CdEIsbUJBQU8sU0FBUyxPQUFULElBQW9CLFNBQVMsVUFBVCxDQUFvQixNQUFwQixLQUFnQyxDQUFoQyxDQW5CTDs7Ozs2Q0FzQkw7QUFDakIsZ0JBQUksQ0FBQyxLQUFLLFFBQUwsRUFBRCxFQUFrQjtBQUNsQix1QkFBTyxJQUFQLENBRGtCO2FBQXRCO0FBR0EsbUJBQU8sS0FBSyxTQUFMLENBSlU7Ozs7NENBT0Q7QUFDaEIsaUJBQUssZUFBTCxDQUNRLFdBRFIsRUFFUSxLQUFLLEdBQUwsRUFDQSxLQUFLLFNBQUwsRUFDQSxJQUpSLEVBS1EsSUFMUixFQURnQjtBQU9oQixpQkFBSyxNQUFMLENBQVksR0FBWixDQUFnQixXQUFoQixFQUE2QixJQUE3QixFQVBnQjs7OztXQXhDWDtFQUFzQjs7SUFtRHRCOzs7QUFDVCxhQURTLFFBQ1QsQ0FBWSxZQUFaLEVBQTBCLFVBQTFCLEVBQXNDLEtBQXRDLEVBQTZDOzhCQURwQyxVQUNvQzs7c0VBRHBDLHFCQUVDLGNBQWMsT0FBTyxZQUFZLE9BQU8sUUFETDtLQUE3Qzs7V0FEUztFQUFpQjs7SUFNakI7OztBQUNULGFBRFMsVUFDVCxDQUFZLFlBQVosRUFBMEIsVUFBMUIsRUFBc0MsS0FBdEMsRUFBNkM7OEJBRHBDLFlBQ29DOztzRUFEcEMsdUJBRUMsY0FBYyxTQUFTLFlBQVksT0FBTyxRQURQO0tBQTdDOztXQURTO0VBQW1CIiwiZmlsZSI6InNjb3BlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLypcbiAgQ29weXJpZ2h0IChDKSAyMDE1IFl1c3VrZSBTdXp1a2kgPHV0YXRhbmUudGVhQGdtYWlsLmNvbT5cblxuICBSZWRpc3RyaWJ1dGlvbiBhbmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXRcbiAgbW9kaWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGFyZSBtZXQ6XG5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBtdXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuXG4gICAgKiBSZWRpc3RyaWJ1dGlvbnMgaW4gYmluYXJ5IGZvcm0gbXVzdCByZXByb2R1Y2UgdGhlIGFib3ZlIGNvcHlyaWdodFxuICAgICAgbm90aWNlLCB0aGlzIGxpc3Qgb2YgY29uZGl0aW9ucyBhbmQgdGhlIGZvbGxvd2luZyBkaXNjbGFpbWVyIGluIHRoZVxuICAgICAgZG9jdW1lbnRhdGlvbiBhbmQvb3Igb3RoZXIgbWF0ZXJpYWxzIHByb3ZpZGVkIHdpdGggdGhlIGRpc3RyaWJ1dGlvbi5cblxuICBUSElTIFNPRlRXQVJFIElTIFBST1ZJREVEIEJZIFRIRSBDT1BZUklHSFQgSE9MREVSUyBBTkQgQ09OVFJJQlVUT1JTIFwiQVMgSVNcIlxuICBBTkQgQU5ZIEVYUFJFU1MgT1IgSU1QTElFRCBXQVJSQU5USUVTLCBJTkNMVURJTkcsIEJVVCBOT1QgTElNSVRFRCBUTywgVEhFXG4gIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkgQU5EIEZJVE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFXG4gIEFSRSBESVNDTEFJTUVELiBJTiBOTyBFVkVOVCBTSEFMTCA8Q09QWVJJR0hUIEhPTERFUj4gQkUgTElBQkxFIEZPUiBBTllcbiAgRElSRUNULCBJTkRJUkVDVCwgSU5DSURFTlRBTCwgU1BFQ0lBTCwgRVhFTVBMQVJZLCBPUiBDT05TRVFVRU5USUFMIERBTUFHRVNcbiAgKElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBQUk9DVVJFTUVOVCBPRiBTVUJTVElUVVRFIEdPT0RTIE9SIFNFUlZJQ0VTO1xuICBMT1NTIE9GIFVTRSwgREFUQSwgT1IgUFJPRklUUzsgT1IgQlVTSU5FU1MgSU5URVJSVVBUSU9OKSBIT1dFVkVSIENBVVNFRCBBTkRcbiAgT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAgKElOQ0xVRElORyBORUdMSUdFTkNFIE9SIE9USEVSV0lTRSkgQVJJU0lORyBJTiBBTlkgV0FZIE9VVCBPRiBUSEUgVVNFIE9GXG4gIFRISVMgU09GVFdBUkUsIEVWRU4gSUYgQURWSVNFRCBPRiBUSEUgUE9TU0lCSUxJVFkgT0YgU1VDSCBEQU1BR0UuXG4qL1xuXG5pbXBvcnQgeyBTeW50YXggfSBmcm9tICdlc3RyYXZlcnNlJztcbmltcG9ydCBNYXAgZnJvbSAnZXM2LW1hcCc7XG5cbmltcG9ydCBSZWZlcmVuY2UgZnJvbSAnLi9yZWZlcmVuY2UnO1xuaW1wb3J0IFZhcmlhYmxlIGZyb20gJy4vdmFyaWFibGUnO1xuaW1wb3J0IERlZmluaXRpb24gZnJvbSAnLi9kZWZpbml0aW9uJztcbmltcG9ydCBhc3NlcnQgZnJvbSAnYXNzZXJ0JztcblxuZnVuY3Rpb24gaXNTdHJpY3RTY29wZShzY29wZSwgYmxvY2ssIGlzTWV0aG9kRGVmaW5pdGlvbiwgdXNlRGlyZWN0aXZlKSB7XG4gICAgdmFyIGJvZHksIGksIGl6LCBzdG10LCBleHByO1xuXG4gICAgLy8gV2hlbiB1cHBlciBzY29wZSBpcyBleGlzdHMgYW5kIHN0cmljdCwgaW5uZXIgc2NvcGUgaXMgYWxzbyBzdHJpY3QuXG4gICAgaWYgKHNjb3BlLnVwcGVyICYmIHNjb3BlLnVwcGVyLmlzU3RyaWN0KSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIC8vIEFycm93RnVuY3Rpb25FeHByZXNzaW9uJ3Mgc2NvcGUgaXMgYWx3YXlzIHN0cmljdCBzY29wZS5cbiAgICBpZiAoYmxvY2sudHlwZSA9PT0gU3ludGF4LkFycm93RnVuY3Rpb25FeHByZXNzaW9uKSB7XG4gICAgICAgIHJldHVybiB0cnVlO1xuICAgIH1cblxuICAgIGlmIChpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdjbGFzcycgfHwgc2NvcGUudHlwZSA9PT0gJ21vZHVsZScpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuXG4gICAgaWYgKHNjb3BlLnR5cGUgPT09ICdibG9jaycgfHwgc2NvcGUudHlwZSA9PT0gJ3N3aXRjaCcpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cblxuICAgIGlmIChzY29wZS50eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgIGlmIChibG9jay50eXBlID09PSBTeW50YXguUHJvZ3JhbSkge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgYm9keSA9IGJsb2NrLmJvZHk7XG4gICAgICAgIH1cbiAgICB9IGVsc2UgaWYgKHNjb3BlLnR5cGUgPT09ICdnbG9iYWwnKSB7XG4gICAgICAgIGJvZHkgPSBibG9jaztcbiAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gU2VhcmNoICd1c2Ugc3RyaWN0JyBkaXJlY3RpdmUuXG4gICAgaWYgKHVzZURpcmVjdGl2ZSkge1xuICAgICAgICBmb3IgKGkgPSAwLCBpeiA9IGJvZHkuYm9keS5sZW5ndGg7IGkgPCBpejsgKytpKSB7XG4gICAgICAgICAgICBzdG10ID0gYm9keS5ib2R5W2ldO1xuICAgICAgICAgICAgaWYgKHN0bXQudHlwZSAhPT0gU3ludGF4LkRpcmVjdGl2ZVN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKHN0bXQucmF3ID09PSAnXCJ1c2Ugc3RyaWN0XCInIHx8IHN0bXQucmF3ID09PSAnXFwndXNlIHN0cmljdFxcJycpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICAgIGZvciAoaSA9IDAsIGl6ID0gYm9keS5ib2R5Lmxlbmd0aDsgaSA8IGl6OyArK2kpIHtcbiAgICAgICAgICAgIHN0bXQgPSBib2R5LmJvZHlbaV07XG4gICAgICAgICAgICBpZiAoc3RtdC50eXBlICE9PSBTeW50YXguRXhwcmVzc2lvblN0YXRlbWVudCkge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZXhwciA9IHN0bXQuZXhwcmVzc2lvbjtcbiAgICAgICAgICAgIGlmIChleHByLnR5cGUgIT09IFN5bnRheC5MaXRlcmFsIHx8IHR5cGVvZiBleHByLnZhbHVlICE9PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgaWYgKGV4cHIucmF3ICE9IG51bGwpIHtcbiAgICAgICAgICAgICAgICBpZiAoZXhwci5yYXcgPT09ICdcInVzZSBzdHJpY3RcIicgfHwgZXhwci5yYXcgPT09ICdcXCd1c2Ugc3RyaWN0XFwnJykge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGlmIChleHByLnZhbHVlID09PSAndXNlIHN0cmljdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbn1cblxuZnVuY3Rpb24gcmVnaXN0ZXJTY29wZShzY29wZU1hbmFnZXIsIHNjb3BlKSB7XG4gICAgdmFyIHNjb3BlcztcblxuICAgIHNjb3BlTWFuYWdlci5zY29wZXMucHVzaChzY29wZSk7XG5cbiAgICBzY29wZXMgPSBzY29wZU1hbmFnZXIuX19ub2RlVG9TY29wZS5nZXQoc2NvcGUuYmxvY2spO1xuICAgIGlmIChzY29wZXMpIHtcbiAgICAgICAgc2NvcGVzLnB1c2goc2NvcGUpO1xuICAgIH0gZWxzZSB7XG4gICAgICAgIHNjb3BlTWFuYWdlci5fX25vZGVUb1Njb3BlLnNldChzY29wZS5ibG9jaywgWyBzY29wZSBdKTtcbiAgICB9XG59XG5cbmZ1bmN0aW9uIHNob3VsZEJlU3RhdGljYWxseShkZWYpIHtcbiAgICByZXR1cm4gKFxuICAgICAgICAoZGVmLnR5cGUgPT09IFZhcmlhYmxlLkNsYXNzTmFtZSkgfHxcbiAgICAgICAgKGRlZi50eXBlID09PSBWYXJpYWJsZS5WYXJpYWJsZSAmJiBkZWYucGFyZW50LmtpbmQgIT09ICd2YXInKVxuICAgICk7XG59XG5cbi8qKlxuICogQGNsYXNzIFNjb3BlXG4gKi9cbmV4cG9ydCBkZWZhdWx0IGNsYXNzIFNjb3BlIHtcbiAgICBjb25zdHJ1Y3RvcihzY29wZU1hbmFnZXIsIHR5cGUsIHVwcGVyU2NvcGUsIGJsb2NrLCBpc01ldGhvZERlZmluaXRpb24pIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIE9uZSBvZiAnVERaJywgJ21vZHVsZScsICdibG9jaycsICdzd2l0Y2gnLCAnZnVuY3Rpb24nLCAnY2F0Y2gnLCAnd2l0aCcsICdmdW5jdGlvbicsICdjbGFzcycsICdnbG9iYWwnLlxuICAgICAgICAgKiBAbWVtYmVyIHtTdHJpbmd9IFNjb3BlI3R5cGVcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudHlwZSA9IHR5cGU7XG4gICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHNjb3BlZCB7QGxpbmsgVmFyaWFibGV9cyBvZiB0aGlzIHNjb3BlLCBhcyA8Y29kZT57IFZhcmlhYmxlLm5hbWVcbiAgICAgICAgICogOiBWYXJpYWJsZSB9PC9jb2RlPi5cbiAgICAgICAgICogQG1lbWJlciB7TWFwfSBTY29wZSNzZXRcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuc2V0ID0gbmV3IE1hcCgpO1xuICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHRhaW50ZWQgdmFyaWFibGVzIG9mIHRoaXMgc2NvcGUsIGFzIDxjb2RlPnsgVmFyaWFibGUubmFtZSA6XG4gICAgICAgICAqIGJvb2xlYW4gfTwvY29kZT4uXG4gICAgICAgICAqIEBtZW1iZXIge01hcH0gU2NvcGUjdGFpbnRzICovXG4gICAgICAgIHRoaXMudGFpbnRzID0gbmV3IE1hcCgpO1xuICAgICAgICAvKipcbiAgICAgICAgICogR2VuZXJhbGx5LCB0aHJvdWdoIHRoZSBsZXhpY2FsIHNjb3Bpbmcgb2YgSlMgeW91IGNhbiBhbHdheXMga25vd1xuICAgICAgICAgKiB3aGljaCB2YXJpYWJsZSBhbiBpZGVudGlmaWVyIGluIHRoZSBzb3VyY2UgY29kZSByZWZlcnMgdG8uIFRoZXJlIGFyZVxuICAgICAgICAgKiBhIGZldyBleGNlcHRpb25zIHRvIHRoaXMgcnVsZS4gV2l0aCAnZ2xvYmFsJyBhbmQgJ3dpdGgnIHNjb3BlcyB5b3VcbiAgICAgICAgICogY2FuIG9ubHkgZGVjaWRlIGF0IHJ1bnRpbWUgd2hpY2ggdmFyaWFibGUgYSByZWZlcmVuY2UgcmVmZXJzIHRvLlxuICAgICAgICAgKiBNb3Jlb3ZlciwgaWYgJ2V2YWwoKScgaXMgdXNlZCBpbiBhIHNjb3BlLCBpdCBtaWdodCBpbnRyb2R1Y2UgbmV3XG4gICAgICAgICAqIGJpbmRpbmdzIGluIHRoaXMgb3IgaXRzIHBhcmVudCBzY29wZXMuXG4gICAgICAgICAqIEFsbCB0aG9zZSBzY29wZXMgYXJlIGNvbnNpZGVyZWQgJ2R5bmFtaWMnLlxuICAgICAgICAgKiBAbWVtYmVyIHtib29sZWFufSBTY29wZSNkeW5hbWljXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmR5bmFtaWMgPSB0aGlzLnR5cGUgPT09ICdnbG9iYWwnIHx8IHRoaXMudHlwZSA9PT0gJ3dpdGgnO1xuICAgICAgICAvKipcbiAgICAgICAgICogQSByZWZlcmVuY2UgdG8gdGhlIHNjb3BlLWRlZmluaW5nIHN5bnRheCBub2RlLlxuICAgICAgICAgKiBAbWVtYmVyIHtlc3ByaW1hLk5vZGV9IFNjb3BlI2Jsb2NrXG4gICAgICAgICAqL1xuICAgICAgICB0aGlzLmJsb2NrID0gYmxvY2s7XG4gICAgICAgICAvKipcbiAgICAgICAgICogVGhlIHtAbGluayBSZWZlcmVuY2V8cmVmZXJlbmNlc30gdGhhdCBhcmUgbm90IHJlc29sdmVkIHdpdGggdGhpcyBzY29wZS5cbiAgICAgICAgICogQG1lbWJlciB7UmVmZXJlbmNlW119IFNjb3BlI3Rocm91Z2hcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMudGhyb3VnaCA9IFtdO1xuICAgICAgICAgLyoqXG4gICAgICAgICAqIFRoZSBzY29wZWQge0BsaW5rIFZhcmlhYmxlfXMgb2YgdGhpcyBzY29wZS4gSW4gdGhlIGNhc2Ugb2YgYVxuICAgICAgICAgKiAnZnVuY3Rpb24nIHNjb3BlIHRoaXMgaW5jbHVkZXMgdGhlIGF1dG9tYXRpYyBhcmd1bWVudCA8ZW0+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..cafd5ce2f6a12e 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,16 @@ 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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZhcmlhYmxlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0lBNkJxQixXQUNqQixTQURpQixRQUNqQixDQUFZLElBQVosRUFBa0IsS0FBbEIsRUFBeUI7d0JBRFIsVUFDUTs7Ozs7O0FBS3JCLE9BQUssSUFBTCxHQUFZLElBQVo7Ozs7OztBQUxxQixNQVdyQixDQUFLLFdBQUwsR0FBbUIsRUFBbkI7Ozs7Ozs7QUFYcUIsTUFrQnJCLENBQUssVUFBTCxHQUFrQixFQUFsQjs7Ozs7OztBQWxCcUIsTUF5QnJCLENBQUssSUFBTCxHQUFZLEVBQVosQ0F6QnFCOztBQTJCckIsT0FBSyxPQUFMLEdBQWUsS0FBZjs7Ozs7QUEzQnFCLE1BZ0NyQixDQUFLLEtBQUwsR0FBYSxJQUFiOzs7OztBQWhDcUIsTUFxQ3JCLENBQUssS0FBTCxHQUFhLEtBQWIsQ0FyQ3FCO0NBQXpCOztrQkFEaUI7O0FBMENyQixTQUFTLFdBQVQsR0FBdUIsYUFBdkI7QUFDQSxTQUFTLFNBQVQsR0FBcUIsV0FBckI7QUFDQSxTQUFTLFlBQVQsR0FBd0IsY0FBeEI7QUFDQSxTQUFTLFNBQVQsR0FBcUIsV0FBckI7QUFDQSxTQUFTLFFBQVQsR0FBb0IsVUFBcEI7QUFDQSxTQUFTLGFBQVQsR0FBeUIsZUFBekI7QUFDQSxTQUFTLEdBQVQsR0FBZSxLQUFmO0FBQ0EsU0FBUyxzQkFBVCxHQUFrQyx3QkFBbEMiLCJmaWxlIjoidmFyaWFibGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICBDb3B5cmlnaHQgKEMpIDIwMTUgWXVzdWtlIFN1enVraSA8dXRhdGFuZS50ZWFAZ21haWwuY29tPlxuXG4gIFJlZGlzdHJpYnV0aW9uIGFuZCB1c2UgaW4gc291cmNlIGFuZCBiaW5hcnkgZm9ybXMsIHdpdGggb3Igd2l0aG91dFxuICBtb2RpZmljYXRpb24sIGFyZSBwZXJtaXR0ZWQgcHJvdmlkZWQgdGhhdCB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgYXJlIG1ldDpcblxuICAgICogUmVkaXN0cmlidXRpb25zIG9mIHNvdXJjZSBjb2RlIG11c3QgcmV0YWluIHRoZSBhYm92ZSBjb3B5cmlnaHRcbiAgICAgIG5vdGljZSwgdGhpcyBsaXN0IG9mIGNvbmRpdGlvbnMgYW5kIHRoZSBmb2xsb3dpbmcgZGlzY2xhaW1lci5cbiAgICAqIFJlZGlzdHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJpZ2h0XG4gICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIgaW4gdGhlXG4gICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBtYXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLlxuXG4gIFRISVMgU09GVFdBUkUgSVMgUFJPVklERUQgQlkgVEhFIENPUFlSSUdIVCBIT0xERVJTIEFORCBDT05UUklCVVRPUlMgXCJBUyBJU1wiXG4gIEFORCBBTlkgRVhQUkVTUyBPUiBJTVBMSUVEIFdBUlJBTlRJRVMsIElOQ0xVRElORywgQlVUIE5PVCBMSU1JVEVEIFRPLCBUSEVcbiAgSU1QTElFRCBXQVJSQU5USUVTIE9GIE1FUkNIQU5UQUJJTElUWSBBTkQgRklUTkVTUyBGT1IgQSBQQVJUSUNVTEFSIFBVUlBPU0VcbiAgQVJFIERJU0NMQUlNRUQuIElOIE5PIEVWRU5UIFNIQUxMIDxDT1BZUklHSFQgSE9MREVSPiBCRSBMSUFCTEUgRk9SIEFOWVxuICBESVJFQ1QsIElORElSRUNULCBJTkNJREVOVEFMLCBTUEVDSUFMLCBFWEVNUExBUlksIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFU1xuICAoSU5DTFVESU5HLCBCVVQgTk9UIExJTUlURUQgVE8sIFBST0NVUkVNRU5UIE9GIFNVQlNUSVRVVEUgR09PRFMgT1IgU0VSVklDRVM7XG4gIExPU1MgT0YgVVNFLCBEQVRBLCBPUiBQUk9GSVRTOyBPUiBCVVNJTkVTUyBJTlRFUlJVUFRJT04pIEhPV0VWRVIgQ0FVU0VEIEFORFxuICBPTiBBTlkgVEhFT1JZIE9GIExJQUJJTElUWSwgV0hFVEhFUiBJTiBDT05UUkFDVCwgU1RSSUNUIExJQUJJTElUWSwgT1IgVE9SVFxuICAoSU5DTFVESU5HIE5FR0xJR0VOQ0UgT1IgT1RIRVJXSVNFKSBBUklTSU5HIElOIEFOWSBXQVkgT1VUIE9GIFRIRSBVU0UgT0ZcbiAgVEhJUyBTT0ZUV0FSRSwgRVZFTiBJRiBBRFZJU0VEIE9GIFRIRSBQT1NTSUJJTElUWSBPRiBTVUNIIERBTUFHRS5cbiovXG5cbi8qKlxuICogQSBWYXJpYWJsZSByZXByZXNlbnRzIGEgbG9jYWxseSBzY29wZWQgaWRlbnRpZmllci4gVGhlc2UgaW5jbHVkZSBhcmd1bWVudHMgdG9cbiAqIGZ1bmN0aW9ucy5cbiAqIEBjbGFzcyBWYXJpYWJsZVxuICovXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBWYXJpYWJsZSB7XG4gICAgY29uc3RydWN0b3IobmFtZSwgc2NvcGUpIHtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIFRoZSB2YXJpYWJsZSBuYW1lLCBhcyBnaXZlbiBpbiB0aGUgc291cmNlIGNvZGUuXG4gICAgICAgICAqIEBtZW1iZXIge1N0cmluZ30gVmFyaWFibGUjbmFtZVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5uYW1lID0gbmFtZTtcbiAgICAgICAgLyoqXG4gICAgICAgICAqIExpc3Qgb2YgZGVmaW5pbmcgb2NjdXJyZW5jZXMgb2YgdGhpcyB2YXJpYWJsZSAobGlrZSBpbiAndmFyIC4uLidcbiAgICAgICAgICogc3RhdGVtZW50cyBvciBhcyBwYXJhbWV0ZXIpLCBhcyBBU1Qgbm9kZXMuXG4gICAgICAgICAqIEBtZW1iZXIge2VzcHJpbWEuSWRlbnRpZmllcltdfSBWYXJpYWJsZSNpZGVudGlmaWVyc1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5pZGVudGlmaWVycyA9IFtdO1xuICAgICAgICAvKipcbiAgICAgICAgICogTGlzdCBvZiB7QGxpbmsgUmVmZXJlbmNlfHJlZmVyZW5jZXN9IG9mIHRoaXMgdmFyaWFibGUgKGV4Y2x1ZGluZyBwYXJhbWV0ZXIgZW50cmllcylcbiAgICAgICAgICogaW4gaXRzIGRlZmluaW5nIHNjb3BlIGFuZCBhbGwgbmVzdGVkIHNjb3Blcy4gRm9yIGRlZmluaW5nXG4gICAgICAgICAqIG9jY3VycmVuY2VzIG9ubHkgc2VlIHtAbGluayBWYXJpYWJsZSNkZWZzfS5cbiAgICAgICAgICogQG1lbWJlciB7UmVmZXJlbmNlW119IFZhcmlhYmxlI3JlZmVyZW5jZXNcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMucmVmZXJlbmNlcyA9IFtdO1xuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiBMaXN0IG9mIGRlZmluaW5nIG9jY3VycmVuY2VzIG9mIHRoaXMgdmFyaWFibGUgKGxpa2UgaW4gJ3ZhciAuLi4nXG4gICAgICAgICAqIHN0YXRlbWVudHMgb3IgYXMgcGFyYW1ldGVyKSwgYXMgY3VzdG9tIG9iamVjdHMuXG4gICAgICAgICAqIEBtZW1iZXIge0RlZmluaXRpb25bXX0gVmFyaWFibGUjZGVmc1xuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5kZWZzID0gW107XG5cbiAgICAgICAgdGhpcy50YWludGVkID0gZmFsc2U7XG4gICAgICAgIC8qKlxuICAgICAgICAgKiBXaGV0aGVyIHRoaXMgaXMgYSBzdGFjayB2YXJpYWJsZS5cbiAgICAgICAgICogQG1lbWJlciB7Ym9vbGVhbn0gVmFyaWFibGUjc3RhY2tcbiAgICAgICAgICovXG4gICAgICAgIHRoaXMuc3RhY2sgPSB0cnVlO1xuICAgICAgICAvKipcbiAgICAgICAgICogUmVmZXJlbmNlIHRvIHRoZSBlbmNsb3NpbmcgU2NvcGUuXG4gICAgICAgICAqIEBtZW1iZXIge1Njb3BlfSBWYXJpYWJsZSNzY29wZVxuICAgICAgICAgKi9cbiAgICAgICAgdGhpcy5zY29wZSA9IHNjb3BlO1xuICAgIH1cbn1cblxuVmFyaWFibGUuQ2F0Y2hDbGF1c2UgPSAnQ2F0Y2hDbGF1c2UnO1xuVmFyaWFibGUuUGFyYW1ldGVyID0gJ1BhcmFtZXRlcic7XG5WYXJpYWJsZS5GdW5jdGlvbk5hbWUgPSAnRnVuY3Rpb25OYW1lJztcblZhcmlhYmxlLkNsYXNzTmFtZSA9ICdDbGFzc05hbWUnO1xuVmFyaWFibGUuVmFyaWFibGUgPSAnVmFyaWFibGUnO1xuVmFyaWFibGUuSW1wb3J0QmluZGluZyA9ICdJbXBvcnRCaW5kaW5nJztcblZhcmlhYmxlLlREWiA9ICdURFonO1xuVmFyaWFibGUuSW1wbGljaXRHbG9iYWxWYXJpYWJsZSA9ICdJbXBsaWNpdEdsb2JhbFZhcmlhYmxlJztcblxuLyogdmltOiBzZXQgc3c9NCB0cz00IGV0IHR3PTgwIDogKi9cbiJdLCJzb3VyY2VSb290IjoiL3NvdXJjZS8ifQ==
      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-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/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/.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/.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/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/.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/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/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-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/.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-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/.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/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/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/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-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/.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/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/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/.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/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/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/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/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/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/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/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/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/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/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..7fa28a7f6a782a 100644
      --- a/tools/eslint/node_modules/escope/package.json
      +++ b/tools/eslint/node_modules/escope/package.json
      @@ -1,82 +1,109 @@
       {
      -  "name": "escope",
      +  "_args": [
      +    [
      +      "escope@^3.4.0",
      +      "/Users/trott/test/node_modules/eslint"
      +    ]
      +  ],
      +  "_from": "escope@>=3.4.0 <4.0.0",
      +  "_id": "escope@3.4.0",
      +  "_inCache": true,
      +  "_installable": true,
      +  "_location": "/eslint/escope",
      +  "_nodeVersion": "4.2.2",
      +  "_npmUser": {
      +    "email": "npm@michael.ficarra.me",
      +    "name": "michaelficarra"
      +  },
      +  "_npmVersion": "2.14.7",
      +  "_phantomChildren": {},
      +  "_requested": {
      +    "name": "escope",
      +    "raw": "escope@^3.4.0",
      +    "rawSpec": "^3.4.0",
      +    "scope": null,
      +    "spec": ">=3.4.0 <4.0.0",
      +    "type": "range"
      +  },
      +  "_requiredBy": [
      +    "/eslint"
      +  ],
      +  "_resolved": "https://registry.npmjs.org/escope/-/escope-3.4.0.tgz",
      +  "_shasum": "488c646b682c313f0eb1a7350d39e8e4af5e6a69",
      +  "_shrinkwrap": null,
      +  "_spec": "escope@^3.4.0",
      +  "_where": "/Users/trott/test/node_modules/eslint",
      +  "bugs": {
      +    "url": "https://github.com/estools/escope/issues"
      +  },
      +  "dependencies": {
      +    "es6-map": "^0.1.3",
      +    "es6-weak-map": "^2.0.1",
      +    "esrecurse": "^3.1.1",
      +    "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": "^2.2.5",
      +    "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": "488c646b682c313f0eb1a7350d39e8e4af5e6a69",
      +    "tarball": "http://registry.npmjs.org/escope/-/escope-3.4.0.tgz"
      +  },
         "engines": {
           "node": ">=0.4.0"
         },
      +  "gitHead": "69145ebb4b7ebda6ca87d6235491c26447d5c82a",
      +  "homepage": "http://github.com/estools/escope",
      +  "license": "BSD-2-Clause",
      +  "main": "lib/index.js",
         "maintainers": [
           {
      -      "name": "constellation",
      -      "email": "utatane.tea@gmail.com"
      +      "email": "utatane.tea@gmail.com",
      +      "name": "constellation"
      +    },
      +    {
      +      "email": "npm@michael.ficarra.me",
      +      "name": "michaelficarra"
           },
           {
      -      "name": "michaelficarra",
      -      "email": "npm@michael.ficarra.me"
      +      "email": "nicholas@nczconsulting.com",
      +      "name": "nzakas"
           }
         ],
      +  "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.4.0"
       }
      diff --git a/tools/eslint/node_modules/escope/src/index.js b/tools/eslint/node_modules/escope/src/index.js
      index 66a6ea9b6d2f9c..bc9e176ef43e05 100644
      --- a/tools/eslint/node_modules/escope/src/index.js
      +++ b/tools/eslint/node_modules/escope/src/index.js
      @@ -62,6 +62,7 @@ function defaultOptions() {
               optimistic: false,
               directive: false,
               nodejsScope: false,
      +        impliedStrict: false,
               sourceType: 'script',  // one of ['script', 'module']
               ecmaVersion: 5
           };
      @@ -103,6 +104,8 @@ 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
        * @return {ScopeManager}
      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..a6761a4384e029
      --- /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(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
      +        });
      +    }
      +
      +    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..e09768d7e28750 100644
      --- a/tools/eslint/node_modules/escope/src/referencer.js
      +++ b/tools/eslint/node_modules/escope/src/referencer.js
      @@ -25,118 +25,10 @@ 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) {
           // Call the callback at left hand identifier nodes, and Collect right hand nodes.
           var visitor = new PatternVisitor(rootPattern, callback);
      @@ -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
      @@ -387,7 +267,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 +337,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 +392,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 +405,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);
      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/espree/README.md b/tools/eslint/node_modules/espree/README.md
      index b6c2001f1168ed..09e906c0bf9e41 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,
      -
      -        // enable parsing of generators/yield
      -        generators: true,
      +    // specify the language version (3, 5, or 6, default is 5)
      +    ecmaVersion: 5,
       
      -        // enable parsing spread operator
      -        spread: true,
      +    // specify which type of script you're parsing (script or module, default is script)
      +    sourceType: "script",
       
      -        // 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,53 @@ 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.
      -
      -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.
      +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.
       
      -### 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?
      -
      -* Faster turnaround time on bug fixes
      -* More frequent releases
      -* Better communication and responsiveness to issues
      -* Ongoing development
      -
      -### 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..e085d2d5228992 100644
      --- a/tools/eslint/node_modules/espree/espree.js
      +++ b/tools/eslint/node_modules/espree/espree.js
      @@ -1,5318 +1,543 @@
      -/*
      -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]
      -    };
      -}
      -
      -/**
      - * 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
      ; - * - * 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)); -} +/* eslint no-undefined:0, no-use-before-define: 0 */ -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; - } - } +"use strict"; - 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)); -} +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"); -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)); - } - } - if (matchContextualKeyword("from")) { - throwError({}, Messages.UnexpectedToken, lookahead.value); - } +var acorn = acornJSX(rawAcorn); - // 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)); +var lookahead, + extra, + lastToken; + +/** + * 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, + Parser = acorn.Parser, + pp = Parser.prototype, + 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 "Identifier": + return !extra.isModule || node.name !== "await"; - imported = parseNonComputedProperty(); - if (matchContextualKeyword("as")) { - lex(); - local = parseVariableIdentifier(); - } + case "ExperimentalSpreadProperty": + case "ExperimentalRestProperty": + return ecma.experimentalObjectRestSpread; - return markerApply(marker, astNodeFactory.createImportSpecifier(local, imported)); -} + case "ImportDeclaration": + case "ExportNamedDeclaration": + case "ExportDefaultDeclaration": + case "ExportAllDeclaration": + return extra.isModule; -function parseNamedImports() { - var specifiers = []; - // {foo, bar as bas} - expect("{"); - if (!match("}")) { - do { - specifiers.push(parseImportSpecifier()); - } while (match(",") && lex()); + default: + return true; } - expect("}"); - return specifiers; -} - -function parseImportDefaultSpecifier() { - // import ...; - var local, marker = markerCreate(); - - local = parseNonComputedProperty(); - - return markerApply(marker, astNodeFactory.createImportDefaultSpecifier(local)); } -function parseImportNamespaceSpecifier() { - // import <* as foo> ...; - var local, marker = markerCreate(); - - expect("*"); - if (!matchContextualKeyword("as")) { - throwError({}, Messages.NoAsAfterImportNamespace); +/** + * 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); } - lex(); - local = parseNonComputedProperty(); - return markerApply(marker, astNodeFactory.createImportNamespaceSpecifier(local)); -} + // https://github.com/marijnh/acorn/issues/323 + if (result.type === "TryStatement") { + delete result.guardedHandlers; + } else if (result.type === "CatchClause") { + delete result.guard; + } -function parseImportDeclaration() { - var specifiers, src, marker = markerCreate(); + // 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") { - if (state.inFunctionBody) { - throwError({}, Messages.IllegalImportDeclaration); - } + // additional adjustment needed if ${ is the last token + var terminalDollarBraceL = this.input.slice(result.end, result.end + 2) === "${"; - expectKeyword("import"); - specifiers = []; + if (result.range) { + result.range[0]--; + result.range[1] += (terminalDollarBraceL ? 2 : 1); + } - if (lookahead.type === Token.StringLiteral) { - // covers: - // import "foo"; - src = parseModuleSpecifier(); - consumeSemicolon(); - return markerApply(marker, astNodeFactory.createImportDeclaration(specifiers, src)); + if (result.loc) { + result.loc.start.column--; + result.loc.end.column += (terminalDollarBraceL ? 2 : 1); + } } - if (!matchKeyword("default") && isIdentifierName(lookahead)) { - // covers: - // import foo - // import foo, ... - specifiers.push(parseImportDefaultSpecifier()); - if (match(",")) { - lex(); + // 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"); } } - 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()); + + // Acorn uses undefined instead of null, which affects serialization + if (result.type === "Literal" && result.value === undefined) { + result.value = null; } - if (!matchContextualKeyword("from")) { - throwError({}, lookahead.value ? - Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value); + if (extra.attachComment) { + commentAttachment.processComment(result); } - lex(); - src = parseModuleSpecifier(); - consumeSemicolon(); - return markerApply(marker, astNodeFactory.createImportDeclaration(specifiers, src)); -} + if (result.type.indexOf("Function") > -1 && !result.generator) { + result.generator = false; + } -// 14 Functions and classes + return result; +} -// 14.1 Functions is defined above (13 in ES5) -// 14.2 Arrow Functions Definitions is defined in (7.3 assignments) +/** + * 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.3 Method Definitions -// 14.3.7 + switch (type) { + case tt.jsxName: + case tt.jsxText: + case tt.jsxTagStart: + case tt.jsxTagEnd: + return ecma.jsx; -// 14.5 Class Definitions + // 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; + } -function parseClassBody() { - var hasConstructor = false, generator = false, - allowGenerators = extra.ecmaFeatures.generators, - token, isStatic, body = [], method, computed, key; + return true; - var existingProps = {}, - topMarker = markerCreate(), - marker; + default: + return true; + } +} - existingProps.static = new StringMap(); - existingProps.prototype = new StringMap(); +/** + * 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); + }; +} - expect("{"); +pp.extend("finishNode", wrapFinishNode); - while (!match("}")) { +pp.extend("finishNodeAt", wrapFinishNode); - // extra semicolons are fine - if (match(";")) { - lex(); - continue; +pp.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 +pp.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); + } } - lex(); + return undefined; } - key = parseObjectPropertyKey(); + return checkLVal.call(this, expr, isBinding, checkClashes); + }; +}); - // static generator methods - if (key.name === "static" && match("*")) { - if (!allowGenerators) { - throwUnexpected(lookahead); - } - generator = true; - lex(); +pp.extend("parseTopLevel", function(parseTopLevel) { + return /** @this acorn.Parser */ function(node) { + if (extra.ecmaFeatures.impliedStrict && this.options.ecmaVersion >= 5) { + this.strict = true; } + return parseTopLevel.call(this, node); + }; +}); - if (key.name === "static" && lookaheadPropertyName()) { - token = lookahead; - isStatic = true; - computed = match("["); - key = parseObjectPropertyKey(); - } +pp.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) { - - 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); - } else { - hasConstructor = true; - } - method.kind = "constructor"; - } - } else { - if (!method.computed && (method.key.name || method.key.value.toString()) === "prototype") { - throwUnexpected(token, Messages.StaticPrototype); + for (var i = 0; i < node.properties.length; i++) { + var prop = node.properties[i]; + + 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 { + this.toAssignable(prop.value, isBinding); } } - method.type = astNodeTypes.MethodDefinition; - delete method.method; - delete method.shorthand; - body.push(method); + + return node; } else { - throwUnexpected(lookahead); + return toAssignable.call(this, node, isBinding); } - } - - 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"); +/** + * Method to parse an object rest or object spread. + * @returns {ASTNode} The node representing object rest or object spread. + * @this acorn.Parser + */ +pp.parseObjectRest = function() { + var node = this.startNode(); + this.next(); + node.argument = this.parseIdent(); + return this.finishNode(node, "ExperimentalRestProperty"); +}; - if (lookahead.type === Token.Identifier) { - id = parseVariableIdentifier(); - } +/** + * 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 + */ +pp.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; + } - if (matchKeyword("extends")) { - lex(); - superClass = parseLeftHandSideExpressionAllowCall(); - } + } else { + first = false; + } - classBody = parseClassBody(); - strict = previousStrict; + var prop = this.startNode(), + isGenerator, + startPos, + startLoc; - return markerApply(marker, astNodeFactory.createClassExpression(id, superClass, classBody)); -} + if (extra.ecmaFeatures.experimentalObjectRestSpread && this.type === tt.ellipsis) { + if (isPattern) { + prop = this.parseObjectRest(); + } else { + prop = this.parseSpread(); + prop.type = "ExperimentalSpreadProperty"; + } -function parseClassDeclaration(identifierIsOptional) { - var id = null, superClass = null, marker = markerCreate(), - previousStrict = strict, classBody; + node.properties.push(prop); + continue; + } - // classes run in strict mode - strict = true; + if (this.options.ecmaVersion >= 6) { + prop.method = false; + prop.shorthand = false; - expectKeyword("class"); + if (isPattern || refShorthandDefaultPos) { + startPos = this.start; + startLoc = this.startLoc; + } - if (!identifierIsOptional || lookahead.type === Token.Identifier) { - id = parseVariableIdentifier(); - } + if (!isPattern) { + isGenerator = this.eat(tt.star); + } + } - if (matchKeyword("extends")) { - lex(); - superClass = parseLeftHandSideExpressionAllowCall(); + this.parsePropertyName(prop); + this.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refShorthandDefaultPos); + this.checkPropClash(prop, propHash); + node.properties.push(this.finishNode(prop, "Property")); } - classBody = parseClassBody(); - strict = previousStrict; - - return markerApply(marker, astNodeFactory.createClassDeclaration(id, superClass, classBody)); -} - -// 15 Program - -function parseSourceElement() { - - var allowClasses = extra.ecmaFeatures.classes, - allowModules = extra.ecmaFeatures.modules, - allowBlockBindings = extra.ecmaFeatures.blockBindings; - - if (lookahead.type === Token.Keyword) { - switch (lookahead.value) { - case "export": - if (!allowModules) { - throwErrorTolerant({}, Messages.IllegalExportDeclaration); - } - return parseExportDeclaration(); - case "import": - if (!allowModules) { - throwErrorTolerant({}, Messages.IllegalImportDeclaration); - } - 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(); - } - } + return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); +}; - if (lookahead.type !== Token.EOF) { - return parseStatement(); - } -} +/** + * 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} + */ +pp.raise = 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 parseSourceElements() { - var sourceElement, sourceElements = [], token, directive, firstRestricted; +/** + * 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} + */ +pp.unexpected = function(pos) { + var message = "Unexpected token"; - while (index < length) { - token = lookahead; - if (token.type !== Token.StringLiteral) { - break; - } + if (pos !== null && pos !== undefined) { + this.pos = pos; - 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; + if (this.options.locations) { + while (this.pos < this.lineStart) { + this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; + --this.curLine; } } - } - while (index < length) { - sourceElement = parseSourceElement(); - /* istanbul ignore if */ - if (typeof sourceElement === "undefined") { - break; - } - sourceElements.push(sourceElement); + this.nextToken(); } - 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 - }; - 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; +/* + * 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. + */ +pp.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; } - tokens.push(token); - } - extra.tokens = tokens; -} + return result; + }; +}); //------------------------------------------------------------------------------ // 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 + }; + + 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: + acornOptions.ecmaVersion = options.ecmaVersion; + extra.ecmaVersion = options.ecmaVersion; + break; + + default: + throw new Error("ecmaVersion must be 3, 5, or 6."); + } } // 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 +546,66 @@ 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 + }; + + 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 +618,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 +633,102 @@ function parse(code, options) { commentAttachment.reset(); } + if (typeof options.ecmaVersion === "number") { + switch (options.ecmaVersion) { + case 3: + case 5: + case 6: + acornOptions.ecmaVersion = options.ecmaVersion; + extra.ecmaVersion = options.ecmaVersion; + break; + + default: + throw new Error("ecmaVersion must be 3, 5, or 6."); + } + } + 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 (typeof extra.tokens !== "undefined") { - filterTokenLocation(); - program.tokens = extra.tokens; + + if (extra.range) { + acornOptions.ranges = true; + } + + if (extra.loc) { + acornOptions.locations = true; } - if (typeof extra.errors !== "undefined") { - program.errors = extra.errors; + + if (extra.ecmaFeatures.jsx) { + acornOptions.plugins = { jsx: 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 +746,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 +765,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..b0f033dceac1fc 100644 --- a/tools/eslint/node_modules/espree/lib/comment-attachment.js +++ b/tools/eslint/node_modules/espree/lib/comment-attachment.js @@ -38,10 +38,10 @@ var astNodeTypes = require("./ast-node-types"); //------------------------------------------------------------------------------ var extra = { - trailingComments: [], - leadingComments: [], - bottomRightStack: [] - }; + trailingComments: [], + leadingComments: [], + bottomRightStack: [] +}; //------------------------------------------------------------------------------ // Public @@ -109,9 +109,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..fbae0d80ff309a --- /dev/null +++ b/tools/eslint/node_modules/espree/lib/token-translator.js @@ -0,0 +1,265 @@ +/** + * @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; + } + + } 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.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..6ea1d086f9b10a 100644 --- a/tools/eslint/node_modules/espree/package.json +++ b/tools/eslint/node_modules/espree/package.json @@ -1,108 +1,114 @@ { - "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.0.0", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "espree@>=3.0.0 <4.0.0", + "_id": "espree@3.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/espree", + "_npmOperationalInternal": { + "host": "packages-6-west.internal.npmjs.com", + "tmp": "tmp/espree-3.0.1.tgz_1454452460192_0.6580590554513037" }, - "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.0.0", + "rawSpec": "^3.0.0", + "scope": null, + "spec": ">=3.0.0 <4.0.0", + "type": "range" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/eslint/espree.git" + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/espree/-/espree-3.0.1.tgz", + "_shasum": "85a5c95c168563159406b698d3ee7d4c1ca2073f", + "_shrinkwrap": null, + "_spec": "espree@^3.0.0", + "_where": "/Users/trott/test/node_modules/eslint", + "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": "^2.7.0", + "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.2.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": "85a5c95c168563159406b698d3ee7d4c1ca2073f", + "tarball": "http://registry.npmjs.org/espree/-/espree-3.0.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "lib", + "espree.js" + ], + "homepage": "https://github.com/eslint/espree", "keywords": [ "ast", "ecmascript", "javascript", "parser", - "syntax" + "syntax", + "acorn" ], - "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" + "email": "nicholas@nczconsulting.com", + "name": "nzakas" } ], - "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": { + "browserify": "node Makefile.js browserify", + "generate-regex": "node tools/generate-identifier-regex.js", + "lint": "node Makefile.js lint", + "prerelease": "eslint-release", + "release": "eslint-release", + "test": "npm run-script lint && node Makefile.js test" + }, + "version": "3.0.1" } 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/ChangeLog b/tools/eslint/node_modules/esprima/ChangeLog new file mode 100644 index 00000000000000..864ab696199e2c --- /dev/null +++ b/tools/eslint/node_modules/esprima/ChangeLog @@ -0,0 +1,170 @@ +2016-02-02: Version 2.7.2 + + * Fix out-of-bound error location in an invalid string literal (issue 1457) + * Fix shorthand object destructuring defaults in variable declarations (issue 1459) + +2015-12-10: Version 2.7.1 + + * Do not allow trailing comma in a variable declaration (issue 1360) + * Fix assignment to `let` in non-strict mode (issue 1376) + * Fix missing delegate property in YieldExpression (issue 1407) + +2015-10-22: Version 2.7.0 + + * Fix the handling of semicolon in a break statement (issue 1044) + * Run the test suite with major web browsers (issue 1259, 1317) + * Allow `let` as an identifier in non-strict mode (issue 1289) + * Attach orphaned comments as `innerComments` (issue 1328) + * Add the support for token delegator (issue 1332) + +2015-09-01: Version 2.6.0 + + * Properly allow or prohibit `let` in a binding identifier/pattern (issue 1048, 1098) + * Add sourceType field for Program node (issue 1159) + * Ensure that strict mode reserved word binding throw an error (issue 1171) + * Run the test suite with Node.js and IE 11 on Windows (issue 1294) + * Allow binding pattern with no initializer in a for statement (issue 1301) + +2015-07-31: Version 2.5.0 + + * Run the test suite in a browser environment (issue 1004) + * Ensure a comma between imported default binding and named imports (issue 1046) + * Distinguish `yield` as a keyword vs an identifier (issue 1186) + * Support ES6 meta property `new.target` (issue 1203) + * Fix the syntax node for yield with expression (issue 1223) + * Fix the check of duplicated proto in property names (issue 1225) + * Fix ES6 Unicode escape in identifier name (issue 1229) + * Support ES6 IdentifierStart and IdentifierPart (issue 1232) + * Treat await as a reserved word when parsing as a module (issue 1234) + * Recognize identifier characters from Unicode SMP (issue 1244) + * Ensure that export and import can be followed by a comma (issue 1250) + * Fix yield operator precedence (issue 1262) + +2015-07-01: Version 2.4.1 + + * Fix some cases of comment attachment (issue 1071, 1175) + * Fix the handling of destructuring in function arguments (issue 1193) + * Fix invalid ranges in assignment expression (issue 1201) + +2015-06-26: Version 2.4.0 + + * Support ES6 for-of iteration (issue 1047) + * Support ES6 spread arguments (issue 1169) + * Minimize npm payload (issue 1191) + +2015-06-16: Version 2.3.0 + + * Support ES6 generator (issue 1033) + * Improve parsing of regular expressions with `u` flag (issue 1179) + +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/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..c1d6e65f9a0334 --- /dev/null +++ b/tools/eslint/node_modules/esprima/package.json @@ -0,0 +1,145 @@ +{ + "_args": [ + [ + "esprima@^2.6.0", + "/Users/trott/test/node_modules/eslint/node_modules/js-yaml" + ] + ], + "_from": "esprima@>=2.6.0 <3.0.0", + "_id": "esprima@2.7.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/js-yaml" + ], + "_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz", + "_shasum": "f43be543609984eae44c933ac63352a6af35f339", + "_shrinkwrap": null, + "_spec": "esprima@^2.6.0", + "_where": "/Users/trott/test/node_modules/eslint/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": "http://registry.npmjs.org/esprima/-/esprima-2.7.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "bin", + "unit-tests.js", + "esprima.js" + ], + "gitHead": "eb05a03b18b8433ab1ebeabea635a949219cd75e", + "homepage": "http://esprima.org", + "keywords": [ + "ast", + "ecmascript", + "javascript", + "parser", + "syntax" + ], + "license": "BSD-2-Clause", + "main": "esprima.js", + "maintainers": [ + { + "email": "ariya.hidayat@gmail.com", + "name": "ariya" + } + ], + "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/README.md b/tools/eslint/node_modules/esrecurse/README.md similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/esrecurse/README.md rename to tools/eslint/node_modules/esrecurse/README.md diff --git a/tools/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js b/tools/eslint/node_modules/esrecurse/esrecurse.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/esrecurse/esrecurse.js rename to tools/eslint/node_modules/esrecurse/esrecurse.js diff --git a/tools/eslint/node_modules/escope/node_modules/esrecurse/gulpfile.coffee b/tools/eslint/node_modules/esrecurse/gulpfile.coffee similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/esrecurse/gulpfile.coffee rename to tools/eslint/node_modules/esrecurse/gulpfile.coffee diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/.jshintrc b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/.jshintrc similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/estraverse/.jshintrc rename to tools/eslint/node_modules/esrecurse/node_modules/estraverse/.jshintrc 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/escope/node_modules/estraverse/README.md b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/estraverse/README.md rename to tools/eslint/node_modules/esrecurse/node_modules/estraverse/README.md 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 100% rename from tools/eslint/node_modules/escope/node_modules/estraverse/estraverse.js rename to tools/eslint/node_modules/esrecurse/node_modules/estraverse/estraverse.js diff --git a/tools/eslint/node_modules/escope/node_modules/estraverse/gulpfile.js b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/gulpfile.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/estraverse/gulpfile.js rename to tools/eslint/node_modules/esrecurse/node_modules/estraverse/gulpfile.js 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..82a1d3ad1cbf72 --- /dev/null +++ b/tools/eslint/node_modules/esrecurse/node_modules/estraverse/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + "estraverse@~3.1.0", + "/Users/trott/test/node_modules/eslint/node_modules/esrecurse" + ] + ], + "_from": "estraverse@>=3.1.0 <3.2.0", + "_id": "estraverse@3.1.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/esrecurse/estraverse", + "_npmUser": { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + "_npmVersion": "2.0.0-alpha-5", + "_phantomChildren": {}, + "_requested": { + "name": "estraverse", + "raw": "estraverse@~3.1.0", + "rawSpec": "~3.1.0", + "scope": null, + "spec": ">=3.1.0 <3.2.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint/esrecurse" + ], + "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-3.1.0.tgz", + "_shasum": "15e28a446b8b82bc700ccc8b96c78af4da0d6cba", + "_shrinkwrap": null, + "_spec": "estraverse@~3.1.0", + "_where": "/Users/trott/test/node_modules/eslint/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": "15e28a446b8b82bc700ccc8b96c78af4da0d6cba", + "tarball": "http://registry.npmjs.org/estraverse/-/estraverse-3.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "gitHead": "166ebbe0a8d45ceb2391b6f5ef5d1bab6bfb267a", + "homepage": "https://github.com/estools/estraverse", + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/estools/estraverse/raw/master/LICENSE.BSD" + } + ], + "main": "estraverse.js", + "maintainers": [ + { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + { + "email": "npm@michael.ficarra.me", + "name": "michaelficarra" + } + ], + "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": "3.1.0" +} diff --git a/tools/eslint/node_modules/esrecurse/package.json b/tools/eslint/node_modules/esrecurse/package.json new file mode 100644 index 00000000000000..25a9651eb032ff --- /dev/null +++ b/tools/eslint/node_modules/esrecurse/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + "esrecurse@^3.1.1", + "/Users/trott/test/node_modules/eslint/node_modules/escope" + ] + ], + "_from": "esrecurse@>=3.1.1 <4.0.0", + "_id": "esrecurse@3.1.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/esrecurse", + "_npmUser": { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + "_npmVersion": "2.0.0-alpha-5", + "_phantomChildren": {}, + "_requested": { + "name": "esrecurse", + "raw": "esrecurse@^3.1.1", + "rawSpec": "^3.1.1", + "scope": null, + "spec": ">=3.1.1 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint/escope" + ], + "_resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-3.1.1.tgz", + "_shasum": "8feb963699d4d1b2d65a576cd4b1296672a0f0e9", + "_shrinkwrap": null, + "_spec": "esrecurse@^3.1.1", + "_where": "/Users/trott/test/node_modules/eslint/node_modules/escope", + "bugs": { + "url": "https://github.com/estools/esrecurse/issues" + }, + "dependencies": { + "estraverse": "~3.1.0" + }, + "description": "ECMAScript scope analyzer", + "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" + }, + "directories": {}, + "dist": { + "shasum": "8feb963699d4d1b2d65a576cd4b1296672a0f0e9", + "tarball": "http://registry.npmjs.org/esrecurse/-/esrecurse-3.1.1.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "gitHead": "600a8aac5e7b313875a873134fd110b47a76fc77", + "homepage": "http://github.com/estools/esrecurse", + "licenses": [ + { + "type": "BSD", + "url": "http://github.com/estools/esrecurse/raw/master/LICENSE.BSD" + } + ], + "main": "esrecurse.js", + "maintainers": [ + { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + { + "email": "npm@michael.ficarra.me", + "name": "michaelficarra" + } + ], + "name": "esrecurse", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/esrecurse.git" + }, + "scripts": { + "lint": "gulp lint", + "test": "gulp travis", + "unit-test": "gulp test" + }, + "version": "3.1.1" +} diff --git a/tools/eslint/node_modules/estraverse-fb/package.json b/tools/eslint/node_modules/estraverse-fb/package.json index c96ec2f456d784..f645d728aea7cb 100644 --- a/tools/eslint/node_modules/estraverse-fb/package.json +++ b/tools/eslint/node_modules/estraverse-fb/package.json @@ -1,60 +1,86 @@ { - "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" + "_args": [ + [ + "estraverse-fb@^1.3.1", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "estraverse-fb@>=1.3.1 <2.0.0", + "_id": "estraverse-fb@1.3.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/estraverse-fb", + "_npmUser": { + "email": "me@rreverser.com", + "name": "rreverser" }, - "keywords": [ - "traverse", - "ast", - "react", - "jsx" + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "name": "estraverse-fb", + "raw": "estraverse-fb@^1.3.1", + "rawSpec": "^1.3.1", + "scope": null, + "spec": ">=1.3.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint" ], + "_resolved": "https://registry.npmjs.org/estraverse-fb/-/estraverse-fb-1.3.1.tgz", + "_shasum": "160e75a80e605b08ce894bcce2fe3e429abf92bf", + "_shrinkwrap": null, + "_spec": "estraverse-fb@^1.3.1", + "_where": "/Users/trott/test/node_modules/eslint", "author": { - "name": "Ingvar Stepanyan", "email": "me@rreverser.com", + "name": "Ingvar Stepanyan", "url": "https://github.com/RReverser" }, - "license": "MIT", - "scripts": { - "test": "mocha" - }, - "peerDependencies": { - "estraverse": "*" + "bugs": { + "url": "https://github.com/RReverser/estraverse-fb/issues" }, + "dependencies": {}, + "description": "Drop-in for estraverse that enables traversal over React's JSX nodes.", "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" + "directories": {}, + "dist": { + "shasum": "160e75a80e605b08ce894bcce2fe3e429abf92bf", + "tarball": "http://registry.npmjs.org/estraverse-fb/-/estraverse-fb-1.3.1.tgz" }, + "gitHead": "776d565d897ad91e20efedd926972c7ab0c7221e", "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" - }, + "keywords": [ + "traverse", + "ast", + "react", + "jsx" + ], + "license": "MIT", + "main": "estraverse-fb.js", "maintainers": [ { - "name": "rreverser", - "email": "me@rreverser.com" + "email": "me@rreverser.com", + "name": "rreverser" } ], - "dist": { - "shasum": "160e75a80e605b08ce894bcce2fe3e429abf92bf", - "tarball": "http://registry.npmjs.org/estraverse-fb/-/estraverse-fb-1.3.1.tgz" + "name": "estraverse-fb", + "optionalDependencies": {}, + "peerDependencies": { + "estraverse": "*" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/estraverse-fb/-/estraverse-fb-1.3.1.tgz", - "readme": "ERROR: No README data found!" + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/RReverser/estraverse-fb.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.3.1" } diff --git a/tools/eslint/node_modules/estraverse/README.md b/tools/eslint/node_modules/estraverse/README.md index 4242c513309e9a..acefff6473c19c 100644 --- a/tools/eslint/node_modules/estraverse/README.md +++ b/tools/eslint/node_modules/estraverse/README.md @@ -66,7 +66,7 @@ var tree = { estraverse.traverse(tree, { enter: function (node) { }, - // Extending the exising traversing rules. + // Extending the existing traversing rules. keys: { // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ] TestExpression: ['argument'] diff --git a/tools/eslint/node_modules/estraverse/estraverse.js b/tools/eslint/node_modules/estraverse/estraverse.js index 1ea5caf21f01ba..0de6cec24f3ec6 100644 --- a/tools/eslint/node_modules/estraverse/estraverse.js +++ b/tools/eslint/node_modules/estraverse/estraverse.js @@ -506,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) { @@ -660,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/estraverse/package.json b/tools/eslint/node_modules/estraverse/package.json index c0a8b690c74c31..0c93cb3587e3ad 100644 --- a/tools/eslint/node_modules/estraverse/package.json +++ b/tools/eslint/node_modules/estraverse/package.json @@ -1,26 +1,44 @@ { - "name": "estraverse", - "description": "ECMAScript JS AST traversal functions", - "homepage": "https://github.com/estools/estraverse", - "main": "estraverse.js", - "version": "4.1.0", - "engines": { - "node": ">=0.10.0" + "_args": [ + [ + "estraverse@^4.1.1", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "estraverse@>=4.1.1 <5.0.0", + "_id": "estraverse@4.1.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/estraverse", + "_nodeVersion": "4.1.1", + "_npmUser": { + "email": "utatane.tea@gmail.com", + "name": "constellation" }, - "maintainers": [ - { - "name": "constellation", - "email": "utatane.tea@gmail.com" - }, - { - "name": "michaelficarra", - "email": "npm@michael.ficarra.me" - } + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "name": "estraverse", + "raw": "estraverse@^4.1.1", + "rawSpec": "^4.1.1", + "scope": null, + "spec": ">=4.1.1 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint", + "/eslint/escope" ], - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/estools/estraverse.git" + "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.1.tgz", + "_shasum": "f6caca728933a850ef90661d0e17982ba47111a2", + "_shrinkwrap": null, + "_spec": "estraverse@^4.1.1", + "_where": "/Users/trott/test/node_modules/eslint", + "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", @@ -33,35 +51,43 @@ "jshint": "^2.5.6", "mocha": "^2.1.0" }, - "licenses": [ + "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": [ + { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + { + "email": "npm@michael.ficarra.me", + "name": "michaelficarra" + }, { - "type": "BSD", - "url": "http://github.com/estools/estraverse/raw/master/LICENSE.BSD" + "email": "nicholas@nczconsulting.com", + "name": "nzakas" } ], + "name": "estraverse", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/estools/estraverse.git" + }, "scripts": { - "test": "npm run-script lint && npm run-script unit-test", "lint": "jshint estraverse.js", + "test": "npm run-script lint && npm run-script unit-test", "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" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.1.0.tgz", - "readme": "ERROR: No README data found!" + "version": "4.1.1" } 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..2df344559204f6 --- /dev/null +++ b/tools/eslint/node_modules/esutils/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + "esutils@^2.0.2", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "esutils@>=2.0.2 <3.0.0", + "_id": "esutils@2.0.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "_shasum": "0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b", + "_shrinkwrap": null, + "_spec": "esutils@^2.0.2", + "_where": "/Users/trott/test/node_modules/eslint", + "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": [ + { + "email": "utatane.tea@gmail.com", + "name": "constellation" + }, + { + "email": "npm@michael.ficarra.me", + "name": "michaelficarra" + } + ], + "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/.npmignore b/tools/eslint/node_modules/event-emitter/.npmignore similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/.npmignore rename to tools/eslint/node_modules/event-emitter/.npmignore 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/event-emitter/.travis.yml b/tools/eslint/node_modules/event-emitter/.travis.yml new file mode 100644 index 00000000000000..628c3f34b5708a --- /dev/null +++ b/tools/eslint/node_modules/event-emitter/.travis.yml @@ -0,0 +1,14 @@ +sudo: false # http://docs.travis-ci.com/user/workers/container-based-infrastructure/ +language: node_js +node_js: + - 0.12 + - 4 + +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/event-emitter/CHANGES b/tools/eslint/node_modules/event-emitter/CHANGES new file mode 100644 index 00000000000000..2e5e8e7d761aef --- /dev/null +++ b/tools/eslint/node_modules/event-emitter/CHANGES @@ -0,0 +1,69 @@ +v0.3.4 -- 2015.10.02 +* Add `emitError` extension + +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/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/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/many-on.js b/tools/eslint/node_modules/event-emitter/benchmark/many-on.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/many-on.js rename to tools/eslint/node_modules/event-emitter/benchmark/many-on.js 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/event-emitter/benchmark/single-on.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/benchmark/single-on.js rename to tools/eslint/node_modules/event-emitter/benchmark/single-on.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..47195fee0d32f1 --- /dev/null +++ b/tools/eslint/node_modules/event-emitter/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + "event-emitter@~0.3.4", + "/Users/trott/test/node_modules/eslint/node_modules/es6-map" + ] + ], + "_from": "event-emitter@>=0.3.4 <0.4.0", + "_id": "event-emitter@0.3.4", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/es6-map", + "/eslint/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/trott/test/node_modules/eslint/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": "http://registry.npmjs.org/event-emitter/-/event-emitter-0.3.4.tgz" + }, + "gitHead": "adc27b543a53528b9af8a82f7c88db3292f0faa0", + "homepage": "https://github.com/medikoo/event-emitter#readme", + "keywords": [ + "event", + "events", + "trigger", + "observer", + "listener", + "emitter", + "pubsub" + ], + "license": "MIT", + "maintainers": [ + { + "email": "medikoo+npm@medikoo.com", + "name": "medikoo" + } + ], + "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/test/all-off.js b/tools/eslint/node_modules/event-emitter/test/all-off.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/all-off.js rename to tools/eslint/node_modules/event-emitter/test/all-off.js diff --git a/tools/eslint/node_modules/event-emitter/test/emit-error.js b/tools/eslint/node_modules/event-emitter/test/emit-error.js new file mode 100644 index 00000000000000..edac350afb56ce --- /dev/null +++ b/tools/eslint/node_modules/event-emitter/test/emit-error.js @@ -0,0 +1,14 @@ +'use strict'; + +var customError = require('es5-ext/error/custom') + , ee = require('../'); + +module.exports = function (t, a) { + var x, error = customError('Some error', 'ERROR_TEST'), emitted; + + x = ee(); + a.throws(function () { t.call(x, error); }, 'ERROR_TEST'); + x.on('error', function (err) { emitted = err; }); + t.call(x, error); + a(emitted, error); +}; 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/event-emitter/test/has-listeners.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/has-listeners.js rename to tools/eslint/node_modules/event-emitter/test/has-listeners.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/index.js b/tools/eslint/node_modules/event-emitter/test/index.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/index.js rename to tools/eslint/node_modules/event-emitter/test/index.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/pipe.js b/tools/eslint/node_modules/event-emitter/test/pipe.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/pipe.js rename to tools/eslint/node_modules/event-emitter/test/pipe.js diff --git a/tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/unify.js b/tools/eslint/node_modules/event-emitter/test/unify.js similarity index 100% rename from tools/eslint/node_modules/escope/node_modules/es6-map/node_modules/event-emitter/test/unify.js rename to tools/eslint/node_modules/event-emitter/test/unify.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..43411de64dce5c --- /dev/null +++ b/tools/eslint/node_modules/exit-hook/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "exit-hook@^1.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/restore-cursor" + ] + ], + "_from": "exit-hook@>=1.0.0 <2.0.0", + "_id": "exit-hook@1.1.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "exit", + "quit", + "process", + "hook", + "graceful", + "handler", + "shutdown", + "sigterm", + "sigint", + "terminate", + "kill", + "stop", + "event" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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..5acd6fe7782c49 --- /dev/null +++ b/tools/eslint/node_modules/fast-levenshtein/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + "fast-levenshtein@^1.1.0", + "/Users/trott/test/node_modules/eslint/node_modules/optionator" + ] + ], + "_from": "fast-levenshtein@>=1.1.0 <2.0.0", + "_id": "fast-levenshtein@1.1.3", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "levenshtein", + "distance", + "string" + ], + "license": "MIT", + "main": "levenshtein.js", + "maintainers": [ + { + "email": "ram@hiddentao.com", + "name": "hiddentao" + } + ], + "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..aabd817a9c7fa3 --- /dev/null +++ b/tools/eslint/node_modules/figures/index.js @@ -0,0 +1,89 @@ +'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: '❯', + 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: '[█]', + 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..359795b913a78d --- /dev/null +++ b/tools/eslint/node_modules/figures/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "figures@^1.3.5", + "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + ] + ], + "_from": "figures@>=1.3.5 <2.0.0", + "_id": "figures@1.4.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/figures", + "_nodeVersion": "4.1.0", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.3", + "_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": [ + "/eslint/inquirer" + ], + "_resolved": "https://registry.npmjs.org/figures/-/figures-1.4.0.tgz", + "_shasum": "eb8f56390dbe3081044a5c2a9d9089075a48432f", + "_shrinkwrap": null, + "_spec": "figures@^1.3.5", + "_where": "/Users/trott/test/node_modules/eslint/node_modules/inquirer", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/figures/issues" + }, + "dependencies": {}, + "description": "Unicode symbols with Windows CMD fallbacks", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "eb8f56390dbe3081044a5c2a9d9089075a48432f", + "tarball": "http://registry.npmjs.org/figures/-/figures-1.4.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "6b8b7482290192d6eeb3e80508f59ad33bc012f7", + "homepage": "https://github.com/sindresorhus/figures#readme", + "keywords": [ + "unicode", + "cli", + "cmd", + "command-line", + "characters", + "char", + "symbol", + "symbols", + "figure", + "figures", + "fallback" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "figures", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/figures.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.4.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..bb7ddf0054bded --- /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 +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/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..57bb4b6e411c85 --- /dev/null +++ b/tools/eslint/node_modules/file-entry-cache/package.json @@ -0,0 +1,140 @@ +{ + "_args": [ + [ + "file-entry-cache@^1.1.1", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "file-entry-cache@>=1.1.1 <2.0.0", + "_id": "file-entry-cache@1.2.4", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_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/trott/test/node_modules/eslint", + "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": [ + "file cache", + "task cache files", + "file cache", + "key par", + "key value", + "cache" + ], + "license": "MIT", + "main": "cache.js", + "maintainers": [ + { + "email": "royriojas@gmail.com", + "name": "royriojas" + } + ], + "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..429417ded8ed79 --- /dev/null +++ b/tools/eslint/node_modules/flat-cache/package.json @@ -0,0 +1,141 @@ +{ + "_args": [ + [ + "flat-cache@^1.0.9", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "json cache", + "simple cache", + "file cache", + "key par", + "key value", + "cache" + ], + "license": "MIT", + "main": "cache.js", + "maintainers": [ + { + "email": "royriojas@gmail.com", + "name": "royriojas" + } + ], + "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/optionator/node_modules/deep-is/.npmignore b/tools/eslint/node_modules/generate-function/.npmignore similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/deep-is/.npmignore rename to tools/eslint/node_modules/generate-function/.npmignore diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/tools/eslint/node_modules/generate-function/.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 tools/eslint/node_modules/generate-function/.travis.yml 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..a7cde9f4e3699a --- /dev/null +++ b/tools/eslint/node_modules/generate-function/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "generate-function@^2.0.0", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "generate", + "code", + "generation", + "function", + "performance" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "mathiasbuus@gmail.com", + "name": "mafintosh" + } + ], + "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-function/test.js b/tools/eslint/node_modules/generate-function/test.js similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/test.js rename to tools/eslint/node_modules/generate-function/test.js diff --git a/tools/eslint/node_modules/generate-object-property/.npmignore b/tools/eslint/node_modules/generate-object-property/.npmignore new file mode 100644 index 00000000000000..3c3629e647f5dd --- /dev/null +++ b/tools/eslint/node_modules/generate-object-property/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml b/tools/eslint/node_modules/generate-object-property/.travis.yml similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-function/.travis.yml rename to tools/eslint/node_modules/generate-object-property/.travis.yml 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..eaf984971b540b --- /dev/null +++ b/tools/eslint/node_modules/generate-object-property/package.json @@ -0,0 +1,76 @@ +{ + "_args": [ + [ + "generate-object-property@^1.1.0", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + { + "email": "mathiasbuus@gmail.com", + "name": "mafintosh" + } + ], + "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/is-my-json-valid/node_modules/generate-object-property/test.js b/tools/eslint/node_modules/generate-object-property/test.js similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/test.js rename to tools/eslint/node_modules/generate-object-property/test.js diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/LICENSE b/tools/eslint/node_modules/glob/LICENSE similarity index 100% rename from deps/npm/node_modules/npm-registry-client/node_modules/graceful-fs/LICENSE rename to tools/eslint/node_modules/glob/LICENSE diff --git a/tools/eslint/node_modules/glob/README.md b/tools/eslint/node_modules/glob/README.md new file mode 100644 index 00000000000000..6960483bac63c6 --- /dev/null +++ b/tools/eslint/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/glob/common.js b/tools/eslint/node_modules/glob/common.js new file mode 100644 index 00000000000000..c9127eb334f18b --- /dev/null +++ b/tools/eslint/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/glob/glob.js b/tools/eslint/node_modules/glob/glob.js new file mode 100644 index 00000000000000..a62da27ebd507a --- /dev/null +++ b/tools/eslint/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/glob/package.json b/tools/eslint/node_modules/glob/package.json new file mode 100644 index 00000000000000..90a9c38820841e --- /dev/null +++ b/tools/eslint/node_modules/glob/package.json @@ -0,0 +1,99 @@ +{ + "_args": [ + [ + "glob@^6.0.4", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "glob@>=6.0.4 <7.0.0", + "_id": "glob@6.0.4", + "_inCache": true, + "_installable": true, + "_location": "/eslint/glob", + "_nodeVersion": "4.0.0", + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "2.14.15", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@^6.0.4", + "rawSpec": "^6.0.4", + "scope": null, + "spec": ">=6.0.4 <7.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint", + "/eslint/globby" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22", + "_shrinkwrap": null, + "_spec": "glob@^6.0.4", + "_where": "/Users/trott/test/node_modules/eslint", + "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/tools/eslint/node_modules/glob/sync.js b/tools/eslint/node_modules/glob/sync.js new file mode 100644 index 00000000000000..09883d2ce0c9de --- /dev/null +++ b/tools/eslint/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/globals/globals.json b/tools/eslint/node_modules/globals/globals.json index ad5c25f3e83d22..38a7d72e997870 100644 --- a/tools/eslint/node_modules/globals/globals.json +++ b/tools/eslint/node_modules/globals/globals.json @@ -59,23 +59,152 @@ "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, + "Float32Array": false, + "Float64Array": 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 +212,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 +323,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 +360,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 +380,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 +457,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 +571,7 @@ "SVGCursorElement": false, "SVGDefsElement": false, "SVGDescElement": false, + "SVGDiscardElement": false, "SVGDocument": false, "SVGElement": false, "SVGElementInstance": false, @@ -304,6 +587,7 @@ "SVGFEDiffuseLightingElement": false, "SVGFEDisplacementMapElement": false, "SVGFEDistantLightElement": false, + "SVGFEDropShadowElement": false, "SVGFEFloodElement": false, "SVGFEFuncAElement": false, "SVGFEFuncBElement": false, @@ -331,9 +615,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 +697,31 @@ "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, + "ValidityState": false, + "VTTCue": false, + "WaveShaperNode": false, "WebGLActiveInfo": false, "WebGLBuffer": false, "WebGLContextEvent": false, @@ -436,19 +739,87 @@ "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, + "WebSocket": false, + "Worker": false, + "XMLHttpRequest": false }, "node": { "__dirname": false, @@ -470,6 +841,12 @@ "setInterval": false, "setTimeout": false }, + "commonjs": { + "exports": true, + "module": false, + "require": false, + "global": false + }, "amd": { "define": false, "require": false @@ -515,6 +892,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 +912,7 @@ "module": false, "notDeepEqual": false, "notEqual": false, + "notOk": false, "notPropEqual": false, "notStrictEqual": false, "ok": false, @@ -578,6 +968,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 +1025,7 @@ "find": false, "grep": false, "ls": false, + "ln": false, "mkdir": false, "mv": false, "popd": false, @@ -725,6 +1136,8 @@ "Mongo": false, "ObjectId": false, "PlanCache": false, + "print": false, + "printjson": false, "pwd": false, "quit": false, "removeFile": false, @@ -746,5 +1159,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..c14975e90c2de2 100644 --- a/tools/eslint/node_modules/globals/package.json +++ b/tools/eslint/node_modules/globals/package.json @@ -1,27 +1,65 @@ { - "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@^8.18.0", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "globals@>=8.18.0 <9.0.0", + "_id": "globals@8.18.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/globals", + "_nodeVersion": "5.3.0", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "name": "globals", + "raw": "globals@^8.18.0", + "rawSpec": "^8.18.0", + "scope": null, + "spec": ">=8.18.0 <9.0.0", + "type": "range" }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/globals/-/globals-8.18.0.tgz", + "_shasum": "93d4a62bdcac38cfafafc47d6b034768cb0ffcb4", + "_shrinkwrap": null, + "_spec": "globals@^8.18.0", + "_where": "/Users/trott/test/node_modules/eslint", "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": "93d4a62bdcac38cfafafc47d6b034768cb0ffcb4", + "tarball": "http://registry.npmjs.org/globals/-/globals-8.18.0.tgz" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "mocha" - }, "files": [ "index.js", "globals.json" ], + "gitHead": "d929a0c638008d4cbf87cc7faac5bc5169e2b86d", + "homepage": "https://github.com/sindresorhus/globals", "keywords": [ "globals", "global", @@ -32,41 +70,34 @@ "eslint", "environments" ], - "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" + "email": "ben@byk.im", + "name": "byk" + }, + { + "email": "schreck.mathias@gmail.com", + "name": "lo1tuma" }, { - "name": "nzakas", - "email": "nicholas@nczconsulting.com" + "email": "nicholas@nczconsulting.com", + "name": "nzakas" }, { - "name": "lo1tuma", - "email": "schreck.mathias@gmail.com" + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" } ], - "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": "8.18.0" } diff --git a/tools/eslint/node_modules/globals/readme.md b/tools/eslint/node_modules/globals/readme.md index dc23c97f35433c..3eb024e5a5b190 100644 --- a/tools/eslint/node_modules/globals/readme.md +++ b/tools/eslint/node_modules/globals/readme.md @@ -2,7 +2,7 @@ > 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. 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/package.json b/tools/eslint/node_modules/globby/package.json new file mode 100644 index 00000000000000..2aeef7e15b3ce8 --- /dev/null +++ b/tools/eslint/node_modules/globby/package.json @@ -0,0 +1,131 @@ +{ + "_args": [ + [ + "globby@^4.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/del" + ] + ], + "_from": "globby@>=4.0.0 <5.0.0", + "_id": "globby@4.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/globby", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.14.7", + "_phantomChildren": {}, + "_requested": { + "name": "globby", + "raw": "globby@^4.0.0", + "rawSpec": "^4.0.0", + "scope": null, + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint/del" + ], + "_resolved": "https://registry.npmjs.org/globby/-/globby-4.0.0.tgz", + "_shasum": "36ff06c5a9dc1dbc201f700074992882857e9817", + "_shrinkwrap": null, + "_spec": "globby@^4.0.0", + "_where": "/Users/trott/test/node_modules/eslint/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": "http://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", + "traverse", + "util", + "utility", + "wildcard", + "wildcards", + "promise" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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": [ + "node", + "mocha" + ] + } +} 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..7e4829d35746f3 --- /dev/null +++ b/tools/eslint/node_modules/graceful-fs/package.json @@ -0,0 +1,104 @@ +{ + "_args": [ + [ + "graceful-fs@^4.1.2", + "/Users/trott/test/node_modules/eslint/node_modules/flat-cache" + ] + ], + "_from": "graceful-fs@>=4.1.2 <5.0.0", + "_id": "graceful-fs@4.1.3", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/flat-cache", + "/eslint/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/trott/test/node_modules/eslint/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": [ + "fs", + "module", + "reading", + "retry", + "retries", + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" + ], + "license": "ISC", + "main": "graceful-fs.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "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..9c1a14915bb31d --- /dev/null +++ b/tools/eslint/node_modules/has-ansi/package.json @@ -0,0 +1,110 @@ +{ + "_args": [ + [ + "has-ansi@^2.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/chalk" + ] + ], + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_id": "has-ansi@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": "http://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", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "string", + "tty", + "escape", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern", + "has" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + { + "email": "jappelman@xebia.com", + "name": "jbnicolai" + } + ], + "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 100644 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 100644 index 00000000000000..43dc2ff8fc7b19 --- /dev/null +++ b/tools/eslint/node_modules/ignore/README.md @@ -0,0 +1,184 @@ +# ignore + +[![NPM version](https://badge.fury.io/js/ignore.png)](http://badge.fury.io/js/ignore) +[![npm module downloads per month](http://img.shields.io/npm/dm/ignore.svg)](https://www.npmjs.org/package/ignore) +[![Build Status](https://travis-ci.org/kaelzhang/node-ignore.png?branch=master)](https://travis-ci.org/kaelzhang/node-ignore) +[![Dependency Status](https://gemnasium.com/kaelzhang/node-ignore.png)](https://gemnasium.com/kaelzhang/node-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. + +## Installation + + npm install ignore --save + +## Usage + +```js +var ignore = require('ignore'); +var ig = ignore(options).addPattern(['.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'] +``` + +### With ignore files + +For most cases, we'd better use only one ignore file. We could use `ignore.select` to select the first existing file. + +```js +ignore().addIgnoreFile( + ignore.select([ + '.xxxignore', + '.gitignore', + '.ignore' + ]) +); +``` + +## 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. + + + +## Methods + +### .addPattern(pattern) + +Adds a rule or several rules to the current manager. + +#### Returns `this` + +#### pattern `String|Array.` + +The ignore rule or a array of rules. + +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().addPattern('#abc').filter(['#abc']); // ['#abc'] +ignore().addPattern('\#abc').filter(['#abc']); // [] +``` + + +### .addIgnoreFile(path) + +Adds rules from a ignore file or several files + +#### Returns `this` + +#### Rule `String|Array.` + + +### .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) to fetch the structure of the current directory: + +```js +var glob = require('glob'); +glob('**', function(err, files){ + var filtered; + + if ( err ) { + console.log(err); + } else { + filtered = ignore().addIgnoreFile('.gitignore').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. + + +## Constructor: ignore.Ignore + +```js +new ignore.Ignore(options); +ignore(options); +``` + +#### options.matchCase `boolean=false` + +By default, all ignore rules will be treated as case-insensitive ones as well as the git does. + +#### options.twoGlobstars `boolean=false` + +By defailt, `ignoreRules` will omit every pattern that includes '`**`' (two consecutive asterisks) which is not compatible cross operating systems, because the behavior of file .gitignore depends on the implementation of command `fnmatch` in shell. + +By the way, Mac OS doesn't support '`**`'. + +#### options.ignore `Array.` + +The ignore rules to be added. Default to `['.git', '.svn', '.DS_Store']` + +If you want those directories to be included, you could + +```js +ignore({ + ignore: [] +}); +``` + +You can also use `.addPattern()` method to do this. diff --git a/tools/eslint/node_modules/ignore/index.js b/tools/eslint/node_modules/ignore/index.js new file mode 100644 index 00000000000000..4b9585e30950a9 --- /dev/null +++ b/tools/eslint/node_modules/ignore/index.js @@ -0,0 +1,364 @@ +'use strict'; + +module.exports = ignore; +ignore.Ignore = Ignore; + +var EE = require('events').EventEmitter; +var node_util = require('util'); +var node_fs = require('fs'); + +function ignore(options) { + return new Ignore(options); +} + +var exists = node_fs.existsSync + ? function(file) { + return node_fs.existsSync(file); + } + + // if node <= 0.6, there's no fs.existsSync method. + : function(file) { + try { + node_fs.statSync(file); + return true; + } catch (e) { + return false; + } + }; + +// Select the first existing file of the file list +ignore.select = function(files) { + var selected; + + files.some(function(file) { + if (exists(file)) { + selected = file; + return true; + } + }); + + return selected; +}; + + +// @param {Object} options +// - ignore: {Array} +// - twoGlobstars: {boolean=false} enable pattern `'**'` (two consecutive asterisks), default to `false`. +// If false, ignore patterns with two globstars will be omitted +// - matchCase: {boolean=} case sensitive. +// By default, git is case-insensitive +function Ignore(options) { + options = options || {}; + + this.options = options; + this._patterns = []; + this._rules = []; + this._ignoreFiles = []; + + options.ignore = options.ignore || [ + // Some files or directories which we should ignore for most cases. + '.git', + '.svn', + '.DS_Store' + ]; + + this.addPattern(options.ignore); +} + +// Events: +// 'warn': , +// will warn when encounter '`**`' (two consecutive asterisks) +// which is not compatible with all platforms (not works on Mac OS for example) +node_util.inherits(Ignore, EE); + +function makeArray(subject) { + return Array.isArray(subject) + ? subject + : subject === undefined || subject === null + ? [] + : [subject]; +} + + +// @param {Array.|string} pattern +Ignore.prototype.addPattern = function(pattern) { + makeArray(pattern).forEach(this._addPattern, this); + return this; +}; + + +Ignore.prototype._addPattern = function(pattern) { + if (this._simpleTest(pattern)) { + var rule = this._createRule(pattern); + this._rules.push(rule); + } +}; + + +Ignore.prototype.filter = function(paths) { + return paths.filter(this._filter, this); +}; + + +Ignore.prototype._simpleTest = function(pattern) { + // Whitespace dirs are allowed, so only filter blank pattern. + var pass = pattern + // And not start with a '#' + && pattern.indexOf('#') !== 0 + && !~this._patterns.indexOf(pattern); + + this._patterns.push(pattern); + + if (~pattern.indexOf('**')) { + this.emit('warn', { + code: 'WGLOBSTARS', + data: { + origin: pattern + }, + message: '`**` found, which is not compatible cross all platforms.' + }); + + if (!this.options.twoGlobstars) { + return false; + } + } + + return pass; +}; + +var REGEX_LEADING_EXCLAMATION = /^\\\!/; +var REGEX_LEADING_HASH = /^\\#/; + +Ignore.prototype._createRule = function(pattern) { + var rule_object = { + origin: pattern + }; + + var match_start; + + if (pattern.indexOf('!') === 0) { + rule_object.negative = true; + pattern = pattern.substr(1); + } + + pattern = pattern + .replace(REGEX_LEADING_EXCLAMATION, '!') + .replace(REGEX_LEADING_HASH, '#'); + + rule_object.pattern = pattern; + + rule_object.regex = this.makeRegex(pattern); + + return rule_object; +}; + +// > 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 = [ + + // 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 + /^\//, + '^' + ], + + [ + /\//g, + '\\/' + ], + + [ + // > 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 + '' + ], + + // 'f' + // matches + // - /f(end) + // - /f/ + // - (start)f(end) + // - (start)f/ + // doesn't match + // - oof + // - foo + // pseudo: + // -> (^|/)f(/|$) + + // ending + [ + // 'js' will not match 'js.' + /(?:[^*\/])$/, + 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 the second replacer) + // If starts with '**', adding a '^' to the regular expression also works + /^(?=[^\^])/, + '(?:^|\\/)' + ], + + // two globstars + [ + // > 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. + // '/**/' + /\\\/\\\*\\\*\\\//g, + + // Zero, one or several directories + // should not use '*', or it will be replaced by the next replacer + '(?:\\/[^\\/]+)*\\/' + ], + + // intermediate wildcards + [ + // Never replace escaped '*' + // ignore rule '\*' will match the path '*' + + // 'abc.*/' -> go + // 'abc.*' -> skip + /(^|[^\\]+)\\\*(?=.+)/g, + function(match, p1) { + // '*.js' matches '.js' + // '*.js' doesn't match 'abc' + return p1 + '[^\\/]*'; + } + ], + + // ending wildcard + [ + /\\\*$/, + // simply remove it + '' + ], + + [ + /\\\\\\/g, + '\\' + ] +]; + + +// @param {pattern} +Ignore.prototype.makeRegex = function(pattern) { + var source = REPLACERS.reduce(function(prev, current) { + return prev.replace(current[0], current[1]); + + }, pattern); + + return new RegExp(source, this.options.matchCase ? '' : 'i'); +}; + + +Ignore.prototype._filter = function(path) { + var rules = this._rules; + var i = 0; + var length = rules.length; + var matched; + var rule; + + for (; i < length; i++) { + rule = rules[i]; + + // 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); + + } else { + continue; + } + } + + return !matched; +}; + + +Ignore.prototype.createFilter = function() { + var self = this; + + return function(path) { + return self._filter(path); + }; +}; + + +// @param {Array.|path} a +Ignore.prototype.addIgnoreFile = function(files) { + makeArray(files).forEach(this._addIgnoreFile, this); + return this; +}; + + +Ignore.prototype._addIgnoreFile = function(file) { + if (this._checkRuleFile(file)) { + this._ignoreFiles.push(file); + + var content; + + try { + content = node_fs.readFileSync(file); + } catch (e) {} + + if (content) { + this.addPattern(content.toString().split(/\r?\n/)); + } + } +}; + + +Ignore.prototype._checkRuleFile = function(file) { + return file !== '.' + && file !== '..' + && !~this._ignoreFiles.indexOf(file); +}; diff --git a/tools/eslint/node_modules/ignore/package.json b/tools/eslint/node_modules/ignore/package.json new file mode 100644 index 00000000000000..60c9e0665121b2 --- /dev/null +++ b/tools/eslint/node_modules/ignore/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "ignore@^2.2.19", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "ignore@>=2.2.19 <3.0.0", + "_id": "ignore@2.2.19", + "_inCache": true, + "_installable": true, + "_location": "/eslint/ignore", + "_nodeVersion": "0.12.1", + "_npmUser": { + "email": "i@kael.me", + "name": "kael" + }, + "_npmVersion": "3.3.9", + "_phantomChildren": {}, + "_requested": { + "name": "ignore", + "raw": "ignore@^2.2.19", + "rawSpec": "^2.2.19", + "scope": null, + "spec": ">=2.2.19 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/ignore/-/ignore-2.2.19.tgz", + "_shasum": "4c845a61f7e50b4a410f6156aaa38b6ad95e0c8f", + "_shrinkwrap": null, + "_spec": "ignore@^2.2.19", + "_where": "/Users/trott/test/node_modules/eslint", + "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": "4c845a61f7e50b4a410f6156aaa38b6ad95e0c8f", + "tarball": "http://registry.npmjs.org/ignore/-/ignore-2.2.19.tgz" + }, + "files": [ + "index.js", + "LICENSE-MIT" + ], + "gitHead": "97df28de4e8401e08c620986156924c1c0f3f37e", + "homepage": "https://github.com/kaelzhang/node-ignore#readme", + "keywords": [ + "ignore", + ".gitignore", + "gitignore", + "npmignore", + "rules", + "manager", + "filter", + "regexp", + "regex", + "regular-expression" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "i@kael.me", + "name": "kael" + } + ], + "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": "2.2.19" +} diff --git a/tools/eslint/node_modules/inflight/.eslintrc b/tools/eslint/node_modules/inflight/.eslintrc new file mode 100644 index 00000000000000..b7a1550efc2b2c --- /dev/null +++ b/tools/eslint/node_modules/inflight/.eslintrc @@ -0,0 +1,17 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "semi": [2, "never"], + "strict": 0, + "quotes": [1, "single", "avoid-escape"], + "no-use-before-define": 0, + "curly": 0, + "no-underscore-dangle": 0, + "no-lonely-if": 1, + "no-unused-vars": [2, {"vars" : "all", "args" : "after-used"}], + "no-mixed-requires": 0, + "space-infix-ops": 0 + } +} diff --git a/tools/eslint/node_modules/inflight/LICENSE b/tools/eslint/node_modules/inflight/LICENSE new file mode 100644 index 00000000000000..05eeeb88c2ef4c --- /dev/null +++ b/tools/eslint/node_modules/inflight/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/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..7db3e9ddab6b30 --- /dev/null +++ b/tools/eslint/node_modules/inflight/package.json @@ -0,0 +1,87 @@ +{ + "_args": [ + [ + "inflight@^1.0.4", + "/Users/trott/test/node_modules/eslint/node_modules/glob" + ] + ], + "_from": "inflight@>=1.0.4 <2.0.0", + "_id": "inflight@1.0.4", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/glob", + "/eslint/rimraf/glob" + ], + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", + "_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a", + "_shrinkwrap": null, + "_spec": "inflight@^1.0.4", + "_where": "/Users/trott/test/node_modules/eslint/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": [ + { + "email": "i@izs.me", + "name": "isaacs" + }, + { + "email": "ogd@aoaioxxysz.net", + "name": "othiym23" + }, + { + "email": "me@re-becca.org", + "name": "iarna" + } + ], + "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/inflight/test.js b/tools/eslint/node_modules/inflight/test.js new file mode 100644 index 00000000000000..2bb75b38814a60 --- /dev/null +++ b/tools/eslint/node_modules/inflight/test.js @@ -0,0 +1,97 @@ +var test = require('tap').test +var inf = require('./inflight.js') + + +function req (key, cb) { + cb = inf(key, cb) + if (cb) setTimeout(function () { + cb(key) + cb(key) + }) + return cb +} + +test('basic', function (t) { + var calleda = false + var a = req('key', function (k) { + t.notOk(calleda) + calleda = true + t.equal(k, 'key') + if (calledb) t.end() + }) + t.ok(a, 'first returned cb function') + + var calledb = false + var b = req('key', function (k) { + t.notOk(calledb) + calledb = true + t.equal(k, 'key') + if (calleda) t.end() + }) + + t.notOk(b, 'second should get falsey inflight response') +}) + +test('timing', function (t) { + var expect = [ + 'method one', + 'start one', + 'end one', + 'two', + 'tick', + 'three' + ] + var i = 0 + + function log (m) { + t.equal(m, expect[i], m + ' === ' + expect[i]) + ++i + if (i === expect.length) + t.end() + } + + function method (name, cb) { + log('method ' + name) + process.nextTick(cb) + } + + var one = inf('foo', function () { + log('start one') + var three = inf('foo', function () { + log('three') + }) + if (three) method('three', three) + log('end one') + }) + + method('one', one) + + var two = inf('foo', function () { + log('two') + }) + if (two) method('one', two) + + process.nextTick(log.bind(null, 'tick')) +}) + +test('parameters', function (t) { + t.plan(8) + + var a = inf('key', function (first, second, third) { + t.equal(first, 1) + t.equal(second, 2) + t.equal(third, 3) + }) + t.ok(a, 'first returned cb function') + + var b = inf('key', function (first, second, third) { + t.equal(first, 1) + t.equal(second, 2) + t.equal(third, 3) + }) + t.notOk(b, 'second should get falsey inflight response') + + setTimeout(function () { + a(1, 2, 3) + }) +}) 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..57448988915c7b --- /dev/null +++ b/tools/eslint/node_modules/inherits/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + "inherits@~2.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/concat-stream" + ] + ], + "_from": "inherits@>=2.0.1 <2.1.0", + "_id": "inherits@2.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/concat-stream", + "/eslint/glob", + "/eslint/readable-stream", + "/eslint/rimraf/glob" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "_shrinkwrap": null, + "_spec": "inherits@~2.0.1", + "_where": "/Users/trott/test/node_modules/eslint/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": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "homepage": "https://github.com/isaacs/inherits#readme", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "license": "ISC", + "main": "./inherits.js", + "maintainers": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "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/concat-stream/node_modules/inherits/test.js b/tools/eslint/node_modules/inherits/test.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/inherits/test.js rename to tools/eslint/node_modules/inherits/test.js 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/LICENSE.txt b/tools/eslint/node_modules/inquirer/node_modules/lodash/LICENSE.txt deleted file mode 100644 index 9cd87e5dcefe58..00000000000000 --- a/tools/eslint/node_modules/inquirer/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/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/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/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/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/all.js b/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js deleted file mode 100644 index d0839f77ed712b..00000000000000 --- a/tools/eslint/node_modules/inquirer/node_modules/lodash/collection/all.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./every'); 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/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/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/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..654a767f7e5fad 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/trott/test/node_modules/eslint" + ] + ], + "_from": "inquirer@>=0.12.0 <0.13.0", + "_id": "inquirer@0.12.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" ], + "_resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz", + "_shasum": "1ef2bfd63504df0bc75785fff8c2c41df12f077e", + "_shrinkwrap": null, + "_spec": "inquirer@^0.12.0", + "_where": "/Users/trott/test/node_modules/eslint", "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": "http://registry.npmjs.org/inquirer/-/inquirer-0.12.0.tgz" }, + "files": [ + "lib" + ], + "gitHead": "a0c2d4d2bcd2818f27c8a2e96477d65f0f386944", + "homepage": "https://github.com/sboudrias/Inquirer.js#readme", + "keywords": [ + "command", + "prompt", + "stdin", + "cli", + "tty", + "menu" + ], + "license": "MIT", + "main": "lib/inquirer.js", "maintainers": [ { - "name": "sboudrias", - "email": "admin@simonboudrias.com" + "email": "admin@simonboudrias.com", + "name": "sboudrias" } ], - "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..f2869d6d675099 --- /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/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/readline2", + "/eslint/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/trott/test/node_modules/eslint/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": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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/README.md b/tools/eslint/node_modules/is-my-json-valid/README.md index 47350d84fa795b..cbf2b20d336045 100644 --- a/tools/eslint/node_modules/is-my-json-valid/README.md +++ b/tools/eslint/node_modules/is-my-json-valid/README.md @@ -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 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..f24db9b1c9062b 100644 --- a/tools/eslint/node_modules/is-my-json-valid/index.js +++ b/tools/eslint/node_modules/is-my-json-valid/index.js @@ -190,7 +190,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 +395,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) } @@ -446,7 +446,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 +456,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 +466,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 +476,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 +518,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 +543,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-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/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/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/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..929ada2ba28d34 100644 --- a/tools/eslint/node_modules/is-my-json-valid/package.json +++ b/tools/eslint/node_modules/is-my-json-valid/package.json @@ -1,67 +1,96 @@ { - "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/trott/test/node_modules/eslint" + ] + ], + "_from": "is-my-json-valid@>=2.10.0 <3.0.0", + "_id": "is-my-json-valid@2.12.4", + "_inCache": true, + "_installable": true, + "_location": "/eslint/is-my-json-valid", + "_nodeVersion": "4.2.3", + "_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": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz", + "_shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880", + "_shrinkwrap": null, + "_spec": "is-my-json-valid@^2.10.0", + "_where": "/Users/trott/test/node_modules/eslint", + "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": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880", + "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz" }, + "gitHead": "8978aa8f40eef4ac47a5d18270c13abd48927ddb", + "homepage": "https://github.com/mafintosh/is-my-json-valid", "keywords": [ "json", "schema", "orderly", "jsonschema" ], - "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": "mafintosh", - "email": "mathiasbuus@gmail.com" + "email": "freeall@gmail.com", + "name": "freeall" }, { - "name": "watson", - "email": "w@tson.dk" + "email": "mathiasbuus@gmail.com", + "name": "mafintosh" }, { - "name": "freeall", - "email": "freeall@gmail.com" + "email": "w@tson.dk", + "name": "watson" + }, + { + "email": "i@yoshuawuyts.com", + "name": "yoshuawuyts" } ], - "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.12.4" } 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 index cbb7f46bf8bc5b..f66690fe1bbff5 100644 --- 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 @@ -74,7 +74,7 @@ "description": "forbidden property", "schema": { "properties": { - "foo": { + "foo": { "not": {} } } diff --git a/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json new file mode 100644 index 00000000000000..c65c02c36f9706 --- /dev/null +++ b/tools/eslint/node_modules/is-my-json-valid/test/json-schema-draft4/nullAndObject.json @@ -0,0 +1,18 @@ +[ + { + "description": "multiple types of null and object containing properties", + "schema": { + "type": ["null", "object"], + "properties": { + "foo": {} + } + }, + "tests": [ + { + "description": "null is valid", + "data": null, + "valid": true + } + ] + } +] 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..e3a6a3c7b1152d --- /dev/null +++ b/tools/eslint/node_modules/is-path-cwd/package.json @@ -0,0 +1,88 @@ +{ + "_args": [ + [ + "is-path-cwd@^1.0.0", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "path", + "cwd", + "pwd", + "check", + "filepath", + "file", + "folder" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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..25884ed6bcc8f4 --- /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/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "path", + "cwd", + "pwd", + "check", + "filepath", + "file", + "folder", + "in", + "inside" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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..fe03962cdd3ef1 --- /dev/null +++ b/tools/eslint/node_modules/is-path-inside/package.json @@ -0,0 +1,90 @@ +{ + "_args": [ + [ + "is-path-inside@^1.0.0", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "path", + "inside", + "folder", + "directory", + "dir", + "file", + "resolve" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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/.npmignore b/tools/eslint/node_modules/is-property/.npmignore similarity index 100% rename from tools/eslint/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/.npmignore rename to tools/eslint/node_modules/is-property/.npmignore 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..586bd1571f5d06 --- /dev/null +++ b/tools/eslint/node_modules/is-property/package.json @@ -0,0 +1,84 @@ +{ + "_args": [ + [ + "is-property@^1.0.0", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "is", + "property", + "json", + "dot", + "bracket", + ".", + "[]" + ], + "license": "MIT", + "main": "is-property.js", + "maintainers": [ + { + "email": "mikolalysenko@gmail.com", + "name": "mikolalysenko" + } + ], + "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..3e53ca97816675 --- /dev/null +++ b/tools/eslint/node_modules/is-resolvable/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + "is-resolvable@^1.0.0", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "is-resolvable@>=1.0.0 <2.0.0", + "_id": "is-resolvable@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_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/trott/test/node_modules/eslint", + "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": [ + "read", + "file", + "font", + "glyph", + "code-point", + "unicode", + "parse", + "cmap", + "table", + "data", + "metadata" + ], + "license": "MIT", + "maintainers": [ + { + "email": "snnskwtnb@gmail.com", + "name": "shinnn" + } + ], + "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/doctrine/node_modules/isarray/README.md b/tools/eslint/node_modules/isarray/README.md similarity index 100% rename from tools/eslint/node_modules/doctrine/node_modules/isarray/README.md rename to tools/eslint/node_modules/isarray/README.md diff --git a/tools/eslint/node_modules/isarray/build/build.js b/tools/eslint/node_modules/isarray/build/build.js new file mode 100644 index 00000000000000..e1856ef0943728 --- /dev/null +++ b/tools/eslint/node_modules/isarray/build/build.js @@ -0,0 +1,208 @@ + +/** + * 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/isarray/component.json similarity index 100% rename from tools/eslint/node_modules/doctrine/node_modules/isarray/component.json rename to tools/eslint/node_modules/isarray/component.json diff --git a/tools/eslint/node_modules/doctrine/node_modules/isarray/index.js b/tools/eslint/node_modules/isarray/index.js similarity index 100% rename from tools/eslint/node_modules/doctrine/node_modules/isarray/index.js rename to tools/eslint/node_modules/isarray/index.js diff --git a/tools/eslint/node_modules/isarray/package.json b/tools/eslint/node_modules/isarray/package.json new file mode 100644 index 00000000000000..699ef751cc8680 --- /dev/null +++ b/tools/eslint/node_modules/isarray/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "isarray@0.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + ] + ], + "_from": "isarray@0.0.1", + "_id": "isarray@0.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/isarray", + "_npmUser": { + "email": "julian@juliangruber.com", + "name": "juliangruber" + }, + "_npmVersion": "1.2.18", + "_phantomChildren": {}, + "_requested": { + "name": "isarray", + "raw": "isarray@0.0.1", + "rawSpec": "0.0.1", + "scope": null, + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/eslint/doctrine", + "/eslint/readable-stream" + ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_shrinkwrap": null, + "_spec": "isarray@0.0.1", + "_where": "/Users/trott/test/node_modules/eslint/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": "*" + }, + "directories": {}, + "dist": { + "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "homepage": "https://github.com/juliangruber/isarray", + "keywords": [ + "browser", + "isarray", + "array" + ], + "license": "MIT", + "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": "tap test/*.js" + }, + "version": "0.0.1" +} diff --git a/tools/eslint/node_modules/js-yaml/CHANGELOG.md b/tools/eslint/node_modules/js-yaml/CHANGELOG.md index f057ec33fc41f0..e7ff17185e53b8 100644 --- a/tools/eslint/node_modules/js-yaml/CHANGELOG.md +++ b/tools/eslint/node_modules/js-yaml/CHANGELOG.md @@ -1,3 +1,80 @@ +3.5.3 / 2016-02-11 +------------------ + +- Maintenance release. + + +3.5.2 / 2016-01-11 +------------------ + +- Maintenance: missed comma in bower config. + + +3.5.1 / 2016-01-11 +------------------ + +- Removed `inherit` dependency, #239. +- Better browserify workaround for esprima load. +- Demo rewrite. + + +3.5.0 / 2016-01-10 +------------------ + +- Dumper. Fold strings only, #217. +- Dumper. `norefs` option, to clone linked objects, #229. +- Loader. Throw a warning for duplicate keys, #166. +- Improved browserify support (mark `esprima` & `Buffer` excluded). + + +3.4.6 / 2015-11-26 +------------------ + +- Use standalone `inherit` to keep browserified files clear. + + +3.4.5 / 2015-11-23 +------------------ + +- Added `lineWidth` option to dumper. + + +3.4.4 / 2015-11-21 +------------------ + +- Fixed floats dump (missed dot for scientific format), #220. +- Allow non-printable characters inside quoted scalars, #192. + + +3.4.3 / 2015-10-10 +------------------ + +- Maintenance release - deps bump (esprima, argparse). + + +3.4.2 / 2015-09-09 +------------------ + +- Fixed serialization of duplicated entries in sequences, #205. + Thanks to @vogelsgesang. + + +3.4.1 / 2015-09-05 +------------------ + +- Fixed stacktrace handling in generated errors, for browsers (FF/IE). + + +3.4.0 / 2015-08-23 +------------------ + +- Fixed multiline keys dump, #197. Thanks to @tcr. +- Don't throw on warnongs anymore. Use `onWarning` option to catch. +- Throw error on unknown tags (was warning before). +- Fixed heading line breaks in some scalars (regression). +- Reworked internals of error class. + + 3.3.1 / 2015-05-13 ------------------ diff --git a/tools/eslint/node_modules/js-yaml/README.md b/tools/eslint/node_modules/js-yaml/README.md index 8ad571f1059090..2a595ef2327cf2 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,8 @@ 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 styles: @@ -238,7 +241,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 +273,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..87a0c994e05ce8 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 +361,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 +412,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 +434,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 +454,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 +492,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 +527,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 +539,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 +580,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 +595,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 +613,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 +637,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 +646,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 +690,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 +747,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 +755,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 +776,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 +787,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 +799,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 +821,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 +833,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 +865,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 +898,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 +913,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 +1006,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 +1091,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 +1129,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 +1139,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; + } }; @@ -1227,18 +1209,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 +1236,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 +1276,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 +1295,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 +1313,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 +1322,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 +1337,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 +1354,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 +1377,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 +1407,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 +1416,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 +1477,7 @@ function readSingleQuotedScalar(state, nodeIndent) { ch = state.input.charCodeAt(state.position); - if (0x27/* ' */ !== ch) { + if (ch !== 0x27/* ' */) { return false; } @@ -1495,12 +1486,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 +1520,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 +1534,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 +1605,7 @@ function readFlowCollection(state, nodeIndent) { isPair, isExplicitPair, isMapping, + overridableKeys = {}, keyNode, keyTag, valueNode, @@ -1633,13 +1625,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 +1650,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 +1668,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 +1677,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 +1688,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 +1723,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 +1752,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 +1809,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 +1825,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 +1851,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 +1887,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 +1911,7 @@ function readBlockMapping(state, nodeIndent, flowIndent) { _tag = state.tag, _anchor = state.anchor, _result = {}, + overridableKeys = {}, keyTag = null, keyNode = null, valueNode = null, @@ -1925,13 +1919,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 +1933,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 +1969,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 +1977,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 +2022,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 +2030,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 +2043,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 +2067,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 +2092,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 +2101,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 +2138,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 +2157,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 +2180,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 +2219,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 +2248,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 +2271,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 +2280,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 +2295,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 +2332,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 +2341,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 +2349,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 +2377,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 +2390,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 +2401,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 +2434,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 +2457,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 +2479,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 +2492,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 +2518,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 +2564,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 +2572,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 +2584,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 +2651,7 @@ function compileList(schema, name, result) { }); return result.filter(function (type, index) { - return -1 === exclude.indexOf(index); + return exclude.indexOf(index) === -1; }); } @@ -2695,7 +2677,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 +2695,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 +2877,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 +2892,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 +2908,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 +2931,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 +2953,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 +2988,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 +3053,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 +3068,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 +3098,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 +3109,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 +3141,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 +3212,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 +3230,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 +3241,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 +3255,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 +3265,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 +3276,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 +3303,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 +3337,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 +3374,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 +3412,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 +3436,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 +3447,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 +3462,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 +3479,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 +3490,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 +3528,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 +3546,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 +3555,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 +3569,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 +3582,7 @@ function constructYamlNull() { } function isNull(object) { - return null === object; + return object === null; } module.exports = new Type('tag:yaml.org,2002:null', { @@ -3678,9 +3608,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 +3617,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 +3653,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 +3663,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 +3676,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 +3707,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 +3718,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 +3732,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 +3748,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){ @@ -3863,19 +3769,8 @@ var YAML_TIMESTAMP_REGEXP = new RegExp( '(?::([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; - } - + if (data === null) return false; + if (YAML_TIMESTAMP_REGEXP.exec(data) === null) return false; return true; } @@ -3885,9 +3780,7 @@ function constructYamlTimestamp(data) { 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 +3812,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..9da36310625613 --- /dev/null +++ b/tools/eslint/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1,3 @@ +/* js-yaml 3.5.3 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.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,k,C,j,I,S,E,O,F;if(0===t.length)return void(e.dump="''");if(-1!==te.indexOf(t))return void(e.dump="'"+t+"'");for(r=!0,o=t.length?t.charCodeAt(0):0,s=L===o||L===t.charCodeAt(t.length-1),($===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,k=0;k0&&(I=t.charCodeAt(k-1),I===L&&(f=!1,l=!1)),l&&(S=k-x,x=k,S>v&&(v=S))),w!==D&&(m=!1),g.takeUpTo(k),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&&P!==e&&V!==e&&Z!==e&&J!==e&&X!==e&&U!==e&&Y!==e&&B!==e&&M!==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 k(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 C(e,t){return k(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,L=32,M=33,D=34,U=35,q=37,Y=38,R=39,B=42,P=44,$=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=k,t.exports.safeDump=C},{"./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 B(t,new P(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 k(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 C(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 L(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=M(e,t);if(0!==n.length){if(1===n.length)return n[0];throw new B("expected a single document in the stream, but found more")}}function q(e,t,n){D(e,t,R.extend({schema:$},n))}function Y(e,t){return U(e,R.extend({schema:$},t))}for(var R=e("./common"),B=e("./exception"),P=e("./mark"),$=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)?!0:!1}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?!1:!0}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)?!1:!0}function r(e){var t,n,i,r,o,a,c,u,l,p,f=0,h=null;if(t=s.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],c=+t[6],t[7]){for(f=t[7].slice(0,3);f.length<3;)f+="0";f=+f}return t[9]&&(u=+t[10],l=+(t[11]||0),h=6e4*(60*u+l),"-"===t[9]&&(h=-h)),p=new Date(Date.UTC(n,i,r,o,a,c,f)),h&&p.setTime(p.getTime()-h),p}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]?)(?:(?:[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..043d2bb47da7a8 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); } @@ -115,6 +113,8 @@ function State(options) { 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.implicitTypes = this.schema.compiledImplicit; this.explicitTypes = this.schema.compiledExplicit; @@ -143,9 +143,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 +208,18 @@ 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 (DEPRECATED_BOOLEANS_SYNTAX.indexOf(object) !== -1) { state.dump = "'" + object + "'"; return; } @@ -238,14 +238,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 +258,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 +309,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 +331,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 +351,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 +389,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 +424,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 +436,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 +477,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 +492,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 +510,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 +534,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 +543,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 +587,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 +644,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 +652,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 +673,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 +684,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 +696,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 +718,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 +730,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 +762,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 +795,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..a222a449ba3375 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 @@ -15,19 +15,8 @@ var YAML_TIMESTAMP_REGEXP = new RegExp( '(?::([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; - } - + if (data === null) return false; + if (YAML_TIMESTAMP_REGEXP.exec(data) === null) return false; return true; } @@ -37,9 +26,7 @@ function constructYamlTimestamp(data) { 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 +58,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/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': ' +``` + +## 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..7f7650f3712ae0 --- /dev/null +++ b/tools/eslint/node_modules/pluralize/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "pluralize@^1.2.1", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "pluralize@>=1.2.1 <2.0.0", + "_id": "pluralize@1.2.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/pluralize/-/pluralize-1.2.1.tgz", + "_shasum": "d1a21483fd22bb41e58a12fa3421823140897c45", + "_shrinkwrap": null, + "_spec": "pluralize@^1.2.1", + "_where": "/Users/trott/test/node_modules/eslint", + "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": [ + "pluralize.js", + "LICENSE" + ], + "gitHead": "a956c0dbca8782b588f8cd3229f16e8436d1ee73", + "homepage": "https://github.com/blakeembrey/pluralize", + "keywords": [ + "plural", + "plurals", + "pluralize", + "singular", + "singularize" + ], + "license": "MIT", + "main": "pluralize.js", + "maintainers": [ + { + "email": "me@blakeembrey.com", + "name": "blakeembrey" + } + ], + "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/CHANGELOG.md b/tools/eslint/node_modules/prelude-ls/CHANGELOG.md similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/prelude-ls/CHANGELOG.md rename to tools/eslint/node_modules/prelude-ls/CHANGELOG.md 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..a740fa38cc51f5 --- /dev/null +++ b/tools/eslint/node_modules/prelude-ls/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + "prelude-ls@~1.1.2", + "/Users/trott/test/node_modules/eslint/node_modules/optionator" + ] + ], + "_from": "prelude-ls@>=1.1.2 <1.2.0", + "_id": "prelude-ls@1.1.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/levn", + "/eslint/optionator", + "/eslint/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/trott/test/node_modules/eslint/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": [ + "lib/", + "README.md", + "LICENSE" + ], + "gitHead": "d69be8fd8a682321ba24eced17caf3a1b8ca73b8", + "homepage": "http://preludels.com", + "keywords": [ + "prelude", + "livescript", + "utility", + "ls", + "coffeescript", + "javascript", + "library", + "functional", + "array", + "list", + "object", + "string" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/gkz/prelude-ls/master/LICENSE" + } + ], + "main": "lib/", + "maintainers": [ + { + "email": "z@georgezahariev.com", + "name": "gkz" + } + ], + "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/.travis.yml b/tools/eslint/node_modules/process-nextick-args/.travis.yml new file mode 100644 index 00000000000000..36201b10017a5e --- /dev/null +++ b/tools/eslint/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/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/tools/eslint/node_modules/process-nextick-args/license.md b/tools/eslint/node_modules/process-nextick-args/license.md new file mode 100644 index 00000000000000..c67e3532b54245 --- /dev/null +++ b/tools/eslint/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# 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/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..64f80345e8d5a4 --- /dev/null +++ b/tools/eslint/node_modules/process-nextick-args/package.json @@ -0,0 +1,71 @@ +{ + "_args": [ + [ + "process-nextick-args@~1.0.6", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + } + ], + "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/tools/eslint/node_modules/process-nextick-args/readme.md b/tools/eslint/node_modules/process-nextick-args/readme.md new file mode 100644 index 00000000000000..78e7cfaeb7acde --- /dev/null +++ b/tools/eslint/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +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/tools/eslint/node_modules/process-nextick-args/test.js b/tools/eslint/node_modules/process-nextick-args/test.js new file mode 100644 index 00000000000000..ef15721584ac99 --- /dev/null +++ b/tools/eslint/node_modules/process-nextick-args/test.js @@ -0,0 +1,24 @@ +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/tools/eslint/node_modules/progress/.npmignore b/tools/eslint/node_modules/progress/.npmignore new file mode 100644 index 00000000000000..f1250e584c94b8 --- /dev/null +++ b/tools/eslint/node_modules/progress/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/tools/eslint/node_modules/progress/History.md b/tools/eslint/node_modules/progress/History.md new file mode 100644 index 00000000000000..6a02e974ed8e89 --- /dev/null +++ b/tools/eslint/node_modules/progress/History.md @@ -0,0 +1,77 @@ +### 1.1.7 / 2014-06-30 + + * fixed a bug that occurs when a progress bar attempts to draw itself + on a console with very few columns + +### 1.1.6 / 2014-06-16 + + * now prevents progress bar from exceeding TTY width by limiting its width to + the with of the TTY + +### 1.1.5 / 2014-03-25 + + * updated documentation and various other repo maintenance + * updated makefile to run examples with `make` + * removed dependency on readline module + +### 1.1.4 / 2014-03-14 + + * now supports streams, for example output progress bar to stderr, while piping + stdout + * increases performance and flicker by remembering the last drawn progress bar + +### 1.1.3 / 2013-12-31 + + * fixes a bug where bar would bug when initializing + * allows to pass updated tokens when ticking or updating the bar + * fixes a bug where the bar would throw if skipping to far + +### 1.1.2 / 2013-10-17 + + * lets you pass an `fmt` and a `total` instead of an options object + +### 1.1.0 / 2013-09-18 + + * eta and elapsed tokens default to 0.0 instead of ?.? + * better JSDocs + * added back and forth example + * added method to update the progress bar to a specific percentage + * added an option to hide the bar on completion + +### 1.0.1 / 2013-08-07 + + * on os x readline now works, reverting the terminal hack + +### 1.0.0 / 2013-06-18 + + * remove .version + * merge pull request #15 from davglass/readline-osx + * on OSX revert back to terminal hack to avoid a readline bug + +### 0.1.0 / 2012-09-19 + + * fixed logic bug that caused bar to jump one extra space at the end [davglass] + * working with readline impl, even on Windows [davglass] + * using readline instead of the \r hack [davglass] + +### 0.0.5 / 2012-08-07 + + * add ability to tick by zero chunks - tick(0) + * fix ETA. Closes #4 [lwille] + +### 0.0.4 / 2011-11-14 + + * allow more recent versions of node + +### 0.0.3 / 2011-04-20 + + * changed; erase the line when complete + +### 0.0.2 / 2011-04-20 + + * added custom tokens support + * fixed; clear line before writing + +### 0.0.1 / 2010-01-03 + + * initial release 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..c93112fbfa8ae4 --- /dev/null +++ b/tools/eslint/node_modules/progress/package.json @@ -0,0 +1,93 @@ +{ + "_args": [ + [ + "progress@^1.1.8", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "progress@>=1.1.8 <2.0.0", + "_id": "progress@1.1.8", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/progress/-/progress-1.1.8.tgz", + "_shasum": "e260c78f6161cdd9b0e56cc3e0a85de17c7a57be", + "_shrinkwrap": null, + "_spec": "progress@^1.1.8", + "_where": "/Users/trott/test/node_modules/eslint", + "author": { + "email": "tj@vision-media.ca", + "name": "TJ Holowaychuk" + }, + "bugs": { + "url": "https://github.com/visionmedia/node-progress/issues" + }, + "contributors": [ + { + "email": "christoffer.hallas@gmail.com", + "name": "Christoffer Hallas" + }, + { + "email": "scalesjordan@gmail.com", + "name": "Jordan Scales" + } + ], + "dependencies": {}, + "description": "Flexible ascii progress bar", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "e260c78f6161cdd9b0e56cc3e0a85de17c7a57be", + "tarball": "http://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": [ + { + "email": "tj@vision-media.ca", + "name": "tjholowaychuk" + }, + { + "email": "christoffer.hallas@forsvikgroup.com", + "name": "hallas" + }, + { + "email": "scalesjordan@gmail.com", + "name": "prezjordan" + } + ], + "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..30fe718951a567 --- /dev/null +++ b/tools/eslint/node_modules/read-json-sync/package.json @@ -0,0 +1,95 @@ +{ + "_args": [ + [ + "read-json-sync@^1.1.0", + "/Users/trott/test/node_modules/eslint/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": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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", + "json", + "file", + "read", + "load", + "parse", + "synchronous", + "synchronously", + "sync" + ], + "license": "MIT", + "maintainers": [ + { + "email": "snnskwtnb@gmail.com", + "name": "shinnn" + } + ], + "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/tools/eslint/node_modules/readable-stream/.npmignore b/tools/eslint/node_modules/readable-stream/.npmignore new file mode 100644 index 00000000000000..38344f87a62766 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js \ No newline at end of file diff --git a/tools/eslint/node_modules/readable-stream/.travis.yml b/tools/eslint/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000000000..cfe1c9439388b6 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - 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: 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: node + env: TASK=test + - node_js: node + env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="41..beta" + - node_js: node + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="36..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="['6.1', '7.1', '8.2']" + - node_js: node + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="['6.1', '7.1', '8.2']" + - node_js: node + env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" + - node_js: node + 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/tools/eslint/node_modules/readable-stream/.zuul.yml b/tools/eslint/node_modules/readable-stream/.zuul.yml new file mode 100644 index 00000000000000..96d9cfbd38662f --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/tools/eslint/node_modules/readable-stream/LICENSE b/tools/eslint/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000000000..e3d4e695a4cff2 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/LICENSE @@ -0,0 +1,18 @@ +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/tools/eslint/node_modules/readable-stream/README.md b/tools/eslint/node_modules/readable-stream/README.md new file mode 100644 index 00000000000000..77fafa3da15f9f --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# 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/tools/eslint/node_modules/readable-stream/doc/stream.markdown b/tools/eslint/node_modules/readable-stream/doc/stream.markdown new file mode 100644 index 00000000000000..3988c0cbd0d9c9 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1730 @@ +# 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][] 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 Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.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.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.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][] +* [http requests, on the server][] +* [fs read streams][] +* [zlib streams][] +* [crypto streams][] +* [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. + +```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: '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', 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. + +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, `.read()` will return that data. In the latter case, +`.read()` will return null. For instance, in the following example, `foo.txt` +is an empty file: + +```javascript +var fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', function() { + console.log('readable:', rr.read()); +}); +rr.on('end', function() { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +bash-3.2$ 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 `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.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.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.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. + +```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][]. + +Note that calling `readable.read([size])` 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 [`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.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.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. + +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, 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; + } + } + } +} +``` +Note that, unlike `stream.push(chunk)`, `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 `_read` implementation on a custom stream). Following +the call to `unshift` with an immediate `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" below for +more information.) + +If you are using an older Node.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 Node.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.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][] + +### 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][] +* [crypto streams][] +* [tcp sockets][] +* [child process stdin][] +* [process.stdout][], [process.stderr][] + +#### 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 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 object} + +Emitted if there was an error when writing or piping data. + +#### 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); +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at `.uncork()` or at `.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 [`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! +``` + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding + +Sets the default encoding for a writable stream. + +#### writable.uncork() + +Flush all data, buffered since `.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. +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.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.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 [`_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. + +#### 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 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, `_read` should +start pushing that data into the read queue by calling `this.push(dataChunk)`. +`_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 `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)`][]. + +#### 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 `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: + +```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(); +}; +``` + +#### 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); + // 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 [`_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. + +#### 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. + +#### 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. + +#### 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: + +```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. + +#### 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 Node.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.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. + + +## 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 +```javascript +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 +```javascript +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 +```javascript +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 +```javascript +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)`][]. 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. + +### 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 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 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 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. + +```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(); +}; +``` + +### `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 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()`][], 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 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. + +[request to an HTTP server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage +[EventEmitter]: https://nodejs.org/docs/v5.1.0/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://nodejs.org/docs/v5.1.0/api/net.html#net_class_net_socket +[http responses, on the client]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage +[http requests, on the server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage +[http requests, on the client]: https://nodejs.org/docs/v5.1.0/api/http.html#http_class_http_clientrequest +[http responses, on the server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_class_http_serverresponse +[fs read streams]: https://nodejs.org/docs/v5.1.0/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v5.1.0/api/fs.html#fs_class_fs_writestream +[zlib streams]: zlib.html +[zlib]: zlib.html +[crypto streams]: crypto.html +[crypto]: crypto.html +[tls.CryptoStream]: https://nodejs.org/docs/v5.1.0/api/tls.html#tls_class_cryptostream +[process.stdin]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdin +[stdout]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdout +[process.stdout]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdout +[process.stderr]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stderr +[child process stdout and stderr]: https://nodejs.org/docs/v5.1.0/api/child_process.html#child_process_child_stdout +[child process stdin]: https://nodejs.org/docs/v5.1.0/api/child_process.html#child_process_child_stdin +[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://nodejs.org/docs/v5.1.0/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/readable-stream/doc/wg-meetings/2015-01-30.md b/tools/eslint/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000000000..c141a99c26c638 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,58 @@ +# 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/readable-stream/duplex.js b/tools/eslint/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000000000..ca807af87620dd --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_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..69558af037cd66 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,82 @@ +// 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/readable-stream/lib/_stream_passthrough.js b/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000000000..bddfdd01537a40 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,27 @@ +// 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/readable-stream/lib/_stream_readable.js b/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000000000..50852aee7e6e02 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,975 @@ +'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; +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; + + // 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 { + 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 > 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.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 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; +} 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..3675d18d915610 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,197 @@ +// 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/readable-stream/lib/_stream_writable.js b/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000000000..1fa5eb695adde6 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,529 @@ +// 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 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; +} + +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; + } + } 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/readable-stream/package.json b/tools/eslint/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..3e0a2b06d407d3 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "readable-stream@~2.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/concat-stream" + ] + ], + "_from": "readable-stream@>=2.0.0 <2.1.0", + "_id": "readable-stream@2.0.5", + "_inCache": true, + "_installable": true, + "_location": "/eslint/readable-stream", + "_nodeVersion": "5.1.1", + "_npmUser": { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + }, + "_npmVersion": "3.3.12", + "_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": [ + "/eslint/concat-stream" + ], + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz", + "_shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669", + "_shrinkwrap": null, + "_spec": "readable-stream@~2.0.0", + "_where": "/Users/trott/test/node_modules/eslint/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": "0.0.1", + "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 iojs v2.x", + "devDependencies": { + "tap": "~0.2.6", + "tape": "~4.0.0", + "zuul": "~3.0.0" + }, + "directories": {}, + "dist": { + "shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz" + }, + "gitHead": "a4f23d8e451267684a8160679ce16e16149fe72b", + "homepage": "https://github.com/nodejs/readable-stream#readme", + "keywords": [ + "readable", + "stream", + "pipe" + ], + "license": "MIT", + "main": "readable.js", + "maintainers": [ + { + "email": "isaacs@npmjs.com", + "name": "isaacs" + }, + { + "email": "nathan@tootallnate.net", + "name": "tootallnate" + }, + { + "email": "rod@vagg.org", + "name": "rvagg" + }, + { + "email": "calvin.metcalf@gmail.com", + "name": "cwmma" + } + ], + "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", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + }, + "version": "2.0.5" +} diff --git a/tools/eslint/node_modules/readable-stream/passthrough.js b/tools/eslint/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000000000..27e8d8a55165f9 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/tools/eslint/node_modules/readable-stream/readable.js b/tools/eslint/node_modules/readable-stream/readable.js new file mode 100644 index 00000000000000..6222a579864dd2 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/readable.js @@ -0,0 +1,12 @@ +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/readable-stream/transform.js b/tools/eslint/node_modules/readable-stream/transform.js new file mode 100644 index 00000000000000..5d482f0780e993 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/tools/eslint/node_modules/readable-stream/writable.js b/tools/eslint/node_modules/readable-stream/writable.js new file mode 100644 index 00000000000000..e1e9efdf3c12e9 --- /dev/null +++ b/tools/eslint/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_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..6c0e6ea166fe1c --- /dev/null +++ b/tools/eslint/node_modules/readline2/package.json @@ -0,0 +1,89 @@ +{ + "_args": [ + [ + "readline2@^1.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + ] + ], + "_from": "readline2@>=1.0.1 <2.0.0", + "_id": "readline2@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/inquirer" + ], + "_resolved": "https://registry.npmjs.org/readline2/-/readline2-1.0.1.tgz", + "_shasum": "41059608ffc154757b715d9989d199ffbf372e35", + "_shrinkwrap": null, + "_spec": "readline2@^1.0.1", + "_where": "/Users/trott/test/node_modules/eslint/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": [ + "cli", + "terminal", + "readline", + "tty", + "ansi" + ], + "license": "MIT", + "maintainers": [ + { + "email": "admin@simonboudrias.com", + "name": "sboudrias" + } + ], + "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/resolve/.travis.yml b/tools/eslint/node_modules/resolve/.travis.yml new file mode 100644 index 00000000000000..895dbd36234210 --- /dev/null +++ b/tools/eslint/node_modules/resolve/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.6 + - 0.8 diff --git a/tools/eslint/node_modules/resolve/LICENSE b/tools/eslint/node_modules/resolve/LICENSE new file mode 100644 index 00000000000000..ee27ba4b4412b0 --- /dev/null +++ b/tools/eslint/node_modules/resolve/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/resolve/example/async.js b/tools/eslint/node_modules/resolve/example/async.js new file mode 100644 index 00000000000000..6624ff7268f409 --- /dev/null +++ b/tools/eslint/node_modules/resolve/example/async.js @@ -0,0 +1,5 @@ +var resolve = require('../'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err) + else console.log(res) +}); diff --git a/tools/eslint/node_modules/resolve/example/sync.js b/tools/eslint/node_modules/resolve/example/sync.js new file mode 100644 index 00000000000000..54b2cc1004223d --- /dev/null +++ b/tools/eslint/node_modules/resolve/example/sync.js @@ -0,0 +1,3 @@ +var resolve = require('../'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); diff --git a/tools/eslint/node_modules/resolve/index.js b/tools/eslint/node_modules/resolve/index.js new file mode 100644 index 00000000000000..51f194b4ca7adb --- /dev/null +++ b/tools/eslint/node_modules/resolve/index.js @@ -0,0 +1,5 @@ +var core = require('./lib/core'); +exports = module.exports = require('./lib/async'); +exports.core = core; +exports.isCore = function (x) { return core[x] }; +exports.sync = require('./lib/sync'); diff --git a/tools/eslint/node_modules/resolve/lib/async.js b/tools/eslint/node_modules/resolve/lib/async.js new file mode 100644 index 00000000000000..fd7f4e5e5c2d02 --- /dev/null +++ b/tools/eslint/node_modules/resolve/lib/async.js @@ -0,0 +1,192 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); +var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\//; + +module.exports = function resolve (x, opts, cb) { + if (typeof opts === 'function') { + cb = opts; + opts = {}; + } + if (!opts) opts = {}; + if (typeof x !== 'string') { + return process.nextTick(function () { + cb(new Error('path must be a string')); + }); + } + + var isFile = opts.isFile || function (file, cb) { + fs.stat(file, function (err, stat) { + if (err && err.code === 'ENOENT') cb(null, false) + else if (err) cb(err) + else cb(null, stat.isFile() || stat.isFIFO()) + }); + }; + var readFile = opts.readFile || fs.readFile; + + var extensions = opts.extensions || [ '.js' ]; + var y = opts.basedir || path.dirname(caller()); + + opts.paths = opts.paths || []; + + if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[\\\/])/.test(x)) { + var res = path.resolve(y, x); + if (x === '..') res += '/'; + if (/\/$/.test(x) && res === y) { + loadAsDirectory(res, opts.package, onfile); + } + else loadAsFile(res, opts.package, onfile); + } + else loadNodeModules(x, y, function (err, n, pkg) { + if (err) cb(err) + else if (n) cb(null, n, pkg) + else if (core[x]) return cb(null, x); + else cb(new Error("Cannot find module '" + x + "' from '" + y + "'")) + }); + + function onfile (err, m, pkg) { + if (err) cb(err) + else if (m) cb(null, m, pkg) + else loadAsDirectory(res, function (err, d, pkg) { + if (err) cb(err) + else if (d) cb(null, d, pkg) + else cb(new Error("Cannot find module '" + x + "' from '" + y + "'")) + }) + } + + function loadAsFile (x, pkg, cb) { + if (typeof pkg === 'function') { + cb = pkg; + pkg = undefined; + } + + var exts = [''].concat(extensions); + load(exts, x, pkg) + + function load (exts, x, pkg) { + if (exts.length === 0) return cb(null, undefined, pkg); + var file = x + exts[0]; + + if (pkg) onpkg(null, pkg) + else loadpkg(path.dirname(file), onpkg); + + function onpkg (err, pkg_, dir) { + pkg = pkg_; + if (err) return cb(err) + if (dir && pkg && opts.pathFilter) { + var rfile = path.relative(dir, file); + var rel = rfile.slice(0, rfile.length - exts[0].length); + var r = opts.pathFilter(pkg, x, rel); + if (r) return load( + [''].concat(extensions.slice()), + path.resolve(dir, r), + pkg + ); + } + isFile(file, onex); + } + function onex (err, ex) { + if (err) cb(err) + else if (!ex) load(exts.slice(1), x, pkg) + else cb(null, file, pkg) + } + } + } + + function loadpkg (dir, cb) { + if (dir === '' || dir === '/') return cb(null); + if (process.platform === 'win32' && /^\w:[\\\/]*$/.test(dir)) { + return cb(null); + } + if (/[\\\/]node_modules[\\\/]*$/.test(dir)) return cb(null); + + var pkgfile = path.join(dir, 'package.json'); + isFile(pkgfile, function (err, ex) { + // on err, ex is false + if (!ex) return loadpkg( + path.dirname(dir), cb + ); + + readFile(pkgfile, function (err, body) { + if (err) cb(err); + try { var pkg = JSON.parse(body) } + catch (err) {} + + if (pkg && opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + cb(null, pkg, dir); + }); + }); + } + + function loadAsDirectory (x, fpkg, cb) { + if (typeof fpkg === 'function') { + cb = fpkg; + fpkg = opts.package; + } + + var pkgfile = path.join(x, '/package.json'); + isFile(pkgfile, function (err, ex) { + if (err) return cb(err); + if (!ex) return loadAsFile(path.join(x, '/index'), fpkg, cb); + + readFile(pkgfile, function (err, body) { + if (err) return cb(err); + try { + var pkg = JSON.parse(body); + } + catch (err) {} + + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, pkgfile); + } + + if (pkg.main) { + if (pkg.main === '.' || pkg.main === './'){ + pkg.main = 'index' + } + loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + if (!pkg) return loadAsFile(path.join(x, '/index'), pkg, cb); + + var dir = path.resolve(x, pkg.main); + loadAsDirectory(dir, pkg, function (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + return; + } + + loadAsFile(path.join(x, '/index'), pkg, cb); + }); + }); + } + + function loadNodeModules (x, start, cb) { + (function process (dirs) { + if (dirs.length === 0) return cb(null, undefined); + var dir = dirs[0]; + + var file = path.join(dir, '/', x); + loadAsFile(file, undefined, onfile); + + function onfile (err, m, pkg) { + if (err) return cb(err); + if (m) return cb(null, m, pkg); + loadAsDirectory(path.join(dir, '/', x), undefined, ondir); + } + + function ondir (err, n, pkg) { + if (err) return cb(err); + if (n) return cb(null, n, pkg); + process(dirs.slice(1)); + } + })(nodeModulesPaths(start, opts)); + } +}; diff --git a/tools/eslint/node_modules/resolve/lib/caller.js b/tools/eslint/node_modules/resolve/lib/caller.js new file mode 100644 index 00000000000000..5536549b046d3c --- /dev/null +++ b/tools/eslint/node_modules/resolve/lib/caller.js @@ -0,0 +1,8 @@ +module.exports = function () { + // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi + var origPrepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = function (_, stack) { return stack }; + var stack = (new Error()).stack; + Error.prepareStackTrace = origPrepareStackTrace; + return stack[2].getFileName(); +}; diff --git a/tools/eslint/node_modules/resolve/lib/core.js b/tools/eslint/node_modules/resolve/lib/core.js new file mode 100644 index 00000000000000..ea4a6c87effc0b --- /dev/null +++ b/tools/eslint/node_modules/resolve/lib/core.js @@ -0,0 +1,4 @@ +module.exports = require('./core.json').reduce(function (acc, x) { + acc[x] = true; + return acc; +}, {}); diff --git a/tools/eslint/node_modules/resolve/lib/core.json b/tools/eslint/node_modules/resolve/lib/core.json new file mode 100644 index 00000000000000..28560f7ef74126 --- /dev/null +++ b/tools/eslint/node_modules/resolve/lib/core.json @@ -0,0 +1,38 @@ +[ + "assert", + "buffer_ieee754", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "_debugger", + "dgram", + "dns", + "domain", + "events", + "freelist", + "fs", + "http", + "https", + "_linklist", + "module", + "net", + "os", + "path", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "string_decoder", + "sys", + "timers", + "tls", + "tty", + "url", + "util", + "vm", + "zlib" +] diff --git a/tools/eslint/node_modules/resolve/lib/node-modules-paths.js b/tools/eslint/node_modules/resolve/lib/node-modules-paths.js new file mode 100644 index 00000000000000..ce0a0d9f2fb104 --- /dev/null +++ b/tools/eslint/node_modules/resolve/lib/node-modules-paths.js @@ -0,0 +1,38 @@ +var path = require('path'); + +module.exports = function (start, opts) { + var modules = opts.moduleDirectory + ? [].concat(opts.moduleDirectory) + : ['node_modules'] + ; + + // ensure that `start` is an absolute path at this point, + // resolving against the process' current working directory + start = path.resolve(start); + + var prefix = '/'; + if (/^([A-Za-z]:)/.test(start)) { + prefix = ''; + } else if (/^\\\\/.test(start)) { + prefix = '\\\\'; + } + + var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\/+/; + + var parts = start.split(splitRe); + + var dirs = []; + for (var i = parts.length - 1; i >= 0; i--) { + if (modules.indexOf(parts[i]) !== -1) continue; + dirs = dirs.concat(modules.map(function(module_dir) { + return prefix + path.join( + path.join.apply(path, parts.slice(0, i + 1)), + module_dir + ); + })); + } + if (process.platform === 'win32'){ + dirs[dirs.length-1] = dirs[dirs.length-1].replace(":", ":\\"); + } + return dirs.concat(opts.paths); +} diff --git a/tools/eslint/node_modules/resolve/lib/sync.js b/tools/eslint/node_modules/resolve/lib/sync.js new file mode 100644 index 00000000000000..bc4a2a8543dfd0 --- /dev/null +++ b/tools/eslint/node_modules/resolve/lib/sync.js @@ -0,0 +1,81 @@ +var core = require('./core'); +var fs = require('fs'); +var path = require('path'); +var caller = require('./caller.js'); +var nodeModulesPaths = require('./node-modules-paths.js'); + +module.exports = function (x, opts) { + if (!opts) opts = {}; + var isFile = opts.isFile || function (file) { + try { var stat = fs.statSync(file) } + catch (err) { if (err && err.code === 'ENOENT') return false } + return stat.isFile() || stat.isFIFO(); + }; + var readFileSync = opts.readFileSync || fs.readFileSync; + + var extensions = opts.extensions || [ '.js' ]; + var y = opts.basedir || path.dirname(caller()); + + opts.paths = opts.paths || []; + + if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[\\\/])/.test(x)) { + var res = path.resolve(y, x); + if (x === '..') res += '/'; + var m = loadAsFileSync(res) || loadAsDirectorySync(res); + if (m) return m; + } else { + var n = loadNodeModulesSync(x, y); + if (n) return n; + } + + if (core[x]) return x; + + throw new Error("Cannot find module '" + x + "' from '" + y + "'"); + + function loadAsFileSync (x) { + if (isFile(x)) { + return x; + } + + for (var i = 0; i < extensions.length; i++) { + var file = x + extensions[i]; + if (isFile(file)) { + return file; + } + } + } + + function loadAsDirectorySync (x) { + var pkgfile = path.join(x, '/package.json'); + if (isFile(pkgfile)) { + var body = readFileSync(pkgfile, 'utf8'); + try { + var pkg = JSON.parse(body); + if (opts.packageFilter) { + pkg = opts.packageFilter(pkg, x); + } + + if (pkg.main) { + var m = loadAsFileSync(path.resolve(x, pkg.main)); + if (m) return m; + var n = loadAsDirectorySync(path.resolve(x, pkg.main)); + if (n) return n; + } + } + catch (err) {} + } + + return loadAsFileSync(path.join( x, '/index')); + } + + function loadNodeModulesSync (x, start) { + var dirs = nodeModulesPaths(start, opts); + for (var i = 0; i < dirs.length; i++) { + var dir = dirs[i]; + var m = loadAsFileSync(path.join( dir, '/', x)); + if (m) return m; + var n = loadAsDirectorySync(path.join( dir, '/', x )); + if (n) return n; + } + } +}; diff --git a/tools/eslint/node_modules/resolve/package.json b/tools/eslint/node_modules/resolve/package.json new file mode 100644 index 00000000000000..73fb88ffb755da --- /dev/null +++ b/tools/eslint/node_modules/resolve/package.json @@ -0,0 +1,82 @@ +{ + "_args": [ + [ + "resolve@^1.1.6", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "resolve@>=1.1.6 <2.0.0", + "_id": "resolve@1.1.7", + "_inCache": true, + "_installable": true, + "_location": "/eslint/resolve", + "_nodeVersion": "4.2.1", + "_npmUser": { + "email": "substack@gmail.com", + "name": "substack" + }, + "_npmVersion": "3.4.1", + "_phantomChildren": {}, + "_requested": { + "name": "resolve", + "raw": "resolve@^1.1.6", + "rawSpec": "^1.1.6", + "scope": null, + "spec": ">=1.1.6 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "_shasum": "203114d82ad2c5ed9e8e0411b3932875e889e97b", + "_shrinkwrap": null, + "_spec": "resolve@^1.1.6", + "_where": "/Users/trott/test/node_modules/eslint", + "author": { + "email": "mail@substack.net", + "name": "James Halliday", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-resolve/issues" + }, + "dependencies": {}, + "description": "resolve like require.resolve() on behalf of files asynchronously and synchronously", + "devDependencies": { + "tap": "0.4.13", + "tape": "^3.5.0" + }, + "directories": {}, + "dist": { + "shasum": "203114d82ad2c5ed9e8e0411b3932875e889e97b", + "tarball": "http://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz" + }, + "gitHead": "bb37f0d4400e4d7835375be4bd3ad1264bac3689", + "homepage": "https://github.com/substack/node-resolve#readme", + "keywords": [ + "resolve", + "require", + "node", + "module" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "mail@substack.net", + "name": "substack" + } + ], + "name": "resolve", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-resolve.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "version": "1.1.7" +} diff --git a/tools/eslint/node_modules/resolve/readme.markdown b/tools/eslint/node_modules/resolve/readme.markdown new file mode 100644 index 00000000000000..4fab9b04362700 --- /dev/null +++ b/tools/eslint/node_modules/resolve/readme.markdown @@ -0,0 +1,148 @@ +# resolve + +implements the [node `require.resolve()` +algorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...) +such that you can `require.resolve()` on behalf of a file asynchronously and +synchronously + +[![build status](https://secure.travis-ci.org/substack/node-resolve.png)](http://travis-ci.org/substack/node-resolve) + +# example + +asynchronously resolve: + +``` js +var resolve = require('resolve'); +resolve('tap', { basedir: __dirname }, function (err, res) { + if (err) console.error(err) + else console.log(res) +}); +``` + +``` +$ node example/async.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +synchronously resolve: + +``` js +var resolve = require('resolve'); +var res = resolve.sync('tap', { basedir: __dirname }); +console.log(res); +``` + +``` +$ node example/sync.js +/home/substack/projects/node-resolve/node_modules/tap/lib/main.js +``` + +# methods + +``` js +var resolve = require('resolve') +``` + +## resolve(id, opts={}, cb) + +Asynchronously resolve the module path string `id` into `cb(err, res [, pkg])`, where `pkg` (if defined) is the data from `package.json`. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.package - `package.json` data applicable to the module being loaded + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files asynchronously + +* opts.isFile - function to asynchronously test whether a file exists + +* opts.packageFilter - transform the parsed package.json contents before looking +at the "main" field + +* opts.pathFilter(pkg, path, relativePath) - transform a path within a package + * pkg - package data + * path - the path being resolved + * relativePath - the path relative from the package.json location + * returns - a relative path that will be joined from the package.json location + +* opts.paths - require.paths array to use if nothing is found on the normal +node_modules recursive walk (probably don't use this) + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +default `opts` values: + +``` javascript +{ + paths: [], + basedir: __dirname, + extensions: [ '.js' ], + readFile: fs.readFile, + isFile: function (file, cb) { + fs.stat(file, function (err, stat) { + if (err && err.code === 'ENOENT') cb(null, false) + else if (err) cb(err) + else cb(null, stat.isFile()) + }); + }, + moduleDirectory: 'node_modules' +} +``` + +## resolve.sync(id, opts) + +Synchronously resolve the module path string `id`, returning the result and +throwing an error when `id` can't be resolved. + +options are: + +* opts.basedir - directory to begin resolving from + +* opts.extensions - array of file extensions to search in order + +* opts.readFile - how to read files synchronously + +* opts.isFile - function to synchronously test whether a file exists + +* `opts.packageFilter(pkg, pkgfile)` - transform the parsed package.json +* contents before looking at the "main" field + +* opts.paths - require.paths array to use if nothing is found on the normal +node_modules recursive walk (probably don't use this) + +* opts.moduleDirectory - directory (or directories) in which to recursively look for modules. default: `"node_modules"` + +default `opts` values: + +``` javascript +{ + paths: [], + basedir: __dirname, + extensions: [ '.js' ], + readFileSync: fs.readFileSync, + isFile: function (file) { + try { return fs.statSync(file).isFile() } + catch (e) { return false } + }, + moduleDirectory: 'node_modules' +} +```` + +## resolve.isCore(pkg) + +Return whether a package is in core. + +# install + +With [npm](https://npmjs.org) do: + +``` +npm install resolve +``` + +# license + +MIT diff --git a/tools/eslint/node_modules/resolve/test/core.js b/tools/eslint/node_modules/resolve/test/core.js new file mode 100644 index 00000000000000..aede52af69933a --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/core.js @@ -0,0 +1,12 @@ +var test = require('tape'); +var resolve = require('../'); + +test('core modules', function (t) { + t.ok(resolve.isCore('fs')); + t.ok(resolve.isCore('net')); + t.ok(resolve.isCore('http')); + + t.ok(!resolve.isCore('seq')); + t.ok(!resolve.isCore('../')); + t.end(); +}); diff --git a/tools/eslint/node_modules/resolve/test/dotdot.js b/tools/eslint/node_modules/resolve/test/dotdot.js new file mode 100644 index 00000000000000..dc836d397c9aa6 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/dotdot.js @@ -0,0 +1,29 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('dotdot', function (t) { + t.plan(4); + var dir = __dirname + '/dotdot/abc'; + + resolve('..', { basedir : dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, __dirname + '/dotdot/index.js'); + }); + + resolve('.', { basedir : dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, dir + '/index.js'); + }); +}); + +test('dotdot sync', function (t) { + t.plan(2); + var dir = __dirname + '/dotdot/abc'; + + var a = resolve.sync('..', { basedir : dir }); + t.equal(a, __dirname + '/dotdot/index.js'); + + var b = resolve.sync('.', { basedir : dir }); + t.equal(b, dir + '/index.js'); +}); diff --git a/tools/eslint/node_modules/resolve/test/dotdot/abc/index.js b/tools/eslint/node_modules/resolve/test/dotdot/abc/index.js new file mode 100644 index 00000000000000..67f2534ebf90dc --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/dotdot/abc/index.js @@ -0,0 +1,2 @@ +var x = require('..'); +console.log(x); diff --git a/tools/eslint/node_modules/resolve/test/dotdot/index.js b/tools/eslint/node_modules/resolve/test/dotdot/index.js new file mode 100644 index 00000000000000..afec73603cc717 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/dotdot/index.js @@ -0,0 +1 @@ +module.exports = 'whatever' diff --git a/tools/eslint/node_modules/resolve/test/faulty_basedir.js b/tools/eslint/node_modules/resolve/test/faulty_basedir.js new file mode 100644 index 00000000000000..244081882bd617 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/faulty_basedir.js @@ -0,0 +1,17 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +// not sure what's up with this test anymore +if (process.platform !== 'win32') return; + +test('faulty basedir must produce error in windows', function (t) { + t.plan(1); + + var resolverDir = 'C:\\a\\b\\c\\d'; + + resolve('tape/lib/test.js', { basedir : resolverDir }, function (err, res, pkg) { + t.equal(true, !!err); + }); + +}); diff --git a/tools/eslint/node_modules/resolve/test/filter.js b/tools/eslint/node_modules/resolve/test/filter.js new file mode 100644 index 00000000000000..07c38f3493924f --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/filter.js @@ -0,0 +1,18 @@ +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + t.plan(2); + var dir = __dirname + '/resolver'; + resolve('./baz', { + basedir : dir, + packageFilter : function (pkg) { + pkg.main = 'doom'; + return pkg; + } + }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/baz/doom.js'); + t.equal(pkg.main, 'doom'); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/filter_sync.js b/tools/eslint/node_modules/resolve/test/filter_sync.js new file mode 100644 index 00000000000000..3f89b794209653 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/filter_sync.js @@ -0,0 +1,15 @@ +var test = require('tape'); +var resolve = require('../'); + +test('filter', function (t) { + var dir = __dirname + '/resolver'; + var res = resolve.sync('./baz', { + basedir : dir, + packageFilter : function (pkg) { + pkg.main = 'doom' + return pkg; + } + }); + t.equal(res, dir + '/baz/doom.js'); + t.end(); +}); diff --git a/tools/eslint/node_modules/resolve/test/mock.js b/tools/eslint/node_modules/resolve/test/mock.js new file mode 100644 index 00000000000000..9701478980e278 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/mock.js @@ -0,0 +1,142 @@ +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(6); + + var files = { + '/foo/bar/baz.js' : 'beep' + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file, cb) { + cb(null, files.hasOwnProperty(file)); + }, + readFile : function (file, cb) { + cb(null, files[file]); + } + } + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, '/foo/bar/baz.js'); + t.equal(pkg, undefined); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, '/foo/bar/baz.js'); + t.equal(pkg, undefined); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '/foo/bar'"); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '/foo/bar'"); + }); +}); + +test('mock from package', function (t) { + t.plan(6); + + var files = { + '/foo/bar/baz.js' : 'beep' + }; + + function opts (basedir) { + return { + basedir : basedir, + package : { main: 'bar' }, + isFile : function (file, cb) { + cb(null, files.hasOwnProperty(file)); + }, + readFile : function (file, cb) { + cb(null, files[file]); + } + } + } + + resolve('./baz', opts('/foo/bar'), function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, '/foo/bar/baz.js'); + t.equal(pkg.main, 'bar'); + }); + + resolve('./baz.js', opts('/foo/bar'), function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, '/foo/bar/baz.js'); + t.equal(pkg.main, 'bar'); + }); + + resolve('baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module 'baz' from '/foo/bar'"); + }); + + resolve('../baz', opts('/foo/bar'), function (err, res) { + t.equal(err.message, "Cannot find module '../baz' from '/foo/bar'"); + }); +}); + +test('mock package', function (t) { + t.plan(2); + + var files = { + '/foo/node_modules/bar/baz.js' : 'beep', + '/foo/node_modules/bar/package.json' : JSON.stringify({ + main : './baz.js' + }) + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file, cb) { + cb(null, files.hasOwnProperty(file)); + }, + readFile : function (file, cb) { + cb(null, files[file]); + } + } + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, '/foo/node_modules/bar/baz.js'); + t.equal(pkg.main, './baz.js'); + }); +}); + +test('mock package from package', function (t) { + t.plan(2); + + var files = { + '/foo/node_modules/bar/baz.js' : 'beep', + '/foo/node_modules/bar/package.json' : JSON.stringify({ + main : './baz.js' + }) + }; + + function opts (basedir) { + return { + basedir : basedir, + package : { main: 'bar' }, + isFile : function (file, cb) { + cb(null, files.hasOwnProperty(file)); + }, + readFile : function (file, cb) { + cb(null, files[file]); + } + } + } + + resolve('bar', opts('/foo'), function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, '/foo/node_modules/bar/baz.js'); + t.equal(pkg.main, './baz.js'); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/mock_sync.js b/tools/eslint/node_modules/resolve/test/mock_sync.js new file mode 100644 index 00000000000000..5a0e68cc7a19f3 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/mock_sync.js @@ -0,0 +1,68 @@ +var test = require('tape'); +var resolve = require('../'); + +test('mock', function (t) { + t.plan(4); + + var files = { + '/foo/bar/baz.js' : 'beep' + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file) { + return files.hasOwnProperty(file) + }, + readFileSync : function (file) { + return files[file] + } + } + } + + t.equal( + resolve.sync('./baz', opts('/foo/bar')), + '/foo/bar/baz.js' + ); + + t.equal( + resolve.sync('./baz.js', opts('/foo/bar')), + '/foo/bar/baz.js' + ); + + t.throws(function () { + resolve.sync('baz', opts('/foo/bar')); + }); + + t.throws(function () { + resolve.sync('../baz', opts('/foo/bar')); + }); +}); + +test('mock package', function (t) { + t.plan(1); + + var files = { + '/foo/node_modules/bar/baz.js' : 'beep', + '/foo/node_modules/bar/package.json' : JSON.stringify({ + main : './baz.js' + }) + }; + + function opts (basedir) { + return { + basedir : basedir, + isFile : function (file) { + return files.hasOwnProperty(file) + }, + readFileSync : function (file) { + return files[file] + } + } + } + + t.equal( + resolve.sync('bar', opts('/foo')), + '/foo/node_modules/bar/baz.js' + ); +}); diff --git a/tools/eslint/node_modules/resolve/test/module_dir.js b/tools/eslint/node_modules/resolve/test/module_dir.js new file mode 100644 index 00000000000000..f462610cdc02c6 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/module_dir.js @@ -0,0 +1,56 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('moduleDirectory strings', function (t) { + t.plan(4); + var dir = __dirname + '/module_dir'; + var xopts = { + basedir : dir, + moduleDirectory: 'xmodules' + }; + resolve('aaa', xopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, dir + '/xmodules/aaa/index.js'); + }); + + var yopts = { + basedir : dir, + moduleDirectory: 'ymodules' + }; + resolve('aaa', yopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, dir + '/ymodules/aaa/index.js'); + }); +}); + +test('moduleDirectory array', function (t) { + t.plan(6); + var dir = __dirname + '/module_dir'; + var aopts = { + basedir : dir, + moduleDirectory: [ 'xmodules', 'ymodules', 'zmodules' ] + }; + resolve('aaa', aopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, dir + '/xmodules/aaa/index.js'); + }); + + var bopts = { + basedir : dir, + moduleDirectory: [ 'zmodules', 'ymodules', 'xmodules' ] + }; + resolve('aaa', bopts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, dir + '/ymodules/aaa/index.js'); + }); + + var copts = { + basedir : dir, + moduleDirectory: [ 'xmodules', 'ymodules', 'zmodules' ] + }; + resolve('bbb', copts, function (err, res, pkg) { + t.ifError(err); + t.equal(res, dir + '/zmodules/bbb/main.js'); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/module_dir/xmodules/aaa/index.js b/tools/eslint/node_modules/resolve/test/module_dir/xmodules/aaa/index.js new file mode 100644 index 00000000000000..55cd18ca7e60a9 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/module_dir/xmodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x * 100 } diff --git a/tools/eslint/node_modules/resolve/test/module_dir/ymodules/aaa/index.js b/tools/eslint/node_modules/resolve/test/module_dir/ymodules/aaa/index.js new file mode 100644 index 00000000000000..651aca860d44f0 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/module_dir/ymodules/aaa/index.js @@ -0,0 +1 @@ +module.exports = function (x) { return x + 100 } diff --git a/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/main.js b/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/main.js new file mode 100644 index 00000000000000..4325a0bd5c2bd0 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/main.js @@ -0,0 +1 @@ +module.exports = function (n) { return n * 111 } diff --git a/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/package.json b/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/package.json new file mode 100644 index 00000000000000..c13b8cf6acfd33 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/module_dir/zmodules/bbb/package.json @@ -0,0 +1,3 @@ +{ + "main": "main.js" +} diff --git a/tools/eslint/node_modules/resolve/test/node_path.js b/tools/eslint/node_modules/resolve/test/node_path.js new file mode 100644 index 00000000000000..684ac8cb9bd342 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/node_path.js @@ -0,0 +1,48 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('$NODE_PATH', function (t) { + t.plan(4); + + resolve('aaa', { + paths: [ + __dirname + '/node_path/x', + __dirname + '/node_path/y' + ], + basedir: __dirname, + }, function (err, res) { + t.equal(res, __dirname + '/node_path/x/aaa/index.js'); + }); + + resolve('bbb', { + paths: [ + __dirname + '/node_path/x', + __dirname + '/node_path/y' + ], + basedir: __dirname, + }, function (err, res) { + t.equal(res, __dirname + '/node_path/y/bbb/index.js'); + }); + + resolve('ccc', { + paths: [ + __dirname + '/node_path/x', + __dirname + '/node_path/y' + ], + basedir: __dirname, + }, function (err, res) { + t.equal(res, __dirname + '/node_path/x/ccc/index.js'); + }); + + // ensure that relative paths still resolve against the + // regular `node_modules` correctly + resolve('tap', { + paths: [ + 'node_path', + ], + basedir: 'node_path/x', + }, function (err, res) { + t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap/lib/main.js')); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/node_path/x/aaa/index.js b/tools/eslint/node_modules/resolve/test/node_path/x/aaa/index.js new file mode 100644 index 00000000000000..1ea591380dfb09 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/node_path/x/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'A' diff --git a/tools/eslint/node_modules/resolve/test/node_path/x/ccc/index.js b/tools/eslint/node_modules/resolve/test/node_path/x/ccc/index.js new file mode 100644 index 00000000000000..f186fa7574fe9b --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/node_path/x/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'C' diff --git a/tools/eslint/node_modules/resolve/test/node_path/y/bbb/index.js b/tools/eslint/node_modules/resolve/test/node_path/y/bbb/index.js new file mode 100644 index 00000000000000..e22dd83c0ca44e --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/node_path/y/bbb/index.js @@ -0,0 +1 @@ +module.exports = 'B' diff --git a/tools/eslint/node_modules/resolve/test/node_path/y/ccc/index.js b/tools/eslint/node_modules/resolve/test/node_path/y/ccc/index.js new file mode 100644 index 00000000000000..d0043d1ec4a0ea --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/node_path/y/ccc/index.js @@ -0,0 +1 @@ +module.exports = 'CY' diff --git a/tools/eslint/node_modules/resolve/test/nonstring.js b/tools/eslint/node_modules/resolve/test/nonstring.js new file mode 100644 index 00000000000000..ef63c40f9393dc --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/nonstring.js @@ -0,0 +1,9 @@ +var test = require('tape'); +var resolve = require('../'); + +test('nonstring', function (t) { + t.plan(1); + resolve(555, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/pathfilter.js b/tools/eslint/node_modules/resolve/test/pathfilter.js new file mode 100644 index 00000000000000..3dbc2a8007b65a --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/pathfilter.js @@ -0,0 +1,35 @@ +var test = require('tape'); +var resolve = require('../'); + +test('#62: deep module references and the pathFilter', function(t){ + t.plan(9); + + var resolverDir = __dirname + '/pathfilter/deep_ref'; + var pathFilter = function(pkg, x, remainder){ + t.equal(pkg.version, "1.2.3"); + t.equal(x, resolverDir + '/node_modules/deep/ref'); + t.equal(remainder, "ref"); + return "alt"; + }; + + resolve('deep/ref', { basedir : resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + + t.equal(pkg.version, "1.2.3"); + t.equal(res, resolverDir + '/node_modules/deep/ref.js'); + }); + + resolve('deep/deeper/ref', { basedir: resolverDir }, + function(err, res, pkg) { + if(err) t.fail(err); + t.notEqual(pkg, undefined); + t.equal(pkg.version, "1.2.3"); + t.equal(res, resolverDir + '/node_modules/deep/deeper/ref.js'); + }); + + resolve('deep/ref', { basedir : resolverDir, pathFilter : pathFilter }, + function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, resolverDir + '/node_modules/deep/alt.js'); + }); +}); diff --git a/test/fixtures/readdir/for b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/main.js similarity index 100% rename from test/fixtures/readdir/for rename to tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/main.js diff --git a/test/fixtures/readdir/just b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/alt.js similarity index 100% rename from test/fixtures/readdir/just rename to tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/alt.js diff --git a/test/fixtures/readdir/testing.js b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js similarity index 100% rename from test/fixtures/readdir/testing.js rename to tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/deeper/ref.js diff --git a/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/package.json b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/package.json new file mode 100644 index 00000000000000..fe4b408a06d41a --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/package.json @@ -0,0 +1,4 @@ +{ + "name": "deep", + "version": "1.2.3" +} diff --git a/test/fixtures/readdir/these b/tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/ref.js similarity index 100% rename from test/fixtures/readdir/these rename to tools/eslint/node_modules/resolve/test/pathfilter/deep_ref/node_modules/deep/ref.js diff --git a/tools/eslint/node_modules/resolve/test/precedence.js b/tools/eslint/node_modules/resolve/test/precedence.js new file mode 100644 index 00000000000000..6593de9606f6ab --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/precedence.js @@ -0,0 +1,23 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('precedence', function (t) { + t.plan(3); + var dir = path.join(__dirname, 'precedence/aaa'); + + resolve('./', { basedir : dir }, function (err, res, pkg) { + t.ifError(err); + t.equal(res, path.join(dir, 'index.js')); + t.equal(pkg.name, 'resolve'); + }); +}); + +test('./ should not load ${dir}.js', function (t) { + t.plan(1); + var dir = path.join(__dirname, 'precedence/bbb'); + + resolve('./', { basedir : dir }, function (err, res, pkg) { + t.ok(err); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/precedence/aaa.js b/tools/eslint/node_modules/resolve/test/precedence/aaa.js new file mode 100644 index 00000000000000..a182397c5133e2 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/precedence/aaa.js @@ -0,0 +1 @@ +module.exports = 'wtf' diff --git a/tools/eslint/node_modules/resolve/test/precedence/aaa/index.js b/tools/eslint/node_modules/resolve/test/precedence/aaa/index.js new file mode 100644 index 00000000000000..993b03c2cea1a1 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/precedence/aaa/index.js @@ -0,0 +1 @@ +module.exports = 'okok' diff --git a/tools/eslint/node_modules/resolve/test/precedence/aaa/main.js b/tools/eslint/node_modules/resolve/test/precedence/aaa/main.js new file mode 100644 index 00000000000000..db38959d72f2cf --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/precedence/aaa/main.js @@ -0,0 +1 @@ +console.log(require('./')) diff --git a/tools/eslint/node_modules/resolve/test/precedence/bbb.js b/tools/eslint/node_modules/resolve/test/precedence/bbb.js new file mode 100644 index 00000000000000..c8a9996b39ba5f --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/precedence/bbb.js @@ -0,0 +1 @@ +module.exports '>_<' diff --git a/tools/eslint/node_modules/resolve/test/precedence/bbb/main.js b/tools/eslint/node_modules/resolve/test/precedence/bbb/main.js new file mode 100644 index 00000000000000..716b81d4bd463f --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/precedence/bbb/main.js @@ -0,0 +1 @@ +console.log(require('./')); // should throw diff --git a/tools/eslint/node_modules/resolve/test/resolver.js b/tools/eslint/node_modules/resolve/test/resolver.js new file mode 100644 index 00000000000000..f0d6ccf1e0402c --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver.js @@ -0,0 +1,281 @@ +var path = require('path'); +var test = require('tape'); +var resolve = require('../'); + +test('async foo', function (t) { + t.plan(9); + var dir = __dirname + '/resolver'; + + resolve('./foo', { basedir : dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/foo.js'); + t.equal(pkg.name, 'resolve'); + }); + + resolve('./foo.js', { basedir : dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/foo.js'); + t.equal(pkg.name, 'resolve'); + }); + + resolve('./foo', { basedir : dir, package: { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/foo.js'); + t.equal(pkg.main, 'resolver'); + }); + + resolve('./foo.js', { basedir : dir, package: { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/foo.js'); + t.equal(pkg.main, 'resolver'); + }); + + resolve('foo', { basedir : dir }, function (err) { + t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "'"); + }); +}); + +test('bar', function (t) { + t.plan(6); + var dir = __dirname + '/resolver'; + + resolve('foo', { basedir : dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/bar/node_modules/foo/index.js'); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir : dir + '/bar' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/bar/node_modules/foo/index.js'); + t.equal(pkg, undefined); + }); + + resolve('foo', { basedir : dir + '/bar', package: { main: 'bar' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/bar/node_modules/foo/index.js'); + t.equal(pkg, undefined); + }); +}); + +test('baz', function (t) { + t.plan(4); + var dir = __dirname + '/resolver'; + + resolve('./baz', { basedir : dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/baz/quux.js'); + t.equal(pkg.main, 'quux.js'); + }); + + resolve('./baz', { basedir : dir, package: { main: 'resolver' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/baz/quux.js'); + t.equal(pkg.main, 'quux.js'); + }); +}); + +test('biz', function (t) { + t.plan(24); + var dir = __dirname + '/resolver/biz/node_modules'; + + resolve('./grux', { basedir : dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/grux/index.js'); + t.equal(pkg, undefined); + }); + + resolve('./grux', { basedir : dir, package: { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/grux/index.js'); + t.equal(pkg.main, 'biz'); + }); + + resolve('./garply', { basedir : dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/garply/lib/index.js'); + t.equal(pkg.main, './lib'); + }); + + resolve('./garply', { basedir : dir, package: { main: 'biz' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/garply/lib/index.js'); + t.equal(pkg.main, './lib'); + }); + + resolve('tiv', { basedir : dir + '/grux' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/tiv/index.js'); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir : dir + '/grux', package: { main: 'grux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/tiv/index.js'); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir : dir + '/garply' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/tiv/index.js'); + t.equal(pkg, undefined); + }); + + resolve('tiv', { basedir : dir + '/garply', package: { main: './lib' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/tiv/index.js'); + t.equal(pkg, undefined); + }); + + resolve('grux', { basedir : dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/grux/index.js'); + t.equal(pkg, undefined); + }); + + resolve('grux', { basedir : dir + '/tiv', package: { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/grux/index.js'); + t.equal(pkg, undefined); + }); + + resolve('garply', { basedir : dir + '/tiv' }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/garply/lib/index.js'); + t.equal(pkg.main, './lib'); + }); + + resolve('garply', { basedir : dir + '/tiv', package: { main: 'tiv' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/garply/lib/index.js'); + t.equal(pkg.main, './lib'); + }); +}); + +test('quux', function (t) { + t.plan(2); + var dir = __dirname + '/resolver/quux'; + + resolve('./foo', { basedir : dir, package: { main: 'quux' } }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/foo/index.js'); + t.equal(pkg.main, 'quux'); + }); +}); + +test('normalize', function (t) { + t.plan(2); + var dir = __dirname + '/resolver/biz/node_modules/grux'; + + resolve('../grux', { basedir : dir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/index.js'); + t.equal(pkg, undefined); + }); +}); + +test('cup', function (t) { + t.plan(3); + var dir = __dirname + '/resolver'; + + resolve('./cup', { basedir : dir, extensions : [ '.js', '.coffee' ] }, + function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/cup.coffee'); + }); + + resolve('./cup.coffee', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/cup.coffee'); + }); + + resolve('./cup', { basedir : dir, extensions : [ '.js' ] }, + function (err, res) { + t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "'"); + }); +}); + +test('mug', function (t) { + t.plan(3); + var dir = __dirname + '/resolver'; + + resolve('./mug', { basedir : dir }, function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/mug.js'); + }); + + resolve('./mug', { basedir : dir, extensions : [ '.coffee', '.js' ] }, + function (err, res) { + if (err) t.fail(err); + t.equal(res, dir + '/mug.coffee'); + }); + + resolve('./mug', { basedir : dir, extensions : [ '.js', '.coffee' ] }, + function (err, res) { + t.equal(res, dir + '/mug.js'); + }); +}); + +test('other path', function (t) { + t.plan(4); + var resolverDir = __dirname + '/resolver'; + var dir = resolverDir + '/bar'; + var otherDir = resolverDir + '/other_path'; + + resolve('root', { basedir : dir, paths: [otherDir] }, function (err, res) { + if (err) t.fail(err); + t.equal(res, resolverDir + '/other_path/root.js'); + }); + + resolve('lib/other-lib', { basedir : dir, paths: [otherDir] }, + function (err, res) { + if (err) t.fail(err); + t.equal(res, resolverDir + '/other_path/lib/other-lib.js'); + }); + + resolve('root', { basedir : dir, }, function (err, res) { + t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "'"); + }); + + resolve('zzz', { basedir : dir, paths: [otherDir] }, function (err, res) { + t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "'"); + }); +}); + +test('incorrect main', function (t) { + t.plan(1) + + var resolverDir = __dirname + '/resolver'; + var dir = resolverDir + '/incorrect_main'; + + resolve('./incorrect_main', { basedir : resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, dir + '/index.js'); + }); +}); + +test('without basedir', function (t) { + t.plan(1); + + var dir = __dirname + '/resolver/without_basedir'; + var tester = require(dir + '/main.js'); + + tester(t, function (err, res, pkg){ + if (err) { + t.fail(err); + } else { + t.equal(res, dir + '/node_modules/mymodule.js'); + } + }); +}); + +test('#25: node modules with the same name as node stdlib modules', function (t) { + t.plan(1); + + var resolverDir = __dirname + '/resolver/punycode'; + + resolve('punycode', { basedir : resolverDir }, function (err, res, pkg) { + if (err) t.fail(err); + t.equal(res, resolverDir + '/node_modules/punycode/index.js'); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js b/tools/eslint/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js new file mode 100644 index 00000000000000..bd816eaba4ca3b --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/tools/eslint/node_modules/doctrine/coverage/lcov.info b/tools/eslint/node_modules/resolve/test/resolver/baz/doom.js similarity index 100% rename from tools/eslint/node_modules/doctrine/coverage/lcov.info rename to tools/eslint/node_modules/resolve/test/resolver/baz/doom.js diff --git a/tools/eslint/node_modules/resolve/test/resolver/baz/package.json b/tools/eslint/node_modules/resolve/test/resolver/baz/package.json new file mode 100644 index 00000000000000..6b81dcddfc4a22 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/baz/package.json @@ -0,0 +1,3 @@ +{ + "main" : "quux.js" +} diff --git a/tools/eslint/node_modules/resolve/test/resolver/baz/quux.js b/tools/eslint/node_modules/resolve/test/resolver/baz/quux.js new file mode 100644 index 00000000000000..bd816eaba4ca3b --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/baz/quux.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/lib/index.js b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/lib/index.js new file mode 100644 index 00000000000000..0379e29f701f92 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/lib/index.js @@ -0,0 +1 @@ +module.exports = 'hello garply'; diff --git a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/package.json b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/package.json new file mode 100644 index 00000000000000..babaac58fddb1b --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/garply/package.json @@ -0,0 +1,3 @@ +{ + "main" : "./lib" +} diff --git a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js new file mode 100644 index 00000000000000..49960555ab4cf8 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js @@ -0,0 +1 @@ +module.exports = require('tiv') * 100; diff --git a/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js new file mode 100644 index 00000000000000..690aad34a46dc9 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js @@ -0,0 +1 @@ +module.exports = 3; diff --git a/tools/eslint/node_modules/resolve/test/resolver/cup.coffee b/tools/eslint/node_modules/resolve/test/resolver/cup.coffee new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/eslint/node_modules/resolve/test/resolver/foo.js b/tools/eslint/node_modules/resolve/test/resolver/foo.js new file mode 100644 index 00000000000000..bd816eaba4ca3b --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/foo.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/index.js b/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/index.js new file mode 100644 index 00000000000000..bc1fb0a6f4ede1 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/index.js @@ -0,0 +1,2 @@ +// this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate +module.exports = 1; diff --git a/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/package.json b/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/package.json new file mode 100644 index 00000000000000..1592ed393718f8 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/incorrect_main/package.json @@ -0,0 +1,3 @@ +{ + "main" : "wrong.js" +} diff --git a/tools/eslint/node_modules/resolve/test/resolver/mug.coffee b/tools/eslint/node_modules/resolve/test/resolver/mug.coffee new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/eslint/node_modules/resolve/test/resolver/mug.js b/tools/eslint/node_modules/resolve/test/resolver/mug.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/eslint/node_modules/resolve/test/resolver/other_path/lib/other-lib.js b/tools/eslint/node_modules/resolve/test/resolver/other_path/lib/other-lib.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/eslint/node_modules/resolve/test/resolver/other_path/root.js b/tools/eslint/node_modules/resolve/test/resolver/other_path/root.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/eslint/node_modules/resolve/test/resolver/punycode/node_modules/punycode/index.js b/tools/eslint/node_modules/resolve/test/resolver/punycode/node_modules/punycode/index.js new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/tools/eslint/node_modules/resolve/test/resolver/quux/foo/index.js b/tools/eslint/node_modules/resolve/test/resolver/quux/foo/index.js new file mode 100644 index 00000000000000..bd816eaba4ca3b --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/quux/foo/index.js @@ -0,0 +1 @@ +module.exports = 1; diff --git a/tools/eslint/node_modules/resolve/test/resolver/without_basedir/main.js b/tools/eslint/node_modules/resolve/test/resolver/without_basedir/main.js new file mode 100644 index 00000000000000..b62aa0e0ae08fa --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/without_basedir/main.js @@ -0,0 +1,5 @@ +resolve = require('../../../'); + +module.exports = function(t, cb) { + resolve('mymodule', null, cb); +} diff --git a/tools/eslint/node_modules/resolve/test/resolver/without_basedir/node_modules/mymodule.js b/tools/eslint/node_modules/resolve/test/resolver/without_basedir/node_modules/mymodule.js new file mode 100644 index 00000000000000..2b58aa4087d758 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver/without_basedir/node_modules/mymodule.js @@ -0,0 +1 @@ +module.exports = "The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities.- E. Dijkstra" diff --git a/tools/eslint/node_modules/resolve/test/resolver_sync.js b/tools/eslint/node_modules/resolve/test/resolver_sync.js new file mode 100644 index 00000000000000..04cc855c75c5b0 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/resolver_sync.js @@ -0,0 +1,180 @@ +var test = require('tape'); +var resolve = require('../'); + +test('foo', function (t) { + var dir = __dirname + '/resolver'; + + t.equal( + resolve.sync('./foo', { basedir : dir }), + dir + '/foo.js' + ); + + t.equal( + resolve.sync('./foo.js', { basedir : dir }), + dir + '/foo.js' + ); + + t.throws(function () { + resolve.sync('foo', { basedir : dir }); + }); + + t.end(); +}); + +test('bar', function (t) { + var dir = __dirname + '/resolver'; + + t.equal( + resolve.sync('foo', { basedir : dir + '/bar' }), + dir + '/bar/node_modules/foo/index.js' + ); + t.end(); +}); + +test('baz', function (t) { + var dir = __dirname + '/resolver'; + + t.equal( + resolve.sync('./baz', { basedir : dir }), + dir + '/baz/quux.js' + ); + t.end(); +}); + +test('biz', function (t) { + var dir = __dirname + '/resolver/biz/node_modules'; + t.equal( + resolve.sync('./grux', { basedir : dir }), + dir + '/grux/index.js' + ); + + t.equal( + resolve.sync('tiv', { basedir : dir + '/grux' }), + dir + '/tiv/index.js' + ); + + t.equal( + resolve.sync('grux', { basedir : dir + '/tiv' }), + dir + '/grux/index.js' + ); + t.end(); +}); + +test('normalize', function (t) { + var dir = __dirname + '/resolver/biz/node_modules/grux'; + t.equal( + resolve.sync('../grux', { basedir : dir }), + dir + '/index.js' + ); + t.end(); +}); + +test('cup', function (t) { + var dir = __dirname + '/resolver'; + t.equal( + resolve.sync('./cup', { + basedir : dir, + extensions : [ '.js', '.coffee' ] + }), + dir + '/cup.coffee' + ); + + t.equal( + resolve.sync('./cup.coffee', { + basedir : dir + }), + dir + '/cup.coffee' + ); + + t.throws(function () { + resolve.sync('./cup', { + basedir : dir, + extensions : [ '.js' ] + }) + }); + + t.end(); +}); + +test('mug', function (t) { + var dir = __dirname + '/resolver'; + t.equal( + resolve.sync('./mug', { basedir : dir }), + dir + '/mug.js' + ); + + t.equal( + resolve.sync('./mug', { + basedir : dir, + extensions : [ '.coffee', '.js' ] + }), + dir + '/mug.coffee' + ); + + t.equal( + resolve.sync('./mug', { + basedir : dir, + extensions : [ '.js', '.coffee' ] + }), + dir + '/mug.js' + ); + + t.end(); +}); + +test('other path', function (t) { + var resolverDir = __dirname + '/resolver'; + var dir = resolverDir + '/bar'; + var otherDir = resolverDir + '/other_path'; + + var path = require('path'); + + t.equal( + resolve.sync('root', { + basedir : dir, + paths: [otherDir] }), + resolverDir + '/other_path/root.js' + ); + + t.equal( + resolve.sync('lib/other-lib', { + basedir : dir, + paths: [otherDir] }), + resolverDir + '/other_path/lib/other-lib.js' + ); + + t.throws(function () { + resolve.sync('root', { basedir : dir, }); + }); + + t.throws(function () { + resolve.sync('zzz', { + basedir : dir, + paths: [otherDir] }); + }); + + t.end(); +}); + +test('incorrect main', function (t) { + var resolverDir = __dirname + '/resolver'; + var dir = resolverDir + '/incorrect_main'; + + t.equal( + resolve.sync('./incorrect_main', { basedir : resolverDir }), + dir + '/index.js' + ) + + t.end() +}); + +test('#25: node modules with the same name as node stdlib modules', function (t) { + var resolverDir = __dirname + '/resolver/punycode'; + + t.equal( + resolve.sync('punycode', { basedir : resolverDir }), + resolverDir + '/node_modules/punycode/index.js' + ) + + t.end() +}); diff --git a/tools/eslint/node_modules/resolve/test/subdirs.js b/tools/eslint/node_modules/resolve/test/subdirs.js new file mode 100644 index 00000000000000..b7b8450a9ef231 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/subdirs.js @@ -0,0 +1,13 @@ +var test = require('tape'); +var resolve = require('../'); +var path = require('path'); + +test('subdirs', function (t) { + t.plan(2); + + var dir = path.join(__dirname, '/subdirs'); + resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { + t.ifError(err); + t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); + }); +}); diff --git a/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json b/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json new file mode 100644 index 00000000000000..3cc0ecbedfe42f --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json @@ -0,0 +1 @@ +[1,2,3] diff --git a/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/package.json b/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/package.json new file mode 100644 index 00000000000000..0967ef424bce67 --- /dev/null +++ b/tools/eslint/node_modules/resolve/test/subdirs/node_modules/a/package.json @@ -0,0 +1 @@ +{} 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..e7ff8d75f6334b --- /dev/null +++ b/tools/eslint/node_modules/restore-cursor/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "restore-cursor@^1.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/cli-cursor" + ] + ], + "_from": "restore-cursor@>=1.0.1 <2.0.0", + "_id": "restore-cursor@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "exit", + "quit", + "process", + "graceful", + "shutdown", + "sigterm", + "sigint", + "terminate", + "kill", + "stop", + "cli", + "cursor", + "ansi", + "show", + "term", + "terminal", + "console", + "tty", + "shell", + "command-line" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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/deps/npm/node_modules/sha/node_modules/graceful-fs/LICENSE b/tools/eslint/node_modules/rimraf/LICENSE similarity index 100% rename from deps/npm/node_modules/sha/node_modules/graceful-fs/LICENSE rename to tools/eslint/node_modules/rimraf/LICENSE 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/deps/npm/node_modules/write-file-atomic/node_modules/graceful-fs/LICENSE b/tools/eslint/node_modules/rimraf/node_modules/glob/LICENSE similarity index 100% rename from deps/npm/node_modules/write-file-atomic/node_modules/graceful-fs/LICENSE rename to tools/eslint/node_modules/rimraf/node_modules/glob/LICENSE diff --git a/tools/eslint/node_modules/rimraf/node_modules/glob/README.md b/tools/eslint/node_modules/rimraf/node_modules/glob/README.md new file mode 100644 index 00000000000000..6960483bac63c6 --- /dev/null +++ b/tools/eslint/node_modules/rimraf/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/rimraf/node_modules/glob/common.js b/tools/eslint/node_modules/rimraf/node_modules/glob/common.js new file mode 100644 index 00000000000000..b280e76cee9be6 --- /dev/null +++ b/tools/eslint/node_modules/rimraf/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 = 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.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/rimraf/node_modules/glob/glob.js b/tools/eslint/node_modules/rimraf/node_modules/glob/glob.js new file mode 100644 index 00000000000000..804cde53f0d276 --- /dev/null +++ b/tools/eslint/node_modules/rimraf/node_modules/glob/glob.js @@ -0,0 +1,772 @@ +// 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' + if (f === this.cwd) { + var error = new Error(er.code + ' invalid cwd ' + f) + error.path = f + 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/rimraf/node_modules/glob/package.json b/tools/eslint/node_modules/rimraf/node_modules/glob/package.json new file mode 100644 index 00000000000000..6405125e7f396e --- /dev/null +++ b/tools/eslint/node_modules/rimraf/node_modules/glob/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + "glob@^7.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/rimraf" + ] + ], + "_from": "glob@>=7.0.0 <8.0.0", + "_id": "glob@7.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/rimraf/glob", + "_nodeVersion": "4.0.0", + "_npmOperationalInternal": { + "host": "packages-5-east.internal.npmjs.com", + "tmp": "tmp/glob-7.0.0.tgz_1455132435010_0.6941273615229875" + }, + "_npmUser": { + "email": "i@izs.me", + "name": "isaacs" + }, + "_npmVersion": "3.7.0", + "_phantomChildren": {}, + "_requested": { + "name": "glob", + "raw": "glob@^7.0.0", + "rawSpec": "^7.0.0", + "scope": null, + "spec": ">=7.0.0 <8.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint/rimraf" + ], + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.0.tgz", + "_shasum": "3b20a357fffcf46bb384aed6f8ae9a647fdb6ac4", + "_shrinkwrap": null, + "_spec": "glob@^7.0.0", + "_where": "/Users/trott/test/node_modules/eslint/node_modules/rimraf", + "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": "3b20a357fffcf46bb384aed6f8ae9a647fdb6ac4", + "tarball": "http://registry.npmjs.org/glob/-/glob-7.0.0.tgz" + }, + "engines": { + "node": "*" + }, + "files": [ + "glob.js", + "sync.js", + "common.js" + ], + "gitHead": "8e8876f84232783fd2db3182af5fa33cc83f1989", + "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": "7.0.0" +} diff --git a/tools/eslint/node_modules/rimraf/node_modules/glob/sync.js b/tools/eslint/node_modules/rimraf/node_modules/glob/sync.js new file mode 100644 index 00000000000000..aa28c87a3e5daf --- /dev/null +++ b/tools/eslint/node_modules/rimraf/node_modules/glob/sync.js @@ -0,0 +1,466 @@ +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' + if (f === this.cwd) { + var error = new Error(er.code + ' invalid cwd ' + f) + error.path = f + 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/rimraf/package.json b/tools/eslint/node_modules/rimraf/package.json new file mode 100644 index 00000000000000..81e560b3210b33 --- /dev/null +++ b/tools/eslint/node_modules/rimraf/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + "rimraf@^2.2.8", + "/Users/trott/test/node_modules/eslint/node_modules/del" + ] + ], + "_from": "rimraf@>=2.2.8 <3.0.0", + "_id": "rimraf@2.5.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": { + "inflight": "1.0.4", + "inherits": "2.0.1", + "minimatch": "3.0.0", + "once": "1.3.3", + "path-is-absolute": "1.0.0" + }, + "_requested": { + "name": "rimraf", + "raw": "rimraf@^2.2.8", + "rawSpec": "^2.2.8", + "scope": null, + "spec": ">=2.2.8 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint/del" + ], + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz", + "_shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "_shrinkwrap": null, + "_spec": "rimraf@^2.2.8", + "_where": "/Users/trott/test/node_modules/eslint/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": "http://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": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "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/.editorconfig b/tools/eslint/node_modules/run-async/.editorconfig new file mode 100644 index 00000000000000..6d740d54dbe4f1 --- /dev/null +++ b/tools/eslint/node_modules/run-async/.editorconfig @@ -0,0 +1,12 @@ +# editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/tools/eslint/node_modules/run-async/.gitattributes b/tools/eslint/node_modules/run-async/.gitattributes new file mode 100644 index 00000000000000..176a458f94e0ea --- /dev/null +++ b/tools/eslint/node_modules/run-async/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/tools/eslint/node_modules/run-async/.jshintrc b/tools/eslint/node_modules/run-async/.jshintrc new file mode 100644 index 00000000000000..3e4ba5a6357b53 --- /dev/null +++ b/tools/eslint/node_modules/run-async/.jshintrc @@ -0,0 +1,20 @@ +{ + "node": true, + "esnext": true, + "bitwise": false, + "curly": false, + "eqeqeq": true, + "eqnull": true, + "immed": true, + "latedef": false, + "newcap": true, + "noarg": true, + "undef": true, + "strict": true, + "trailing": true, + "smarttabs": true, + "indent": 2, + "quotmark": "single", + "scripturl": true, + "globals": [ "describe", "it" ] +} diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore b/tools/eslint/node_modules/run-async/.npmignore similarity index 100% rename from deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/.npmignore rename to tools/eslint/node_modules/run-async/.npmignore diff --git a/tools/eslint/node_modules/run-async/.travis.yml b/tools/eslint/node_modules/run-async/.travis.yml new file mode 100644 index 00000000000000..244b7e88e3273c --- /dev/null +++ b/tools/eslint/node_modules/run-async/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - '0.10' 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..337564dce1707e --- /dev/null +++ b/tools/eslint/node_modules/run-async/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "run-async@^0.1.0", + "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + ] + ], + "_from": "run-async@>=0.1.0 <0.2.0", + "_id": "run-async@0.1.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "flow", + "flow-control", + "async" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "admin@simonboudrias.com", + "name": "sboudrias" + } + ], + "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/run-async/test.js b/tools/eslint/node_modules/run-async/test.js new file mode 100644 index 00000000000000..0a82fedf198661 --- /dev/null +++ b/tools/eslint/node_modules/run-async/test.js @@ -0,0 +1,51 @@ +'use strict'; + +var assert = require('assert'); +var runAsync = require('./index'); + +describe('runAsync', function () { + it('run synchronous method', function (done) { + var aFunc = function () { + return 'pass1'; + }; + runAsync(aFunc, function (val) { + assert.equal(val, 'pass1'); + done(); + }); + }); + + it('run asynchronous method', function (done) { + var aFunc = function () { + var returns = this.async(); + setTimeout(returns.bind(null, 'pass2'), 0); + }; + + runAsync(aFunc, function (val) { + assert.equal(val, 'pass2'); + done(); + }); + }); + + it('pass arguments', function (done) { + var aFunc = function (a, b) { + assert.equal(a, 1); + assert.equal(b, 'bar'); + return 'pass1'; + }; + runAsync(aFunc, function (val) { + done(); + }, 1, 'bar'); + }); + + it('allow only callback once', function (done) { + var aFunc = function () { + var returns = this.async(); + returns(); + returns(); + }; + + runAsync(aFunc, function (val) { + done(); + }); + }); +}); 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..decda62b654083 --- /dev/null +++ b/tools/eslint/node_modules/rx-lite/package.json @@ -0,0 +1,88 @@ +{ + "_args": [ + [ + "rx-lite@^3.1.2", + "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + ] + ], + "_from": "rx-lite@>=3.1.2 <4.0.0", + "_id": "rx-lite@3.1.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "React", + "Reactive", + "Events", + "Rx", + "RxJS" + ], + "licenses": [ + { + "type": "Apache License, Version 2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0.html" + } + ], + "main": "rx.lite.js", + "maintainers": [ + { + "email": "matthew.podwysocki@gmail.com", + "name": "mattpodwysocki" + } + ], + "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/.documentup.json b/tools/eslint/node_modules/shelljs/.documentup.json new file mode 100644 index 00000000000000..57fe30116b7659 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/.documentup.json @@ -0,0 +1,6 @@ +{ + "name": "ShellJS", + "twitter": [ + "r2r" + ] +} diff --git a/tools/eslint/node_modules/shelljs/.jshintrc b/tools/eslint/node_modules/shelljs/.jshintrc new file mode 100644 index 00000000000000..a80c559aa14d6d --- /dev/null +++ b/tools/eslint/node_modules/shelljs/.jshintrc @@ -0,0 +1,7 @@ +{ + "loopfunc": true, + "sub": true, + "undef": true, + "unused": true, + "node": true +} \ No newline at end of file diff --git a/tools/eslint/node_modules/shelljs/.npmignore b/tools/eslint/node_modules/shelljs/.npmignore new file mode 100644 index 00000000000000..6b20c38ae7d468 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/.npmignore @@ -0,0 +1,2 @@ +test/ +tmp/ \ No newline at end of file diff --git a/tools/eslint/node_modules/shelljs/.travis.yml b/tools/eslint/node_modules/shelljs/.travis.yml new file mode 100644 index 00000000000000..335f4f45d63834 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "0.10" + - "0.11" + - "0.12" diff --git a/tools/eslint/node_modules/shelljs/LICENSE b/tools/eslint/node_modules/shelljs/LICENSE new file mode 100644 index 00000000000000..fb35c092f1a8a7 --- /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/README.md b/tools/eslint/node_modules/shelljs/README.md new file mode 100644 index 00000000000000..d08d13e8b06eb5 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/README.md @@ -0,0 +1,579 @@ +# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/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/arturadib/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). + +Connect with [@r2r](http://twitter.com/r2r) on Twitter for questions, suggestions, etc. + +## 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 +``` + +You can also just copy `shell.js` into your project's directory, and `require()` accordingly. + + +## 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 +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 (CoffeeScript): + +```coffeescript +require 'shelljs/make' + +target.all = -> + target.bundle() + target.docs() + +target.bundle = -> + cd __dirname + mkdir 'build' + cd 'lib' + (cat '*.js').to '../build/output.js' + +target.docs = -> + cd __dirname + mkdir 'docs' + cd 'lib' + for file in ls '*.js' + text = grep '//@', file # extract special comments + text.replace '//@', '' # remove comment tags + text.to '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 + + +### pwd() +Returns the current directory. + + +### ls([options ,] path [,path ...]) +### ls([options ,] path_array) +Available options: + ++ `-R`: recursive ++ `-A`: all files (include files beginning with `.`, except for `.` and `..`) + +Examples: + +```javascript +ls('projs/*.js'); +ls('-R', '/users/me', '/tmp'); +ls('-R', ['/users/me', '/tmp']); // same as above +``` + +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 ++ `-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(source [, source ...], dest') +### mv(source_array, dest') +Available options: + ++ `f`: force + +Examples: + +```javascript +mv('-f', '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) +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 `file` 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 looks for `.exe`, `.cmd`, and `.bat` extensions. +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) +### ln(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. Defaults to true if a callback is provided. ++ `silent`: Do not echo program output to console. + +Examples: + +```javascript +var version = exec('node --version', {silent:true}).output; + +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, output) { + console.log('Exit code:', code); + console.log('Program output:', output); +}); +``` + +Executes the given `command` _synchronously_, unless otherwise specified. +When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's +`output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and +the `callback` gets the arguments `(code, output)`. + +**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. + + +## 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; +cp('this_file_does_not_exist', '/dev/null'); // dies here +/* more commands... */ +``` + +If `true` the script will die on errors. Default is `false`. diff --git a/tools/eslint/node_modules/shelljs/RELEASE.md b/tools/eslint/node_modules/shelljs/RELEASE.md new file mode 100644 index 00000000000000..69ef3fbb0a7832 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/RELEASE.md @@ -0,0 +1,9 @@ +# Release steps + +* Ensure master passes CI tests +* Bump version in package.json. Any breaking change or new feature should bump minor (or even major). Non-breaking changes or fixes can just bump patch. +* Update README manually if the changes are not documented in-code. If so, run `scripts/generate-docs.js` +* Commit +* `$ git tag ` (see `git tag -l` for latest) +* `$ git push origin master --tags` +* `$ npm publish .` diff --git a/tools/eslint/node_modules/shelljs/bin/shjs b/tools/eslint/node_modules/shelljs/bin/shjs new file mode 100755 index 00000000000000..d239a7ad4b987a --- /dev/null +++ b/tools/eslint/node_modules/shelljs/bin/shjs @@ -0,0 +1,51 @@ +#!/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(' '), { async: true }); + } else { + console.log('ShellJS: CoffeeScript interpreter not found'); + console.log(); + process.exit(1); + } +} else { + // + // JavaScript + // + exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); +} 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..f78b4cfd4237e9 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/make.js @@ -0,0 +1,56 @@ +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) + return; + oldTarget.done = true; + return oldTarget.apply(oldTarget, arguments); + }; + + })(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..0bcea2ed20dc30 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/package.json @@ -0,0 +1,88 @@ +{ + "_args": [ + [ + "shelljs@^0.5.3", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "shelljs@>=0.5.3 <0.6.0", + "_id": "shelljs@0.5.3", + "_inCache": true, + "_installable": true, + "_location": "/eslint/shelljs", + "_nodeVersion": "1.2.0", + "_npmUser": { + "email": "arturadib@gmail.com", + "name": "artur" + }, + "_npmVersion": "2.5.1", + "_phantomChildren": {}, + "_requested": { + "name": "shelljs", + "raw": "shelljs@^0.5.3", + "rawSpec": "^0.5.3", + "scope": null, + "spec": ">=0.5.3 <0.6.0", + "type": "range" + }, + "_requiredBy": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", + "_shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", + "_shrinkwrap": null, + "_spec": "shelljs@^0.5.3", + "_where": "/Users/trott/test/node_modules/eslint", + "author": { + "email": "arturadib@gmail.com", + "name": "Artur Adib" + }, + "bin": { + "shjs": "./bin/shjs" + }, + "bugs": { + "url": "https://github.com/arturadib/shelljs/issues" + }, + "dependencies": {}, + "description": "Portable Unix shell commands for Node.js", + "devDependencies": { + "jshint": "~2.1.11" + }, + "directories": {}, + "dist": { + "shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", + "tarball": "http://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz" + }, + "engines": { + "node": ">=0.8.0" + }, + "gitHead": "22d0975040b9b8234755dc6e692d6869436e8485", + "homepage": "http://github.com/arturadib/shelljs", + "keywords": [ + "unix", + "shell", + "makefile", + "make", + "jake", + "synchronous" + ], + "license": "BSD*", + "main": "./shell.js", + "maintainers": [ + { + "email": "arturadib@gmail.com", + "name": "artur" + } + ], + "name": "shelljs", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/arturadib/shelljs.git" + }, + "scripts": { + "test": "node scripts/run-tests" + }, + "version": "0.5.3" +} 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..532fed9f090caa --- /dev/null +++ b/tools/eslint/node_modules/shelljs/scripts/generate-docs.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +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, ''); +// Append docs to README +sed('-i', /## Command reference(.|\n)*/, '## 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..f9d31e06892bab --- /dev/null +++ b/tools/eslint/node_modules/shelljs/scripts/run-tests.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node +require('../global'); + +var path = require('path'); + +var failed = false; + +// +// Lint +// +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); +} + +if (exec(JSHINT_BIN + ' *.js test/*.js').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..bdeb5597249678 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/shell.js @@ -0,0 +1,159 @@ +// +// 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); + + + +//@ +//@ ## 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; +//@ cp('this_file_does_not_exist', '/dev/null'); // dies here +//@ /* more commands... */ +//@ ``` +//@ +//@ If `true` the script will die on errors. Default is `false`. 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..f6f4d254ae2cbd --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/cat.js @@ -0,0 +1,43 @@ +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') + '\n'; + }); + + if (cat[cat.length-1] === '\n') + cat = cat.substring(0, cat.length-1); + + 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..230f432651e84b --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/cd.js @@ -0,0 +1,19 @@ +var fs = require('fs'); +var common = require('./common'); + +//@ +//@ ### cd('dir') +//@ Changes to directory `dir` for the duration of the script +function _cd(options, dir) { + if (!dir) + common.error('directory not specified'); + + if (!fs.existsSync(dir)) + common.error('no such file or directory: ' + dir); + + if (!fs.statSync(dir).isDirectory()) + common.error('not a directory: ' + dir); + + 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..f2888930b35079 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/chmod.js @@ -0,0 +1,208 @@ +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 perms = fs.statSync(file).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 changeSticky = change.indexOf('t') != -1; + var changeSetuid = change.indexOf('s') != -1; + + 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) { + log(file + ' -> ' + newPerms.toString(8)); + } + + if (perms != newPerms) { + if (!options.verbose && options.changes) { + log(file + ' -> ' + newPerms.toString(8)); + } + fs.chmodSync(file, newPerms); + } + } + 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..8d10f3dde7281a --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/common.js @@ -0,0 +1,203 @@ +var os = require('os'); +var fs = require('fs'); +var _ls = require('./ls'); + +// Module globals +var config = { + silent: false, + fatal: false +}; +exports.config = config; + +var state = { + error: null, + currentCmd: 'shell.js', + tempDir: null +}; +exports.state = state; + +var platform = os.type().match(/^Win/) ? 'win' : 'unix'; +exports.platform = platform; + +function log() { + if (!config.silent) + console.log.apply(this, 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 = ''; + state.error += state.currentCmd + ': ' + msg + '\n'; + + if (msg.length > 0) + log(state.error); + + 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; + +// 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) + 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(''); + + chars.forEach(function(c) { + if (c in map) + options[map[c]] = 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.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] += '*'; + }); + + // 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, {force: options.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.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..760ea840f07218 --- /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(this, 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..cca3efb608d0dc --- /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..d259a9f26c8341 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/exec.js @@ -0,0 +1,216 @@ +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()), + 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 = ''; + // Echoes stdout changes from running process, if not silent + function updateStdout() { + if (options.silent || !fs.existsSync(stdoutFile)) + return; + + var stdoutContent = fs.readFileSync(stdoutFile, 'utf8'); + // No changes since last time? + if (stdoutContent.length <= previousStdoutContent.length) + return; + + process.stdout.write(stdoutContent.substr(previousStdoutContent.length)); + previousStdoutContent = stdoutContent; + } + + 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(codeFile)) common.unlinkSync(codeFile); + + var execCommand = '"'+process.execPath+'" '+scriptFile; + var execOptions = { + env: process.env, + cwd: _pwd(), + maxBuffer: 20*1024*1024 + }; + + if (typeof child.execSync === 'function') { + var 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)+"');", + "childProcess.stdout.pipe(stdoutStream, {end: false});", + "childProcess.stderr.pipe(stdoutStream, {end: false});", + "childProcess.stdout.pipe(process.stdout);", + "childProcess.stderr.pipe(process.stderr);", + "var stdoutEnded = false, stderrEnded = false;", + "function tryClosing(){ if(stdoutEnded && stderrEnded){ stdoutStream.end(); } }", + "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosing(); });", + "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosing(); });" + ].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>&1'; // works on both win/unix + + var 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)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stdoutFile)) { updateStdout(); 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'); + + // 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(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 + }; + return obj; +} // execSync() + +// Wrapper around exec() to enable echoing output to console in real time +function execAsync(cmd, opts, callback) { + var output = ''; + + 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, output); + }); + + c.stdout.on('data', function(data) { + output += data; + if (!options.silent) + process.stdout.write(data); + }); + + c.stderr.on('data', function(data) { + output += data; + if (!options.silent) + process.stdout.write(data); + }); + + return c; +} + +//@ +//@ ### exec(command [, options] [, callback]) +//@ Available options (all `false` by default): +//@ +//@ + `async`: Asynchronous execution. Defaults to true if a callback is provided. +//@ + `silent`: Do not echo program output to console. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var version = exec('node --version', {silent:true}).output; +//@ +//@ 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, output) { +//@ console.log('Exit code:', code); +//@ console.log('Program output:', output); +//@ }); +//@ ``` +//@ +//@ Executes the given `command` _synchronously_, unless otherwise specified. +//@ When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's +//@ `output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and +//@ the `callback` gets the arguments `(code, output)`. +//@ +//@ **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; 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..d9eeec26a93b67 --- /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..00c7d6a4068435 --- /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..a7b9701b3723cb --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/ln.js @@ -0,0 +1,53 @@ +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); +var os = require('os'); + +//@ +//@ ### ln(options, source, dest) +//@ ### ln(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 = path.resolve(process.cwd(), String(source)); + dest = path.resolve(process.cwd(), String(dest)); + + if (!fs.existsSync(source)) { + common.error('Source file does not exist', true); + } + + if (fs.existsSync(dest)) { + if (!options.force) { + common.error('Destination file exists', true); + } + + fs.unlinkSync(dest); + } + + if (options.symlink) { + fs.symlinkSync(source, dest, os.platform() === "win32" ? "junction" : null); + } else { + fs.linkSync(source, dest, os.platform() === "win32" ? "junction" : null); + } +} +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..3345db4466bc52 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/ls.js @@ -0,0 +1,126 @@ +var path = require('path'); +var fs = require('fs'); +var common = require('./common'); +var _cd = require('./cd'); +var _pwd = require('./pwd'); + +//@ +//@ ### ls([options ,] path [,path ...]) +//@ ### ls([options ,] path_array) +//@ Available options: +//@ +//@ + `-R`: recursive +//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ls('projs/*.js'); +//@ ls('-R', '/users/me', '/tmp'); +//@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ``` +//@ +//@ 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' + }); + + 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) { + // hidden file? + if (path.basename(file)[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') + file = file.replace(/\\/g, '/'); + + list.push(file); + return true; + } + + paths.forEach(function(p) { + if (fs.existsSync(p)) { + var stats = fs.statSync(p); + // Simple file? + if (stats.isFile()) { + pushFile(p, p); + return; // continue + } + + // Simple dir? + if (stats.isDirectory()) { + // Iterate over p contents + fs.readdirSync(p).forEach(function(file) { + if (!pushFile(file, p)) + return; + + // Recursive? + if (options.recursive) { + var oldDir = _pwd(); + _cd('', p); + if (fs.statSync(file).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), 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))) { + if (!pushFile(path.normalize(dirname+'/'+file), 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; 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..5a7088f2609c9f --- /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..11f96071875a47 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/mv.js @@ -0,0 +1,80 @@ +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### mv(source [, source ...], dest') +//@ ### mv(source_array, dest') +//@ Available options: +//@ +//@ + `f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mv('-f', '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': '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.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.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..41727bb918b78c --- /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(options) { + 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..bd608cb09a59e8 --- /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..65f7cb49d1cae1 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/sed.js @@ -0,0 +1,43 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### sed([options ,] search_regex, replacement, file) +//@ 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 `file` 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, file) { + 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'); + + if (!file) + common.error('no file given'); + + if (!fs.existsSync(file)) + common.error('no such file or directory: ' + file); + + var result = fs.readFileSync(file, 'utf8').replace(regex, replacement); + if (options.inplace) + fs.writeFileSync(file, result, 'utf8'); + + return common.ShellString(result); +} +module.exports = _sed; 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..45953c24e98134 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/tempdir.js @@ -0,0 +1,56 @@ +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.tempDir && os.tempDir()) || // 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..8a4ac7d4d10270 --- /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 symboilc 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..f0299993a7ae25 --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/to.js @@ -0,0 +1,29 @@ +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'); + } 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..f6d099d9a3a5ed --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/toEnd.js @@ -0,0 +1,29 @@ +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'); + } 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/which.js b/tools/eslint/node_modules/shelljs/src/which.js new file mode 100644 index 00000000000000..2822ecfb14c97e --- /dev/null +++ b/tools/eslint/node_modules/shelljs/src/which.js @@ -0,0 +1,83 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Cross-platform method for splitting environment PATH variables +function splitPath(p) { + for (i=1;i<2;i++) {} + + 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() == false; +} + +//@ +//@ ### which(command) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var nodeExec = which('node'); +//@ ``` +//@ +//@ Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. +//@ 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 (checkPath(attempt)) { + where = attempt; + return; + } + + if (common.platform === 'win') { + var baseAttempt = attempt; + attempt = baseAttempt + '.exe'; + if (checkPath(attempt)) { + where = attempt; + return; + } + attempt = baseAttempt + '.cmd'; + if (checkPath(attempt)) { + where = attempt; + return; + } + attempt = baseAttempt + '.bat'; + if (checkPath(attempt)) { + where = attempt; + return; + } + } // if 'win' + }); + } + + // 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..603644f32955a3 --- /dev/null +++ b/tools/eslint/node_modules/slice-ansi/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "slice-ansi@0.0.4", + "/Users/trott/test/node_modules/eslint/node_modules/table" + ] + ], + "_from": "slice-ansi@0.0.4", + "_id": "slice-ansi@0.0.4", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": "http://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": [ + "slice", + "string", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "email": "threedeecee@gmail.com", + "name": "dthree" + } + ], + "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/js-yaml/node_modules/argparse/node_modules/sprintf-js/.npmignore b/tools/eslint/node_modules/sprintf-js/.npmignore similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/.npmignore rename to tools/eslint/node_modules/sprintf-js/.npmignore 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/sprintf-js/bower.json b/tools/eslint/node_modules/sprintf-js/bower.json new file mode 100644 index 00000000000000..d90a75989f7b05 --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/bower.json @@ -0,0 +1,14 @@ +{ + "name": "sprintf", + "description": "JavaScript sprintf implementation", + "version": "1.0.3", + "main": "src/sprintf.js", + "license": "BSD-3-Clause-Clear", + "keywords": ["sprintf", "string", "formatting"], + "authors": ["Alexandru Marasteanu (http://alexei.ro/)"], + "homepage": "https://github.com/alexei/sprintf.js", + "repository": { + "type": "git", + "url": "git://github.com/alexei/sprintf.js.git" + } +} diff --git a/tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/demo/angular.html b/tools/eslint/node_modules/sprintf-js/demo/angular.html similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/demo/angular.html rename to tools/eslint/node_modules/sprintf-js/demo/angular.html 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/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js b/tools/eslint/node_modules/sprintf-js/gruntfile.js similarity index 100% rename from tools/eslint/node_modules/js-yaml/node_modules/argparse/node_modules/sprintf-js/gruntfile.js rename to tools/eslint/node_modules/sprintf-js/gruntfile.js 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..b347d2ebbd0d35 --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/package.json @@ -0,0 +1,78 @@ +{ + "_args": [ + [ + "sprintf-js@~1.0.2", + "/Users/trott/test/node_modules/eslint/node_modules/argparse" + ] + ], + "_from": "sprintf-js@>=1.0.2 <1.1.0", + "_id": "sprintf-js@1.0.3", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + { + "email": "hello@alexei.ro", + "name": "alexei" + } + ], + "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/sprintf-js/test/test.js b/tools/eslint/node_modules/sprintf-js/test/test.js new file mode 100644 index 00000000000000..6f57b2538c8522 --- /dev/null +++ b/tools/eslint/node_modules/sprintf-js/test/test.js @@ -0,0 +1,82 @@ +var assert = require("assert"), + sprintfjs = require("../src/sprintf.js"), + sprintf = sprintfjs.sprintf, + vsprintf = sprintfjs.vsprintf + +describe("sprintfjs", function() { + var pi = 3.141592653589793 + + 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('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) + assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) + 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("3.141592653589793", sprintf("%g", pi)) + 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("3.14159", sprintf("%.6g", pi)) + assert.equal("3.14", sprintf("%.3g", pi)) + assert.equal("3", sprintf("%.1g", pi)) + 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")) + assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) + assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) + + // 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/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..6fe09bdcc74427 --- /dev/null +++ b/tools/eslint/node_modules/string-width/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + "string-width@^1.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + ] + ], + "_from": "string-width@>=1.0.1 <2.0.0", + "_id": "string-width@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/inquirer", + "/eslint/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/trott/test/node_modules/eslint/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": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "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/tools/eslint/node_modules/string_decoder/.npmignore b/tools/eslint/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000000000..206320cc1d21b9 --- /dev/null +++ b/tools/eslint/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/tools/eslint/node_modules/string_decoder/LICENSE b/tools/eslint/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000000..6de584a48f5c89 --- /dev/null +++ b/tools/eslint/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +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/string_decoder/README.md b/tools/eslint/node_modules/string_decoder/README.md new file mode 100644 index 00000000000000..4d2aa001501107 --- /dev/null +++ b/tools/eslint/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**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/string_decoder/index.js b/tools/eslint/node_modules/string_decoder/index.js new file mode 100644 index 00000000000000..b00e54fb790982 --- /dev/null +++ b/tools/eslint/node_modules/string_decoder/index.js @@ -0,0 +1,221 @@ +// 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/string_decoder/package.json b/tools/eslint/node_modules/string_decoder/package.json new file mode 100644 index 00000000000000..1f448bb2cc2cf8 --- /dev/null +++ b/tools/eslint/node_modules/string_decoder/package.json @@ -0,0 +1,79 @@ +{ + "_args": [ + [ + "string_decoder@~0.10.x", + "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + ] + ], + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_id": "string_decoder@0.10.31", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "mail@substack.net", + "name": "substack" + }, + { + "email": "rod@vagg.org", + "name": "rvagg" + } + ], + "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..189069f4b5c9b2 --- /dev/null +++ b/tools/eslint/node_modules/strip-ansi/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + "strip-ansi@^3.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/chalk" + ] + ], + "_from": "strip-ansi@>=3.0.0 <4.0.0", + "_id": "strip-ansi@3.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/strip-ansi", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_npmVersion": "2.11.2", + "_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": [ + "/eslint/chalk", + "/eslint/inquirer", + "/eslint/string-width", + "/eslint/table" + ], + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", + "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", + "_shrinkwrap": null, + "_spec": "strip-ansi@^3.0.0", + "_where": "/Users/trott/test/node_modules/eslint/node_modules/chalk", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "description": "Strip ANSI escape codes", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", + "homepage": "https://github.com/sindresorhus/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/sindresorhus/strip-ansi.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "3.0.0" +} 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..76091512df5e46 --- /dev/null +++ b/tools/eslint/node_modules/strip-ansi/readme.md @@ -0,0 +1,33 @@ +# 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/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..3727967f5af0bb 100644 --- a/tools/eslint/node_modules/strip-json-comments/package.json +++ b/tools/eslint/node_modules/strip-json-comments/package.json @@ -1,7 +1,68 @@ { - "name": "strip-json-comments", - "version": "1.0.2", + "_args": [ + [ + "strip-json-comments@~1.0.1", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "strip-json-comments@>=1.0.1 <1.1.0", + "_id": "strip-json-comments@1.0.4", + "_inCache": true, + "_installable": true, + "_location": "/eslint/strip-json-comments", + "_nodeVersion": "0.12.5", + "_npmUser": { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + "_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": [ + "/eslint" + ], + "_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/trott/test/node_modules/eslint", + "author": { + "email": "sindresorhus@gmail.com", + "name": "Sindre Sorhus", + "url": "sindresorhus.com" + }, + "bin": { + "strip-json-comments": "cli.js" + }, + "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" + }, + "files": [ + "cli.js", + "strip-json-comments.js" + ], + "gitHead": "f58348696368583cc5bb18525fe31eacc9bd00e1", + "homepage": "https://github.com/sindresorhus/strip-json-comments", "keywords": [ "json", "strip", @@ -22,57 +83,22 @@ "bin" ], "license": "MIT", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" - }, - "files": [ - "cli.js", - "strip-json-comments.js" - ], "main": "strip-json-comments", - "bin": { - "strip-json-comments": "cli.js" - }, + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + } + ], + "name": "strip-json-comments", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git+https://github.com/sindresorhus/strip-json-comments.git" }, "scripts": { - "test": "mocha" - }, - "devDependencies": { - "mocha": "*" + "test": "mocha --ui tdd" }, - "engines": { - "node": ">=0.8.0" - }, - "gitHead": "142dd671c71f90fb7fdba440184b1bb64543acb3", - "bugs": { - "url": "https://github.com/sindresorhus/strip-json-comments/issues" - }, - "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" - }, - "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" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.2.tgz", - "readme": "ERROR: No README data found!" + "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..6378600d9eed16 --- /dev/null +++ b/tools/eslint/node_modules/supports-color/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "supports-color@^2.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/chalk" + ] + ], + "_from": "supports-color@>=2.0.0 <3.0.0", + "_id": "supports-color@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": "http://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": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect" + ], + "license": "MIT", + "maintainers": [ + { + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" + }, + { + "email": "jappelman@xebia.com", + "name": "jbnicolai" + } + ], + "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..2db6c296e24acc --- /dev/null +++ b/tools/eslint/node_modules/table/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + "table@^3.7.8", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "table@>=3.7.8 <4.0.0", + "_id": "table@3.7.8", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_resolved": "https://registry.npmjs.org/table/-/table-3.7.8.tgz", + "_shasum": "b424433ef596851922b2fd77224a69a1951618eb", + "_shrinkwrap": null, + "_spec": "table@^3.7.8", + "_where": "/Users/trott/test/node_modules/eslint", + "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": [ + "ascii", + "text", + "table", + "align", + "ansi" + ], + "license": "BSD-3-Clause", + "main": "./dist/index.js", + "maintainers": [ + { + "email": "gk@anuary.com", + "name": "gajus" + } + ], + "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/package.json b/tools/eslint/node_modules/text-table/package.json index 822956753fade0..fa69f07ccf6acb 100644 --- a/tools/eslint/node_modules/text-table/package.json +++ b/tools/eslint/node_modules/text-table/package.json @@ -1,31 +1,56 @@ { - "name": "text-table", - "version": "0.2.0", + "_args": [ + [ + "text-table@~0.2.0", + "/Users/trott/test/node_modules/eslint" + ] + ], + "_from": "text-table@>=0.2.0 <0.3.0", + "_id": "text-table@0.2.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_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/trott/test/node_modules/eslint", + "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": [ @@ -36,19 +61,36 @@ "rows", "tabular" ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "mail@substack.net", + "name": "substack" + } + ], + "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": [ + "ie/6..latest", + "chrome/20..latest", + "firefox/10..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6", + "ipad/6" + ], + "files": "test/*.js" + }, + "version": "0.2.0" } diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml b/tools/eslint/node_modules/through/.travis.yml similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/through/.travis.yml rename to tools/eslint/node_modules/through/.travis.yml 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..70aa857120166c --- /dev/null +++ b/tools/eslint/node_modules/through/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + "through@^2.3.6", + "/Users/trott/test/node_modules/eslint/node_modules/inquirer" + ] + ], + "_from": "through@>=2.3.6 <3.0.0", + "_id": "through@2.3.8", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/inquirer" + ], + "_resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "_shasum": "0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5", + "_shrinkwrap": null, + "_spec": "through@^2.3.6", + "_where": "/Users/trott/test/node_modules/eslint/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": "http://registry.npmjs.org/through/-/through-2.3.8.tgz" + }, + "gitHead": "2c5a6f9a0cc54da759b6e10964f2081c358e49dc", + "homepage": "https://github.com/dominictarr/through", + "keywords": [ + "stream", + "streams", + "user-streams", + "pipe" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "dominic.tarr@gmail.com", + "name": "dominictarr" + } + ], + "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": [ + "ie/8..latest", + "ff/15..latest", + "chrome/20..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/through/test/async.js b/tools/eslint/node_modules/through/test/async.js new file mode 100644 index 00000000000000..f6fc95f4ffad8f --- /dev/null +++ b/tools/eslint/node_modules/through/test/async.js @@ -0,0 +1,28 @@ +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/through/test/auto-destroy.js similarity index 99% rename from tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js rename to tools/eslint/node_modules/through/test/auto-destroy.js index 9a8fd0006f5b80..305fff23d35d9b 100644 --- a/tools/eslint/node_modules/inquirer/node_modules/through/test/auto-destroy.js +++ b/tools/eslint/node_modules/through/test/auto-destroy.js @@ -27,4 +27,3 @@ test('end before close', function (assert) { assert.ok(closed) assert.end() }) - diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js b/tools/eslint/node_modules/through/test/buffering.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/through/test/buffering.js rename to tools/eslint/node_modules/through/test/buffering.js diff --git a/tools/eslint/node_modules/inquirer/node_modules/through/test/end.js b/tools/eslint/node_modules/through/test/end.js similarity index 100% rename from tools/eslint/node_modules/inquirer/node_modules/through/test/end.js rename to tools/eslint/node_modules/through/test/end.js diff --git a/tools/eslint/node_modules/through/test/index.js b/tools/eslint/node_modules/through/test/index.js new file mode 100644 index 00000000000000..1d9523f40e495a --- /dev/null +++ b/tools/eslint/node_modules/through/test/index.js @@ -0,0 +1,133 @@ + +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/tryit/.npmignore b/tools/eslint/node_modules/tryit/.npmignore new file mode 100644 index 00000000000000..9daa8247da451d --- /dev/null +++ b/tools/eslint/node_modules/tryit/.npmignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules 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..b138c6ea6a7331 --- /dev/null +++ b/tools/eslint/node_modules/tryit/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + "tryit@^1.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/is-resolvable" + ] + ], + "_from": "tryit@>=1.0.1 <2.0.0", + "_id": "tryit@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/is-resolvable" + ], + "_resolved": "https://registry.npmjs.org/tryit/-/tryit-1.0.2.tgz", + "_shasum": "c196b0073e6b1c595d93c9c830855b7acc32a453", + "_shrinkwrap": null, + "_spec": "tryit@^1.0.1", + "_where": "/Users/trott/test/node_modules/eslint/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": [ + "errors", + "try", + "errorhandling" + ], + "license": "MIT", + "main": "tryit.js", + "maintainers": [ + { + "email": "henrik@andyet.net", + "name": "henrikjoreteg" + } + ], + "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/test/test.js b/tools/eslint/node_modules/tryit/test/test.js new file mode 100644 index 00000000000000..68f6f2b8cf0c6a --- /dev/null +++ b/tools/eslint/node_modules/tryit/test/test.js @@ -0,0 +1,37 @@ +var test = require('tape'); +var tryit = require('../tryit'); + + +test('basic functionality', function (t) { + var count = 0; + + var noOp = function () {}; + var throwsError = function () { + throw new Error('whammo'); + } + + tryit(noOp, function (e) { + t.ok(e == null, 'should be called without an error'); + }); + + tryit(throwsError, function (e) { + t.ok('should be called'); + t.ok(e instanceof Error); + }); + + t.end(); +}); + +test('handle case where callback throws', function (t) { + var count = 0; + + t.throws(function () { + tryit(function () {}, function(e) { + count++; + t.equal(count, 1, 'should be called once'); + throw new Error('kablowie'); + }); + }, 'should throw once'); + + t.end(); +}); 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..4b20e94f2bce62 --- /dev/null +++ b/tools/eslint/node_modules/tv4/package.json @@ -0,0 +1,114 @@ +{ + "_args": [ + [ + "tv4@^1.2.7", + "/Users/trott/test/node_modules/eslint/node_modules/table" + ] + ], + "_from": "tv4@>=1.2.7 <2.0.0", + "_id": "tv4@1.2.7", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/table" + ], + "_resolved": "https://registry.npmjs.org/tv4/-/tv4-1.2.7.tgz", + "_shasum": "bd29389afc73ade49ae5f48142b5d544bf68d120", + "_shrinkwrap": null, + "_spec": "tv4@^1.2.7", + "_where": "/Users/trott/test/node_modules/eslint/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", + "validator", + "tv4" + ], + "license:": [ + { + "type": "Public Domain", + "url": "http://geraintluff.github.io/tv4/LICENSE.txt" + }, + { + "type": "MIT", + "url": "http://jsonary.com/LICENSE.txt" + } + ], + "main": "tv4.js", + "maintainers": [ + { + "email": "luffgd@gmail.com", + "name": "geraintluff" + }, + { + "email": "bartvanderschoor@gmail.com", + "name": "bartvds" + } + ], + "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..0a23aceaa86d62 --- /dev/null +++ b/tools/eslint/node_modules/type-check/package.json @@ -0,0 +1,94 @@ +{ + "_args": [ + [ + "type-check@~0.3.2", + "/Users/trott/test/node_modules/eslint/node_modules/optionator" + ] + ], + "_from": "type-check@>=0.3.2 <0.4.0", + "_id": "type-check@0.3.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/levn", + "/eslint/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/trott/test/node_modules/eslint/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": "http://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz" + }, + "engines": { + "node": ">= 0.8.0" + }, + "files": [ + "lib", + "README.md", + "LICENSE" + ], + "gitHead": "0ab04e7a660485d0cc3aa87e95f2f9a6464cf8e6", + "homepage": "https://github.com/gkz/type-check", + "keywords": [ + "type", + "check", + "checking", + "library" + ], + "license": "MIT", + "main": "./lib/", + "maintainers": [ + { + "email": "z@georgezahariev.com", + "name": "gkz" + } + ], + "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/mkdirp/node_modules/minimist/.travis.yml b/tools/eslint/node_modules/typedarray/.travis.yml similarity index 100% rename from tools/eslint/node_modules/mkdirp/node_modules/minimist/.travis.yml rename to tools/eslint/node_modules/typedarray/.travis.yml 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/example/tarray.js b/tools/eslint/node_modules/typedarray/example/tarray.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/typedarray/example/tarray.js rename to tools/eslint/node_modules/typedarray/example/tarray.js 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..4e2e57f91e2fae --- /dev/null +++ b/tools/eslint/node_modules/typedarray/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + "typedarray@~0.0.5", + "/Users/trott/test/node_modules/eslint/node_modules/concat-stream" + ] + ], + "_from": "typedarray@>=0.0.5 <0.1.0", + "_id": "typedarray@0.0.6", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/concat-stream" + ], + "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", + "_shrinkwrap": null, + "_spec": "typedarray@~0.0.5", + "_where": "/Users/trott/test/node_modules/eslint/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", + "Int8Array", + "Int16Array", + "Int32Array", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "typed", + "array", + "polyfill" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "email": "mail@substack.net", + "name": "substack" + } + ], + "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": [ + "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" + ], + "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/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/tools/eslint/node_modules/typedarray/test/server/undef_globals.js similarity index 98% rename from tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js rename to tools/eslint/node_modules/typedarray/test/server/undef_globals.js index 425950f9fc9ed7..e57dabdcebc9c1 100644 --- a/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js +++ b/tools/eslint/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/tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/tarray.js b/tools/eslint/node_modules/typedarray/test/tarray.js similarity index 100% rename from tools/eslint/node_modules/concat-stream/node_modules/typedarray/test/tarray.js rename to tools/eslint/node_modules/typedarray/test/tarray.js 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..2f733e80ecf68b 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/trott/test/node_modules/eslint" + ] + ], + "_from": "user-home@>=2.0.0 <3.0.0", + "_id": "user-home@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint" + ], + "_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/trott/test/node_modules/eslint", "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": "http://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", + "os-homedir", "dir", "directory", "folder", - "path" + "path", + "env", + "vars", + "environment", + "variables", + "userprofile" ], - "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" + "email": "sindresorhus@gmail.com", + "name": "sindresorhus" } ], - "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/tools/eslint/node_modules/util-deprecate/History.md b/tools/eslint/node_modules/util-deprecate/History.md new file mode 100644 index 00000000000000..acc8675372e980 --- /dev/null +++ b/tools/eslint/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/tools/eslint/node_modules/util-deprecate/LICENSE b/tools/eslint/node_modules/util-deprecate/LICENSE new file mode 100644 index 00000000000000..6a60e8c225c9ba --- /dev/null +++ b/tools/eslint/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(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/util-deprecate/README.md b/tools/eslint/node_modules/util-deprecate/README.md new file mode 100644 index 00000000000000..75622fa7c250a6 --- /dev/null +++ b/tools/eslint/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +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/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/tools/eslint/node_modules/util-deprecate/node.js b/tools/eslint/node_modules/util-deprecate/node.js new file mode 100644 index 00000000000000..5e6fcff5ddd3fb --- /dev/null +++ b/tools/eslint/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; 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..36c7407627731f --- /dev/null +++ b/tools/eslint/node_modules/util-deprecate/package.json @@ -0,0 +1,81 @@ +{ + "_args": [ + [ + "util-deprecate@~1.0.1", + "/Users/trott/test/node_modules/eslint/node_modules/readable-stream" + ] + ], + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_id": "util-deprecate@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/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/trott/test/node_modules/eslint/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": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "license": "MIT", + "main": "node.js", + "maintainers": [ + { + "email": "nathan@tootallnate.net", + "name": "tootallnate" + } + ], + "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/optionator/node_modules/wordwrap/example/center.js b/tools/eslint/node_modules/wordwrap/example/center.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/wordwrap/example/center.js rename to tools/eslint/node_modules/wordwrap/example/center.js diff --git a/tools/eslint/node_modules/optionator/node_modules/wordwrap/example/meat.js b/tools/eslint/node_modules/wordwrap/example/meat.js similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/wordwrap/example/meat.js rename to tools/eslint/node_modules/wordwrap/example/meat.js 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..384454f186898f --- /dev/null +++ b/tools/eslint/node_modules/wordwrap/package.json @@ -0,0 +1,86 @@ +{ + "_args": [ + [ + "wordwrap@~1.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/optionator" + ] + ], + "_from": "wordwrap@>=1.0.0 <1.1.0", + "_id": "wordwrap@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/optionator" + ], + "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "_shasum": "27584810891456a4171c8d0226441ade90cbcaeb", + "_shrinkwrap": null, + "_spec": "wordwrap@~1.0.0", + "_where": "/Users/trott/test/node_modules/eslint/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": [ + "word", + "wrap", + "rule", + "format", + "column" + ], + "license": "MIT", + "main": "./index.js", + "maintainers": [ + { + "email": "mail@substack.net", + "name": "substack" + } + ], + "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/wordwrap/test/break.js b/tools/eslint/node_modules/wordwrap/test/break.js new file mode 100644 index 00000000000000..6e7a9a55d65461 --- /dev/null +++ b/tools/eslint/node_modules/wordwrap/test/break.js @@ -0,0 +1,32 @@ +var test = require('tape'); +var wordwrap = require('../'); + +test('hard', function (t) { + var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,' + + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",' + + '"browser":"chrome/6.0"}' + ; + var s_ = wordwrap.hard(80)(s); + + var lines = s_.split('\n'); + t.equal(lines.length, 2); + t.ok(lines[0].length < 80); + t.ok(lines[1].length < 80); + + t.equal(s, s_.replace(/\n/g, '')); + t.end(); +}); + +test('break', function (t) { + var s = new Array(55+1).join('a'); + var s_ = wordwrap.hard(20)(s); + + var lines = s_.split('\n'); + t.equal(lines.length, 3); + t.ok(lines[0].length === 20); + t.ok(lines[1].length === 20); + t.ok(lines[2].length === 15); + + t.equal(s, s_.replace(/\n/g, '')); + t.end(); +}); diff --git a/tools/eslint/node_modules/optionator/node_modules/wordwrap/test/idleness.txt b/tools/eslint/node_modules/wordwrap/test/idleness.txt similarity index 100% rename from tools/eslint/node_modules/optionator/node_modules/wordwrap/test/idleness.txt rename to tools/eslint/node_modules/wordwrap/test/idleness.txt diff --git a/tools/eslint/node_modules/wordwrap/test/wrap.js b/tools/eslint/node_modules/wordwrap/test/wrap.js new file mode 100644 index 00000000000000..a478bd442d1ed5 --- /dev/null +++ b/tools/eslint/node_modules/wordwrap/test/wrap.js @@ -0,0 +1,33 @@ +var test = require('tape'); +var wordwrap = require('../'); + +var fs = require('fs'); +var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8'); + +test('stop80', function (t) { + var lines = wordwrap(80)(idleness).split(/\n/); + var words = idleness.split(/\s+/); + + lines.forEach(function (line) { + t.ok(line.length <= 80, 'line > 80 columns'); + var chunks = line.match(/\S/) ? line.split(/\s+/) : []; + t.deepEqual(chunks, words.splice(0, chunks.length)); + }); + t.end(); +}); + +test('start20stop60', function (t) { + var lines = wordwrap(20, 100)(idleness).split(/\n/); + var words = idleness.split(/\s+/); + + lines.forEach(function (line) { + t.ok(line.length <= 100, 'line > 100 columns'); + var chunks = line + .split(/\s+/) + .filter(function (x) { return x.match(/\S/) }) + ; + t.deepEqual(chunks, words.splice(0, chunks.length)); + t.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' ')); + }); + t.end(); +}); 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..6b42a3ffd6f81a --- /dev/null +++ b/tools/eslint/node_modules/wrappy/package.json @@ -0,0 +1,78 @@ +{ + "_args": [ + [ + "wrappy@1", + "/Users/trott/test/node_modules/eslint/node_modules/inflight" + ] + ], + "_from": "wrappy@>=1.0.0 <2.0.0", + "_id": "wrappy@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/inflight", + "/eslint/once" + ], + "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", + "_shasum": "1e65969965ccbc2db4548c6b84a6f2c5aedd4739", + "_shrinkwrap": null, + "_spec": "wrappy@1", + "_where": "/Users/trott/test/node_modules/eslint/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": [ + { + "email": "i@izs.me", + "name": "isaacs" + } + ], + "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/test/basic.js b/tools/eslint/node_modules/wrappy/test/basic.js new file mode 100644 index 00000000000000..5ed0fcdfd9c52e --- /dev/null +++ b/tools/eslint/node_modules/wrappy/test/basic.js @@ -0,0 +1,51 @@ +var test = require('tap').test +var wrappy = require('../wrappy.js') + +test('basic', function (t) { + function onceifier (cb) { + var called = false + return function () { + if (called) return + called = true + return cb.apply(this, arguments) + } + } + onceifier.iAmOnce = {} + var once = wrappy(onceifier) + t.equal(once.iAmOnce, onceifier.iAmOnce) + + var called = 0 + function boo () { + t.equal(called, 0) + called++ + } + // has some rando property + boo.iAmBoo = true + + var onlyPrintOnce = once(boo) + + onlyPrintOnce() // prints 'boo' + onlyPrintOnce() // does nothing + t.equal(called, 1) + + // random property is retained! + t.equal(onlyPrintOnce.iAmBoo, true) + + var logs = [] + var logwrap = wrappy(function (msg, cb) { + logs.push(msg + ' wrapping cb') + return function () { + logs.push(msg + ' before cb') + var ret = cb.apply(this, arguments) + logs.push(msg + ' after cb') + } + }) + + var c = logwrap('foo', function () { + t.same(logs, [ 'foo wrapping cb', 'foo before cb' ]) + }) + c() + t.same(logs, [ 'foo wrapping cb', 'foo before cb', 'foo after cb' ]) + + t.end() +}) 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..288a9ad77e8598 --- /dev/null +++ b/tools/eslint/node_modules/write/package.json @@ -0,0 +1,97 @@ +{ + "_args": [ + [ + "write@^0.2.1", + "/Users/trott/test/node_modules/eslint/node_modules/flat-cache" + ] + ], + "_from": "write@>=0.2.1 <0.3.0", + "_id": "write@0.2.1", + "_inCache": true, + "_installable": true, + "_location": "/eslint/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": [ + "/eslint/flat-cache" + ], + "_resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "_shasum": "5fc03828e264cea3fe91455476f7a3c566cb0757", + "_shrinkwrap": null, + "_spec": "write@^0.2.1", + "_where": "/Users/trott/test/node_modules/eslint/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": "http://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": [ + { + "email": "github@sellside.com", + "name": "jonschlinkert" + } + ], + "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..561f996b7fb583 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2007-2015 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..3acfd7e928ee25 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/README.md @@ -0,0 +1,254 @@ +[XRegExp](http://xregexp.com/) 3.0.0 +==================================== + +XRegExp provides augmented and extensible JavaScript regular expressions. You get new syntax, flags, and methods 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 worrying about pesky cross-browser inconsistencies and things like manually manipulating `lastIndex` or slicing strings when tokenizing. + +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' + +// If you want, you can extend native methods so you don't have to worry about this. +// Doing so also fixes numerous browser bugs in the native methods +XRegExp.install('natives'); +'2015-02-22'.replace(date, '${month}/${day}/${year}'); // -> '02/22/2015' +'2015-02-22'.replace(date, function(match) { + return match.month + '/' + match.day + '/' + match.year; +}); // -> '02/22/2015' +date.exec('2015-02-22').year; // -> '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](http://npmjs.org/) package 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 apply astral mode 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. The test string uses a surrogate pair to represent U+1F4A9 +XRegExp('^\\pS$', 'A').test('\uD83D\uDCA9'); // -> true + +// Implicit flag A +XRegExp.install('astral'); +XRegExp('^\\pS$').test('\uD83D\uDCA9'); // -> 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: 8}, +{name: 'value', value: 'function(x,y){return y+x;}', start: 9, end: 35} +] */ + +// 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](http://npmjs.org/): + +```bash +npm install xregexp +``` + +In [Node.js](http://nodejs.org/): + +```js +var XRegExp = require('xregexp'); +``` +The [CommonJS](http://wiki.commonjs.org/wiki/Modules)-style `require('xregexp').XRegExp` also works. + +In an AMD loader like [RequireJS](http://requirejs.org/): + +```js +require({paths: {xregexp: 'xregexp-all'}}, ['xregexp'], function(XRegExp) { + console.log(XRegExp.version); +}); +``` + +## Changelog + +* Releases: [Version history](http://xregexp.com/history/). +* Upcoming: [Issue tracker](https://github.com/slevithan/xregexp/issues). + +## About + +XRegExp copyright 2007-2015 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. Source file concatenator by [Bjarke Walling](http://twitter.com/walling). + +Tests: Uses [Jasmine](http://pivotal.github.com/jasmine/) 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 License](http://mit-license.org/). + +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..6a3ec75414b251 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + "xregexp@^3.0.0", + "/Users/trott/test/node_modules/eslint/node_modules/table" + ] + ], + "_from": "xregexp@>=3.0.0 <4.0.0", + "_id": "xregexp@3.0.0", + "_inCache": true, + "_installable": true, + "_location": "/eslint/xregexp", + "_nodeVersion": "3.3.1", + "_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": [ + "/eslint/table" + ], + "_resolved": "https://registry.npmjs.org/xregexp/-/xregexp-3.0.0.tgz", + "_shasum": "a04f25d9ffe16c1aee40ed521a1b1366e8d34636", + "_shrinkwrap": null, + "_spec": "xregexp@^3.0.0", + "_where": "/Users/trott/test/node_modules/eslint/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": {}, + "directories": {}, + "dist": { + "shasum": "a04f25d9ffe16c1aee40ed521a1b1366e8d34636", + "tarball": "http://registry.npmjs.org/xregexp/-/xregexp-3.0.0.tgz" + }, + "files": [ + "LICENSE", + "xregexp-all.js" + ], + "gitHead": "8183679d136bda6c0d015160a912ce2e54375917", + "homepage": "http://xregexp.com/", + "keywords": [ + "regex", + "regexp" + ], + "license": "MIT", + "main": "xregexp-all.js", + "maintainers": [ + { + "email": "steves_list@hotmail.com", + "name": "slevithan" + } + ], + "name": "xregexp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/slevithan/xregexp.git" + }, + "scripts": { + "build": "./tools/concatenate-source.sh" + }, + "version": "3.0.0" +} diff --git a/tools/eslint/node_modules/xregexp/xregexp-all.js b/tools/eslint/node_modules/xregexp/xregexp-all.js new file mode 100644 index 00000000000000..cfeed86e354004 --- /dev/null +++ b/tools/eslint/node_modules/xregexp/xregexp-all.js @@ -0,0 +1,4486 @@ +/*! + * XRegExp-All 3.0.0 + * + * Steven Levithan (c) 2012-2015 MIT License + */ + +// Module systems magic dance. Don't use strict mode for this function, so it can assign to global. +;(function(root, definition) { + var self; + + // RequireJS + if (typeof define === 'function') { + define(definition); + // CommonJS + } else if (typeof exports === 'object') { + self = definition(); + // Use Node.js's `module.exports`. This supports both `require('xregexp')` and + // `require('xregexp').XRegExp` + (typeof module === 'object' ? (module.exports = self) : exports).XRegExp = self; + //